December 3, 2022
SOL[I]D – The interface segregation principle
We can use the previous classes design to exemplify The Interface Segregation Principle as well. To demonstrate the importance of this principle, consider the scheme below. In the diagram, we can see 3 classes (Fiat, Chevrolet and Hyundai) that implement the “Car” interface. We can see the correspondent code below: All cars must implement the 3 functions of the interface, these are: accelerate(), brake() and […]