Single Level of Abstraction Principle
Each code line in the method should have the same level of abstraction. We should not mix high-level with low-level details in one method.
Advantages
- More readability.
- Easier to understand
Disadvantages
- More classes and method.
All posts from mini project: Learn SOLID and OOP principles:
- SOLID
- SOLID exercises
- S like Single responsibility principle
- SOLID exercises — Kata
- O as Open-closed principle
- L jak Liskov Substitution Principle
- Interface segregation principle
- KISS — Keep it simple, stupid
- DRY — Don’t repeat yourself
- Dependency inversion principle
- SLAP — Single Level of Abstraction Principle
- Composition Over Inheritance
- Encapsulate what changes
- Lod — Law of Demeter
- ES as Exercises of Single responsibility principle
- EO as Exercises of Open/closed principle
- EL as Exercises of Liskov Substitution Principle
- EI as Eexrcises of Interface segregation principle
- ES as Exercises of Dependency Inversion Principle
- Object-oriented programming
- OOP — Object-Oriented Programming — Advice
- OOP — Object Oriented Programming
Sources
Main image
Materials
- https://devcave.pl/notatnik-juniora/zasady-projektowania-kodu#slap—single-level-of-abstraction-principle
- https://it.esky.pl/programowanie/pojedynczy-i-wlasciwy-poziom-abstrakcji/
- https://www.slideshare.net/skarpushin/solid-ood-dry
- https://medium.com/@yukas/single-level-of-abstraction-1e2bb6a645d7
- http://principles-wiki.net/principles:single_level_of_abstraction
Sorry, there was a YouTube error.