# README
Design Patterns
a) Creational pattern:
1) Singleton Pattern - Ensures only one instance of a class is created.
2) Factory Method pattern - Creates objects without specifying the exact class.
3) Abstract Factory pattern- Creates families of related objects without specifying their concrete classes.
4) Builder pattern - Constructs complex objects step by step.
5) Prototype pattern - Creates new objects by cloning existing ones.
b) Structural pattern:
1) Adapter pattern - Converts the interface of a class into another interface clients expect.
2) Bridge pattern - Decouples an abstraction from its implementation, allowing them to vary independently.
3) Composite pattern - Composes objects into tree structures and treats them uniformly.
4) Decorator pattern - Dynamically adds additional behavior to an object.
5) Facade pattern - Provides a simplified interface to a complex subsystem.
6) Flyweight pattern - Minimizes memory usage by sharing common state between multiple objects.
7) Proxy pattern - Provides a placeholder for another object to control access to it.
c) Behavioral pattern:
1) Observer pattern - Notifies multiple objects about state changes in an object.
2) Strategy pattern - Encapsulates interchangeable algorithms and allows them to be easily swapped.
3) Chain of Responsibility pattern - Chains objects together to process a request sequentially.
4) Command pattern - Chains objects together to process a request sequentially.
5) Iterator pattern - Provides a way to access elements of an aggregate object sequentially.
6) State pattern - Alters an object's behavior based on its internal state.
7) Template Method pattern - Defines the skeleton of an algorithm, allowing subclasses to provide specific implementations.
8) Visitor pattern - Separates the algorithms from the objects they operate on, allowing new operations to be added without modifying the objects.
9) Mediator pattern - Defines an object that encapsulates communication and coordination between other objects
10) Memento pattern - Captures and stores the internal state of an object
11) Interpreter Pattern - Defines a representation of grammar and interprets sentences in that grammar
d) Architectural pattern:
1) Model-View-Controller (MVC) pattern - Separates an application into three interconnected components: Model, View, and Controller.
2) Model-View-Presenter (MVP) pattern - Separates an application into three components: Model, View, and Presenter, similar to MVC but with a different interaction pattern.
3) Model-View-ViewModel (MVVM) pattern - Separates an application into three components: Model, View, and ViewModel, often used in GUI applications.
# Functions
`NewRestaurant` constructs a new restaurant instance with 10 dishes, all of them being clean.
# Structs
No description provided by the author
Step 3: Executing commands A Cook comes with their list of commands as attributes.
The MakePizzaCommand is a struct which contains the number of pizzas to make, as well as the restaurant as its attributes.
The MakeSaladCommand is similar to the MakePizza command.
Step 1: creating commands The restaurant contains the total dishes and the total cleaned dishes.
# Interfaces
command pattern
- useful when you need to execute tasks, but you want
to separate the tasks management from the execution
of the task itself.