From f30ab408607283f6606bdf3ac9206690aba3439e Mon Sep 17 00:00:00 2001 From: vissutagunawan <vglim3653@gmail.com> Date: Thu, 27 Mar 2025 09:29:59 +0700 Subject: [PATCH] Added Reflection 2 on README.md --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ed7a596..c12af24 100644 --- a/README.md +++ b/README.md @@ -58,12 +58,12 @@ You can install Postman via this website: https://www.postman.com/downloads/ - [x] Commit: `Implement delete function in Subscriber repository.` - [x] Write answers of your learning module's "Reflection Publisher-1" questions in this README. - **STAGE 2: Implement services and controllers** - - [ ] Commit: `Create Notification service struct skeleton.` - - [ ] Commit: `Implement subscribe function in Notification service.` - - [ ] Commit: `Implement subscribe function in Notification controller.` - - [ ] Commit: `Implement unsubscribe function in Notification service.` - - [ ] Commit: `Implement unsubscribe function in Notification controller.` - - [ ] Write answers of your learning module's "Reflection Publisher-2" questions in this README. + - [x] Commit: `Create Notification service struct skeleton.` + - [x] Commit: `Implement subscribe function in Notification service.` + - [x] Commit: `Implement subscribe function in Notification controller.` + - [x] Commit: `Implement unsubscribe function in Notification service.` + - [x] Commit: `Implement unsubscribe function in Notification controller.` + - [x] Write answers of your learning module's "Reflection Publisher-2" questions in this README. - **STAGE 3: Implement notification mechanism** - [ ] Commit: `Implement update method in Subscriber model to send notification HTTP requests.` - [ ] Commit: `Implement notify function in Notification service to notify each Subscriber.` @@ -95,4 +95,16 @@ However, Singleton alone doesn't address thread safety concerns with concurrent #### Reflection Publisher-2 +> 1. In the Model-View Controller (MVC) compound pattern, there is no “Service” and “Repository”. Model in MVC covers both data storage and business logic. Explain based on your understanding of design principles, why we need to separate “Service” and “Repository” from a Model? + +Separating Service and Repository from the Model is essential to maintain compliance with the Single Responsibility Principle (SRP) and Separation of Concerns. In a well-designed system, the Model represents the database data structure, the Repository handles data access and modification operations, and the Service implements the business logic. This separation creates a more modular codebase that's easier to maintain and extend, as new services or repositories can be added without modifying existing code. Additionally, this approach significantly improves testability by allowing each component to be tested in isolation. Overall, this separation is necessary to ensure clean architecture that adheres to fundamental design principles. + +> 2. What happens if we only use the Model? Explain your imagination on how the interactions between each model (Program, Subscriber, Notification) affect the code complexity for each model? + +Using only the Model to handle both data storage and business logic would create a less modular and harder-to-maintain codebase. This approach would directly violate the Single Responsibility Principle by forcing the Model to take on multiple distinct responsibilities. The interactions between Program, Subscriber, and Notification models would become increasingly complex as each model would need to manage both its own data representation and the business logic for interacting with other models. This would inevitably lead to highly coupled code with increased complexity, making the system more difficult to debug, test, and extend in the future. + +> 3. Have you explored more about Postman? Tell us how this tool helps you to test your current work. You might want to also list which features in Postman you are interested in or feel like it is helpful to help your Group Project or any of your future software engineering projects. + +Postman is an invaluable tool for testing web endpoints through HTTP requests. It allows for rapid testing of web application functionality without writing additional code. Some of the most useful features include the ability to save requests and responses for future reference, simple control over request headers and body content, and effective cookie management. Postman also offers excellent API documentation capabilities, making it easier to share endpoint information with other developers. This tool has been tremendously helpful for testing our web application endpoints, and I plan to continue using it in future software engineering projects as it streamlines the API testing process significantly. + #### Reflection Publisher-3 -- GitLab