Royal University of Phnom Penh
Faculty of Engineering
Builder Pattern
DR: Srun Sovila
OOAD
Member :
Chea Panha
Mao Chenda
Long Lika
Peng Sony
15-12-2016
Outline
I. What is Builder Pattern ?
II. Structure
III. Pros And Cons
IV. Implementation
 Builder Pattern
 An Object creation software design pattern.
 A pattern designed to help you configure complex objects.
 Separate the construction of a complex object from its
representation.
 The same construction process can create different
representation
 Structure
Director
Builder.BuildPart ()
<<interface>>
Product
Construct ()
<<interface>>
Builder
Buildpart ()
Concrete BuilderBConcrete BuilderA
BuildPart ()
GetProduct ()
BuildPart ()
GetProduct ()
Concrete
ProductA
Concrete
ProductB
 Pros and Cons
Pros
• Allows you to vary a product’s internal representation
• Encapsulates code for construction and representation
• Provides control over steps of construction process
Cons
• Requires creating a separate ConcreteBuilder for each different
type of product.
 Implementation
Thank
You
Q&A

Presentation Builder Pattern OOAD

  • 1.
    Royal University ofPhnom Penh Faculty of Engineering Builder Pattern DR: Srun Sovila OOAD Member : Chea Panha Mao Chenda Long Lika Peng Sony 15-12-2016
  • 2.
    Outline I. What isBuilder Pattern ? II. Structure III. Pros And Cons IV. Implementation
  • 3.
     Builder Pattern An Object creation software design pattern.  A pattern designed to help you configure complex objects.  Separate the construction of a complex object from its representation.  The same construction process can create different representation
  • 4.
     Structure Director Builder.BuildPart () <<interface>> Product Construct() <<interface>> Builder Buildpart () Concrete BuilderBConcrete BuilderA BuildPart () GetProduct () BuildPart () GetProduct () Concrete ProductA Concrete ProductB
  • 5.
     Pros andCons Pros • Allows you to vary a product’s internal representation • Encapsulates code for construction and representation • Provides control over steps of construction process Cons • Requires creating a separate ConcreteBuilder for each different type of product.
  • 6.
  • 7.