# 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.

![Cheat sheet: Program to an Interface, Not a Class](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/be1692d8bb784b5f94fa6e692b639439.webp)

- Category: Data Structures
- Level: Apprentice
- Tags: Interface, OOP, Polymorphism, Program to an Interface, software-development
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-program-to-an-interface-cheat-sheet
