None of us willingly ignores common design principles to write bad software. Violating the Interface Segregation Principle Similar to the Single Responsibility Principle, the goal of the Interface Segregation Principle is to reduce the side effects and frequency of required changes by splitting the software into multiple, independent parts.Īs I will show you in the following example, this is only achievable if you define your interfaces so that they fit a specific client or task. Sounds obvious, doesn’t it? Well, as I will show you in this article, it’s pretty easy to violate this interface, especially if your software evolves and you have to add more and more features. “Clients should not be forced to depend upon interfaces that they do not use.” Martin while consulting for Xerox to help them build the software for their new printer systems. The Interface Segregation Principle was defined by Robert C. Definition of the interface segregation principle So let’s focus on the Interface Segregation Principle. I already explained the Single Responsibility Principle, the Open/Closed Principle, and the Liskov Substitution Principle in previous articles. Martin defined the following five design principles with the goal to build robust and maintainable software: You might even argue that the microservices architectural style increased their importance because you can apply these principles also to microservices. Even though these principles are several years old, they are still as important as they were when he published them for the first time. The Interface Segregation Principle is one of Robert C.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |