Presentation Builder Pattern OOAD

7
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

Transcript of Presentation Builder Pattern OOAD

Page 1: Presentation Builder Pattern OOAD

Royal University of Phnom PenhFaculty of Engineering

Builder PatternDR: Srun Sovila

OOAD

Member : Chea PanhaMao ChendaLong LikaPeng Sony

15-12-2016

Page 2: Presentation Builder Pattern OOAD

Outline

I. What is Builder Pattern ?II. StructureIII. Pros And ConsIV. Implementation

Page 3: Presentation Builder Pattern OOAD

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

Page 4: Presentation Builder Pattern OOAD

Structure

Director

Builder.BuildPart ()

<<interface>>

Product

Construct ()

<<interface>>

Builder

Buildpart ()

Concrete BuilderB

Concrete BuilderA

BuildPart ()

GetProduct ()

BuildPart ()

GetProduct ()

Concrete ProductA

Concrete ProductB

Page 5: Presentation Builder Pattern OOAD

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.

Page 6: Presentation Builder Pattern OOAD

Implementation

Page 7: Presentation Builder Pattern OOAD

ThankYou

Q&A