diff --git a/README.md b/README.md index 96e778c3cbb8ecd956146819e1f3c8c4d073d7d6..de075cb1032af34d99fd8c69bedfa25e03eb8a31 100644 --- a/README.md +++ b/README.md @@ -58,12 +58,12 @@ You can install Postman via this website: https://www.postman.com/downloads/ - [v] Commit: `Implement delete function in Subscriber repository.` - [v] 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. + - [v] Commit: `Create Notification service struct skeleton.` + - [v] Commit: `Implement subscribe function in Notification service.` + - [v] Commit: `Implement subscribe function in Notification controller.` + - [v] Commit: `Implement unsubscribe function in Notification service.` + - [v] Commit: `Implement unsubscribe function in Notification controller.` + - [v] 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.` @@ -92,4 +92,22 @@ As far as i know, dashmap is designed to be thread safe, this means itcan handle #### 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? + +Imagine a kitchen, in this kitchen the model is just a recipe sheet (what ingredient we need to make something, in this case like the url and name), the repository is like the kitchen staff who knows exactly where to get the ingredients and where to store finished food (saving and loading data respectively), and service is the chefs who reads the recipe, tell the kitchen staff what to get, follow the cookings step to produce the food. With this separation of concern, we make sure no one part of the kitchen get overworked/have to many responsibility, not only does this make it more easy to read/modify/maintain, its also easier to swap out parts (for example, changing database). + +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? + +Imagine if the recipe sheet (model) also had instructions for where every ingredient is in the kitchen, and detailed steps for how to process ingredients, and how to arrange it on a plate, and notes about what other recipes use the same ingredients, it would mean each model (Product, Subscriber) would be super long and complicated because trying to do everything by themselves. If we want to change how we store Subscribers, we might have to go edit the Product model too because it somehow knows too much about subscribers. Everything gets tangled, making it a headache to change anything without breaking something else, which is something separation of concern principle is designed to prevent in the first place. + + +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 basically a tool to poke at our web server and see if it does what its programmed to do without needing a fancy webpage we can interact with, for example, we can tell it "hey server, try subscribing with this info" (i.e. sending a POST request with data), and Postman will show us what the server sends back. Postman tool is an awesome way to check if our backend code work without having to implement every part (i.e. frontend part). + +What postman do: +- keep all tests organized +- test multiple part at once +- makes group projects way easier because everyone can use the same tests. + #### Reflection Publisher-3