Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.43 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.43 KB

Creational Design Pattern

Contents

If you are looking for something specific, you can jump right into the relevant section from here.

  1. Prototype Pattern
  2. Factory Method Pattern
  3. Abstract Factory Pattern
  4. Builder Pattern
  5. Singleton Design Pattern

Prototype Pattern

This type of design pattern is used to instantiate a new object by cloning an existing object called prototype.

Factory Method Pattern

It is the most commonly used design pattern. Basically, it just abstracts the creation of an object.

Abstract Factory Pattern

This design pattern provides an interface for creating families of related objects without specifying their concrete classes. They are often implemented with Factory Method pattern.

Builder Pattern

This design pattern separate the process of creation of objects from its actual usage.

Singleton Design Pattern

In swift we define Singleton classes by using the static keyword. It means that the object is going to be instantiated only once. Static properties are lazy initialized and will not be instantiated until called. There is only one copy of this object and is used by the other objects globally.

For more, check the Medium Blog