Content deleted Content added
→Abstract functions?: new section |
|||
Line 102:
The example given leans more towards abstract factory. As mentioned, Builder is best used for building up Composites. So, Menu Items in menu system, or Genealogy tree of parents and children. Builders can use factories, and often do. This is why the example is confusing. It is attempting to use factories and be a builder at the same time. An improvement to the example would be to have a PizzaFactory, a SoftDrinkFactory and SideOrderFactory. Then, create an OrderBuilder that would build up an order using these factories. I'm not saying that this is the best example, but much clearer than what is there now. A simpler example, like building up a MenuSystem for an application, would be much clearer. <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Hosick|Hosick]] ([[User talk:Hosick|talk]] • [[Special:Contributions/Hosick|contribs]]) 07:44, 17 May 2009 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
== Abstract functions? ==
Gang of Four says ''not'' to use abstract functions, but instead use empty functions. Normally on a builder pattern you may not want to implement everything, if you set abstract functions then you'll be forced to implement them, even if it was empty. - [[Special:Contributions/114.76.239.105|114.76.239.105]] ([[User talk:114.76.239.105|talk]]) 15:11, 26 December 2010 (UTC)
|