Creational Design Patterns using Java by Ravindra Sadaphule

Creational Design Patterns using Java by Ravindra Sadaphule

Author:Ravindra Sadaphule
Language: eng
Format: mobi, azw3, pdf
Published: 2016-04-07T21:00:00+00:00


Implementation

The use case here is to build a pizza based on customer specification. PizzaBuilder is an abstract class that dictates the steps to build pizza and also orchestrates the pizza making steps. VeggiePizzaBuilder, PizzaPepperoniBizzaBuilder and ChickenPizzaBuildera extends PizzaBuilderClass. The only method they override is addToppings() method. VeggiePizzaBuilder adds topics like tomato, green pepper and onions. PeopporoniPizzaBuilder adds pepperoni slices. ChickenPizzaBuilder adds grilled checkin toppings. Rest of the methods remain same for all three types of pizzas. Director class determines which PizzaBuilder class it should invoke based on PizzaType specification from customer. Client class represents customer who is placing the order. This relationship is explained in picture below. Note that ‘+’ prefix in front of method denote public methods whereas ‘#’ prefix denotes protected methods



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.