You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the creation of objects such as events is distributed directly in the PizzaKitchen code, which increases coupling and makes it difficult to extend for new types of events or pizzas. This violates the single responsibility principle, since PizzaKitchen performs both business logic and object construction.
Proposed Solution:
Implement the Factory Method pattern to encapsulate the creation of events.
Create a factory to generate Event instances based on the current state of the order.
Modify PizzaKitchen to delegate the creation of these objects to the respective factories.
Consequences or implications of the redesign:
Advantages:
Decoupling of object creation and business logic.
Easier to add new types of events.
Better maintenance and adherence to the single responsibility principle.
Impacts:
Minimal changes to current code; new classes are added without significantly affecting existing logic.
Resources:
UML Diagram:
The text was updated successfully, but these errors were encountered:
Problem description:
Currently, the creation of objects such as events is distributed directly in the PizzaKitchen code, which increases coupling and makes it difficult to extend for new types of events or pizzas. This violates the single responsibility principle, since PizzaKitchen performs both business logic and object construction.
Proposed Solution:
Consequences or implications of the redesign:
Advantages:
Impacts:
Resources:
UML Diagram:
The text was updated successfully, but these errors were encountered: