Interface vs. Class
- A class can implement multiple interfaces
- the shape of a thing, without specifying identity or implementation
- class is a collection of data and methods - strict and closed
- if a
BirdcanFly()then all birds must fly, but what about penguins? - So, define interface
ICanFlyandICanSwim, and thenBirdcan focus on the specifics of the creature - injecting interfaces creates looser coupling in Dependency Injection