Design Principles for Low Level Design
A framework for tackling questions such as: should this be a separate class, should I use inheritance here, is this abstraction worth it?
Dated Sep 10, 2026; last modified on Thu, 10 Sep 2026
A framework for tackling questions such as: should this be a separate class, should I use inheritance here, is this abstraction worth it?
| Random Link ¯\_(ツ)_/¯ | ||
| Sep 11, 2026 | » | Law of Demeter (Principle of Least Knowledge)
1 min; updated Sep 11, 2026
Code like Method chaining itself is not the problem. Fluent interfaces like
|
| Sep 11, 2026 | » | Separation of Concerns
1 min; updated Sep 11, 2026
Your UI layer shouldn’t contain business logic. Your business logic shouldn’t know how data is stored. Your data access layer shouldn’t format strings for display. Compare: … to: … where the game rules, display, and input handling are separate, e.g.,
switching from a console input to a GUI only touches |
| Sep 11, 2026 | » | YAGNI - You Aren't Gonna Need It
1 min; updated Sep 11, 2026
YAGNI doesn’t mean “never think ahead”; it means “don’t build ahead”. Design with extension in mind, but only implement what’s needed now. If designing a parking lot system, don’t add support for valet parking and electric vehicle charging stations unless the requirements specifically mention them. Used without continuous refactoring, YAGNI could lead to lots of disorganized code and massive rework. YAGNI is dependent on supporting practices such as continuous refactoring, continuous automated tests, and continous integration. ... |
| Sep 11, 2026 | » | DRY - Don't Repeat Yourself
2 min; updated Sep 11, 2026
If three classes all validate email addresses in the same way, create a shared validation method. That way, if email validation rules change, you update the one method. Sometimes the simplest solution is to duplicate code in two places rather than build an abstraction. The key is whether the logic is conceptually the same, not just textually similar. While working on a microservices-based chat application, I wanted to the ability
to serialize and de-serialize |
| Sep 10, 2026 | » | KISS - Keep It Simple, Stupid
1 min; updated Sep 10, 2026
Frequently, devs over-engineer to flex design pattern knowledge or anticipate extensions that never come. Distinguish between problems that need sophisticated solutions and problems that need simple ones. If a single class handles the job without getting messy, don’t split it up. If it grows to 500 lines with 10 different responsibilities, then refactor. If you can solve the problem with a simple conditional, use that. If adding a
new payment method means modifying code in five places, then introduce a
|
I don’t fully follow. Doesn’t
Order.getCustomerZipCode()have_customer.GetAddress().GetZipCode(), and therefore we’re back where we were but coupled to \(N-1\) objects?