Grokking SOLID Design Principles
Vote
0% completed
Refactoring One Class Through All Five Principles
You have met the five principles one at a time. In real code they arrive together, and usually in a fixed order, because each one uncovers the next.
This lesson takes a single class and refactors it five times. The class is an order checkout: it validates an order, works out the price, stores it, and tells the customer. It is the kind of class that grows quietly for two years.
Run it first. It works, and every principle in this course has something to say about it.
Step 1: Single Responsibility
Ask who can demand a change to process.
| Part of the method | Who asks for a change |
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%