Skip to content

Abstract Factory, Builder, Factory Method, Prototype and SIngleton creational design pattern in swift

Notifications You must be signed in to change notification settings

LH17/Creational-Design-Pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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

About

Abstract Factory, Builder, Factory Method, Prototype and SIngleton creational design pattern in swift

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages