-
Review the Provided Code: In non_solid.py you'll find a basic implementation of a user management system that does not follow SOLID principles:
-
Add a New Feature:
- Task: Add a feature to update a user's email.
- Steps:
- Add a method in
UserManagerto find a user by name and update their email. - Test your implementation.
- Add a method in
-
Document Your Experience:
- How difficult was it to add the new feature?
- What challenges did you encounter?
-
Review the Refactored Code: In solid.py you'll find the same user management system, refactored to follow SOLID principles:
-
Add the Same Feature:
- Task: Add a feature to update a user's email.
- Steps:
- Use the
update_user_emailmethod inUserManagerto update the user's email. - Test your implementation.
- Use the
-
Document Your Experience:
- How easy was it to add the new feature compared to the first part?
- What differences did you notice in terms of effort and code maintainability?
-
Compare Both Experiences:
- Time taken to implement the feature in both codebases.
- Ease of understanding and modifying the code.
- Potential for introducing bugs or errors.
-
Reflect on the Importance of SOLID Principles:
- Discuss how adherence to SOLID principles impacted your experience.
- Provide examples of how these principles made the code more maintainable and extensible.
By completing this task, you will gain firsthand experience of the benefits of adhering to SOLID principles in software development.