jaygajera17 / E-commerce-project-springBoot

This project serves as an easy-to-understand setup for beginners , providing a base foundation in Spring Boot , MVC & hibernate.
https://jaygajera17.github.io/E-commerce-project-springBoot/
560 stars 564 forks source link

Redesign applying the Composite pattern #57

Open gsus25 opened 9 months ago

gsus25 commented 9 months ago

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 commented 6 months ago

Nice proposal

NisargPipaliya commented 2 months ago

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