-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdesign_patterns.txt
18 lines (16 loc) · 1.39 KB
/
design_patterns.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1) Factory Design Pattern
We used the factory design pattern in the user class to instantiate Users. This is done by creating a User interface to
allow for different types of Users like account user and restaurant owner. As well, we implement a class that acts as
a factory in the create_user package. This factory is used to keep abstractions common and rely less directly on a
single class, other user types can be added using the interface and factory. This decouples the creation from concrete
classes like account user and restaurant owner. As well, a factory is also implemented in RestaurantUseCase to create
restaurant objects.
2) Observer Pattern
We used the observer design pattern in the CreateReviewPopUp class. The code has a drop box list which listens for a
selection of an item in the drop box. When selected, the observer catches the button click and updates a stored variable
in the class correlating to the selected button.
3) Facade Design Pattern
Within the create_user a facade is implemented within the interactor to connect to the various functions and classes,
including the gateways and presenters, to allow for a simpler interaction between the classes, use cases, and layers
of architecture. This facade design pattern is also implemented in other interactors such as the dish interactor, where
it is used to gather and use various classes in one convenient spot to allow simpler interaction.