Skip to content

To use the decorator pattern for a pizza with toppings, I created a Pizza base class with a method to display "Pizza". Then, create decorator classes for each topping (Olive, Pepper, Mashroom), each extending Pizza. These classes would override the display method to include their specific topping message.

Notifications You must be signed in to change notification settings

ParisaArbab/Decorator-Pattern--Pizza

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Decorator-Pattern--Pizza

Let us consider a PIZZA class which has a method that displays the message “Pizza”. A PIZZA object may be decorated by 3 kinds of toppings.  OLIVE class has a method that displays the message “With Olive”.  PEPPER class has a method that displays the message “With Pepper”.  MASHROOM class has a method that displays the message “With Mashroom”. We would like to use the decorator pattern to create pizzas with toppings.

About

To use the decorator pattern for a pizza with toppings, I created a Pizza base class with a method to display "Pizza". Then, create decorator classes for each topping (Olive, Pepper, Mashroom), each extending Pizza. These classes would override the display method to include their specific topping message.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages