Skip to content

adagio/swiftFactoryMethodDP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Factory Method Design Pattern, in Swift 3.0

Inspired on github ochococo/Design-Patterns-In-Swift

Definition

The factory pattern is used to replace class constructors, abstracting the process of object generation so that the type of the object instantiated can be determined at run-time.

Pattern Diagram

Factory Method Pattern Class Diagram

Class Diagram for Currency Factory example (@ochococo)

Implementation Details

I implemented a second example, the one present in Design Patterns book by Head First. An implementation in Java can be found in adagio/PizzaStores - factory method branch

There is a slight difference, between this two examples. The one from Head First considers Creator and Concrete Creator classes. We have implemented NYStylePizzaStore, but not a PizzaStore protocol.

Another implementations

About

🏭 Factory Method Design Pattern, in Swift 3.0

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages