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

Redesign applying the Composite pattern #57

Open
gsus25 opened this issue Dec 16, 2023 · 2 comments
Open

Redesign applying the Composite pattern #57

gsus25 opened this issue Dec 16, 2023 · 2 comments

Comments

@gsus25
Copy link

gsus25 commented Dec 16, 2023

Proposal:
It is proposed to implement the Composite pattern to hierarchically structure entities such as products, categories, and shopping carts in the project. A common interface will be created to allow clients to interact uniformly with individual products and categories, facilitating standard operations like adding, removing, and retrieving information. The introduction of the Composite pattern aims to simplify the manipulation of the product and category structure consistently, promoting code reusability, and facilitating the system's expansion into future functionalities.

Consequences:
• Uniform Interaction: The implementation of the Composite pattern will provide a consistent interface for products and categories, allowing consistent operations and simplifying client interaction.
• Flexibility and Extensibility: By treating products and categories uniformly, the system's flexibility to build complex structures is enhanced. Additionally, adopting the Composite pattern facilitates the introduction of new functionalities without substantial modifications to existing code.
• Code Simplification and Coherence: The Composite pattern centralizes common operations in a shared interface, simplifying the code and increasing coherence in the manipulation of products and categories. This results in more maintainable and easily understandable code.

Solution in UML:
image

@Abinash018
Copy link

Nice proposal

@NisargPipaliya
Copy link
Collaborator

NisargPipaliya commented Jul 13, 2024

@gsus25
sorry for late response.
It's a great proposal, will you be working on it?

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

3 participants