Program to an Interface, Not a Class
When checkout asks for a card reader by name, every new way to pay means editing checkout; asking instead for "something that can take a payment", a promise any class can keep, lets a gift card, or anything else, plug in without checkout changing at all.
Updated

- Category
- Data Structures
- Level
- Apprentice
- Tags
- Interface, OOP, Polymorphism, Program to an Interface, software-development