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

Update Development_Process.md #601

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Topics/Development_Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,31 @@ The SOLID principles are:
## Restaurant example of each principle

#### SRP
Consider a **Chef** in a restaurant. Initially, the chef might handle multiple responsibilities: preparing dishes, managing inventory, and overseeing kitchen hygiene. Adhering to SRP, distinct roles are established. The chef focuses solely on cooking, while inventory management becomes the responsibility of a dedicated inventory manager.
Consider a **Chef** in a restaurant. Initially, the chef might handle multiple responsibilities: preparing dishes, managing inventory, and overseeing kitchen hygiene. Adhering to SRP, distinct roles are established. The chef focuses solely on cooking and kitchen hygiene, while inventory management becomes the responsibility of a dedicated inventory manager.

![SRP](https://github.com/learning-software-engineering/learning-software-engineering.github.io/assets/90370938/92398ca4-dc69-40d5-bd42-34488c2aab05)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I think it would help to add arrows to illustrate the depdencies between classes like you did for the Depdency Inversion Principle.


#### OCP
Suppose a restaurant offers a fixed menu, and every addition or modification requires altering the entire menu preparation process. Adhering to OCP, the menu system can be designed with a base menu class that remains closed for modification. New dishes or changes are introduced via an extension, such as a SpecialsMenu class, allowing additions without altering the existing menu. This principle enables the restaurant to introduce seasonal or daily specials without affecting the core menu.

![OCP](https://github.com/learning-software-engineering/learning-software-engineering.github.io/assets/90370938/1d292bf8-d992-427d-894d-b39c87cd1a45)

#### LSP
Imagine a scenario where the restaurant's system expects all orders to be instances of a generic Order class. Adhering to LSP, any specialized order, like a delivery order, dine-in order, or takeaway order, should be substitutable for a standard order without breaking the system's functionality. Each specific order type should adhere to the expected behavior of the generic Order class, ensuring seamless substitution.

![LSP](https://github.com/learning-software-engineering/learning-software-engineering.github.io/assets/90370938/21fe22c7-46ee-4def-88c5-431dbaa4fca2)

#### ISP
Consider a system where all employees (servers, chefs, and cleaners) are expected to use the same comprehensive Employee interface, including methods for serving tables, cooking dishes, and cleaning. Adhering to ISP, distinct interfaces are established for each role: ServerInterface, ChefInterface, and CleanerInterface. This segregation ensures that each role implements only the methods relevant to their responsibilities, preventing unnecessary method implementations.


![ISP](https://github.com/learning-software-engineering/learning-software-engineering.github.io/assets/90370938/0e37a7b3-c6fc-4ca8-9235-e851dafe49ec)

#### DIP
Suppose the restaurant's ordering system directly depends on specific external services for payment processing and inventory updates. Adhering to DIP, the system can depend on abstract interfaces like PaymentProcessor and InventoryService, allowing flexibility to switch between different payment processors or inventory management systems without directly impacting the core ordering system. This abstraction and dependency on interfaces rather than concrete implementations facilitate adaptability and system maintenance.

![DIP](https://github.com/learning-software-engineering/learning-software-engineering.github.io/assets/90370938/6a138359-c954-467e-aea8-b82deded8fdf)


## Resource that gives example of actual code of SOLID principles

Expand Down Expand Up @@ -203,4 +214,4 @@ This is only a simplification of what "Clean Architecture" is; the topic is so v

## Ubuntu Server Edition 20.04

### [Guide for setting up a home server with Ubuntu Server Edition](./Development_Process/Ubuntu_server_edition/ubuntu.md)
### [Guide for setting up a home server with Ubuntu Server Edition](./Development_Process/Ubuntu_server_edition/ubuntu.md)