As professional programmers we should follow several design principles when we are engaging with creation of new classes. We can use design principles to use the full power of object oriented programming to gain flexibility, extensibility and scalability of the software. These were the “first five principles” of object oriented design presented by Robert C. Martin. These design principles are usually called as SOLID principles. This is an acronym introduced by Michael Feathers which is built with the first letters of each principle. There are five design principles.
- S: Single Responsibility Principle(SRP)
- O: Open-Closed Principle(OCP)
- L: Liskov Substitution Principle(LSP)
- I: Interface Segregation Principle(ISP)
- D: Dependency Inversion Principle(DIP)
Following these principles of class design helps the programmer to use the object oriented features in an efficient way. We can achieve a better class design with reusability, flexibility, scalability and maintainability from these SOLID principles together. These principles are also part of an overall strategy of agile and adaptive software development. Each design principle has to evaluate individually in future posts. Stay tuned with us.