mercredi 27 mars 2019

Decorator design and factory design patterns

I am trying to figure out how to use the users input and output certain information depending on the user input. Can someone provide a simple example of using the decorator pattern for a simple pizza shop for example?

So I know how to go about the decorator pattern, it’s just the user input portion that has me stuck. So let’s say the user wants to make a pizza, they will first choose the size of pizza, and then add ASB many toppings as they want. Then when they have finished, they will see their total price for what they added as well as what they added (like a reciept). This is in Java.

Aucun commentaire:

Enregistrer un commentaire