What are the SOLID principles ?
In java, a class is a building block for an application. If the class is more SOLID, the application will be more SOLID. Here we would be discussing about the best practices to be followed while writing a class. So we need below 5 principles:
Principle Name | What is the meaning of it ? |
1. Single Responsibility Principle | Single class should have single responsibility. It should be high in cohesion. |
2. Open Closed Principle | The software components should be open for extension and close for modification. |
3. Liskov’s Substitution Principle | The derived types should be able to replace the base types without breaking the application. |
4. Interface Segregation Principle | Clients should not be forced to implement the methods which they will not be using. |
5. Dependency Inversion Principle | Depend on abstraction and not on concretization. |