Lets hear it for BUILDER - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Lets hear it for BUILDER

Description:

3) The designer tells the furniture maker to build a chair. Note that the furniture maker could have also built a desk or a tank. Product ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 10
Provided by: coreys
Category:
Tags: builder | furniture | hear | lets

less

Transcript and Presenter's Notes

Title: Lets hear it for BUILDER


1
Lets hear it for BUILDER!!!!!!!
2
Builder The Intent \ Description
  • To separate the construction of a complex object
    from its representation so that the same
    construction process can create different
    representations

Source GOF
3
  • WHAT?!?_at_?!!_at_????

4
Builder The Intent In English
  • A client uses the builder pattern like an
    individual would use an interior designer and
    furniture maker to build furniture - the
    individual (Client) tells the designer what he
    wants, and the designer (Director), the furniture
    maker (Builder), and his tool (Concrete builders)
    create the furniture (Product)

5
Builder Example 1
6
Builder Example 1 UML
Builder
Furniture Maker
BuildFurniture()
ChairBuilder
DeskBuilder
TankBuilder
BuildFurniture() GetDesk()
BuildFurniture() GetChair()
BuildFurniture() GetTank()
Source GOF
7
Why Use Builder?
  • Use the builder pattern when
  • The algorithm for creating a complex object
    should be independent of the parts that make up
    the object and how they are assembled
  • The construction process must allow different
    representations for the object thats
    constructed
  • Builder is very useful because it allows the
    program to create a flexible number of objects
    you can add or delete objects as necessary

Source GOF
8
Builder The Steps
Source GOF
9
Builder Example 2
Source GOF
Write a Comment
User Comments (0)
About PowerShow.com