DD – Design Patterns – Factory

This is an outline of the topic. I will revisit this topic latter and expand on this outline.

What are Design Patterns? They are different styles of programming to help with the constant change, modification, addition, and scrapping of features, functionality, and structure of a code base.

The Factory Pattern is one of the most commonly used (Purdy, 2002). But what is the Factory pattern, well lets find out!

The logical model.

Factory’s are an object designed to wrap the actualization if the instantiation process up inside the factory. The Client orders a Product from the Factory instead of instantiating it directly. This abstracts the client from the objects production method. This way if their is ever a need to change the production method, all other interactions remain unaffected.

The Physical Model

The implementation is commonly enacted through the creation of two abstract classes these being the AbstractProduct and the AbstractFactory and then inherting from these are the concrete classes ConcreteProduct and ConcreteFactory The reason for these two layers is that the abstract classes can be used as the interaction much like an interface, while the concrete classes are the implementation of the production method, opening up the possibility for as many concrete classes as are needed, this will also allow endless possibility for the aforementioned modifications that are often ongoing throughout development and post development of a project.


Purdy, D. (2002). Exploring the Factory Design Pattern. [online] Msdn.microsoft.com. Available at: https://msdn.microsoft.com/en-us/library/ee817667.aspx [Accessed 5 Mar. 2018].

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s