After a brief hiatus for the holidays, I will continue my series on
design patterns. Currently I am going through Creational design
patterns, I will be discussing about the Abstract Factory pattern in
this post. You can read about the other patterns from the following
links.
Abstract factory pattern deals with creation of objects that are
designed to be produced together. Abstract factory can be defined to
create different objects of different types and in different
combinations. This pattern isolates the object definitions and their
class names so that only a factory can return an object when a client
requires it.
As we can see from the above example, the abstract factory handles
creation of objects and keeps their details hidden from the client. We
can use the Abstract Factory pattern when a system should be independent
of how its objects are created and represented or when a system can be
configured with one of many families of products or when the importance
is on revealing interfaces and not implementations.
In my next post I will writing about the Builder pattern.
Comments