Design Pattern (Gof) : Hoa Nguyen
Design Pattern (Gof) : Hoa Nguyen
Design Pattern (Gof) : Hoa Nguyen
Hoa Nguyen
Factory
Definition
Define an interface for creating an object, but let subclasses decide which class to
instantiate. Factory Method lets a class defer instantiation to subclasses
Factory
Definition
Define an interface for creating an object, but let subclasses decide which class to
instantiate. Factory Method lets a class defer instantiation to subclasses
Factory
Example
Factory
Definition
Provide an interface for
creating families of related or
dependent objects without
specifying their concrete
classes
Abstract Factory
Definition
Abstract Factory
Example
Builder
Definition
Separate the construction of a complex object from its representation so that the
same construction process can create different representations
Builder
Definition
Builder
Definition
Specify the kind of objects to create using a prototypical instance, and create new
object by copying this prototype
Prototype
Definition
Prototype
Definition
Ensure a class has only one instance and provide a global point of access to it