Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Creational Patterns - Builder

Creational Patterns - Builder

Prepared for the Melbourne Patters Group

Chris Bushell

December 03, 2008
Tweet

More Decks by Chris Bushell

Other Decks in Programming

Transcript

  1. Intent   “Separate  the  construc%on  of  a  complex  object  

    from  its  representa%on  so  that  the  same   construc%on  process  can  create  different   representa%ons”  
  2. Applicability   •  Separate  representa%on  of  an  object  from  its

      construc%on   •  Construc%on  of  object  follows  a  definable   algorithm   •  Different  objects  can  be  created  following  the   same  algorithm  
  3. Example   •  Build  vehicle   – Build  engine   – Build

     chassis   – A+ach  engine  to  chassis   – Build  wheels   – A+ach  wheels  to  chassis     Road  car,  F1  car,  Airplane,  ForkliQ  truck  etc.  
  4. Builder  Vs.  Abstract  Factory   •  Builder      

    – Focus  on  process  of  crea%ng  product  by  following   an  algorithm   – Product  is  return  as  final  step   •  Abstract  Factory   – Focus  on  building  families  of  object