The SRP and Profile class
Learn the importance and implementation of the Single Responsibility Principle (SRP) in profile class.
We'll cover the following
Writing unit tests isn’t an exercise that occurs in a vacuum. It’s instead part of the larger, continually shifting puzzle we call design. Our system’s design impacts our ability to write tests and vice versa.
We’ll also investigate command-query separation, which uses methods that don’t end up fooling their users by both creating side effects and returning values.
We’ll apply these principles by refactoring code in the Profile
class.
Let’s take a look at our Profile
class so far:
Get hands-on with 1400+ tech skills courses.