Coding Kata on design patterns: Kata1, The Abstract Factory Pattern


This post is the first in a series dedicated to Coding Kata’s and design patterns.  

Because I’m not always able to remember all the patterns I decided to learn by practice.  

Every week I will try to create a Kata with a simple problem that has to be resolved with one of the Gov’s design patterns.  

Because I want to start smoothly we’ll start with one of the simplest pattern -> the Abstract Factory.

Kata1 ->

A product has a property Name.  

Because the Name is used as an identifier it can’t be changed.  

We need to be able to construct 2 products with following names: Product1, Product2.

Use the abstract factory pattern so that you’re able to create Products.


This is my solution for Kata1.



Leave a Reply