Design patterns: Creational Patterns

Design patterns are highly recomended to learn when we are trying to solve a software design problems in a very organized and efficient way. There are three types of desing patters but in this post we are going to focus in some creational patterns:

Abstract Factory Design Pattern: This design patthern is knowns as a class that handle the creation of abstract factory class where everything is encapsulate, in this design every step is separate as an abstract class or interface which make it more flexible. You can see a representation of it in the UML diagram below.


i

If you want to know more about this pattern watch this video or see this website.

Builder Design Pattern: This creational design pattern as named it is a builder class that takes differents objects an push it all together in order to create a new object.

This UML above show how a different way to make a complex object with Builder Design patthern , this video show step by step the structure of the builder pattern

Factory Design Pattern: This Creational Design pattern has a factory class that handles the creations of objects for other classes you can see a brief example of this in the UML diagram below.

Prototype Design Pattern: It is the design pattern that allows you to create new objects or instances by cloning other intances or objects at run time.

If you want to try the implementation, follow this Dereck Banas’s video on youtube about prototype design pattern

Singleton Design Pattern: This creational design pattern limit the creation of an object of a class to one. In a sigleton class the contructor is made private to make sure there is going to be a single instance of the class.

I recomend you to watch this video to see how Derek Banas implemented this design it is very straight forward.

Leave a comment

Design a site like this with WordPress.com
Get started