Design principles
You can use a variety of principles and design techniques while creating your project. While keeping the design basic is usually preferable, there are certain fundamental rules that apply to practically all projects. For instance, SOLID is composed of five principles, all of which – or parts of them – can be beneficial to a design.
SOLID stands for the following principles:
- Single responsibility
- Open-closed
- Liskov substitution
- Interface segregation
- Dependency inversion
Let’s discuss each principle with examples.
The single responsibility principle
The idea of one object and one job is what the single responsibility principle asserts. Try to simplify the functionality of your objects and the intricacy of their relationships. Even if breaking down a large object into smaller, simpler components isn’t always simple, give each object a single task. Single responsibility is a context-bound concept. It...