Let's forget for now about the "big" architecture and concentrate on the "small" one - single components/packages. Some advices and concepts (as DRY or GRASP) can be found here and there - for example in excellent book "Effective Java" by Josh Bloch. Additionally, tons of useful yet short articles are published by recognized authors as Martin Fowler or Robert "Uncle Bob" Martin.
The latter one created short, concise list of Object Oriented Design principles under the clever name - SOLID. In short, those are as follows:
- S(RP) - Single responsibility principle - "an object should have only a single reason to change".
- O(CP) - Open/closed principle - “ability to extend class behaviour without modifying it”.
- L(SP) - Liskov substitution principle - "subtypes must be substitutable for their base classes, without modifying program's correctness".
- I(SP) - Interface segregation principle - "create fine grained interfaces for specific purposes".
- D(IP) - Dependency inversion principle - "depend on abstractions, not on concretions"
Looking from experience's point of view, after some years of code crunching SOLID principles come intuitively. SRP, OCP are basic concepts understood quite early. DIP is adopted swiftly after meeting DI containers. LSP looks a bit more complex, but is in fact substantial when dealing with complex models with inheritance.
All in all, it's good to keep SOLID as a reference. Reviews can only benefit from using such simple yet useful checklist :-)
Brak komentarzy:
Prześlij komentarz