Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advice for "045_BillyBurger" #3

Open
DJavierReyesM opened this issue Jan 2, 2021 · 0 comments
Open

Advice for "045_BillyBurger" #3

DJavierReyesM opened this issue Jan 2, 2021 · 0 comments

Comments

@DJavierReyesM
Copy link

Hi again. I was checking the code that you use for "045_BillyBurger" and I think about something you can use: Well, you want to operate with hamburgers with the class "Hamburger" where within it are different attributes of type String representing the additional ones with which to order the hamburger, be they drinks, potatoes, etc. And Hamburger's heritage branch does the same. Since being as Strings the functionality is limited, implementing the Composite pattern would be able to operate the hamburgers together with their additional ones as simple objects if desired or work them as a single as a "combo" through a recursive composition where a in turn, the client could operate with these types of objects indistinctly, citing as an example the calculation of the total to pay for all the food ordered. I add the uml class diagram to illustrate the design:
Copy of Blank diagram (1)
Hope you're fine and have a nice day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant