Object-Oriented Programming, unit: Design Patterns Basics. Core concepts, terminology, and worked-example cues a college student meets for this unit, building on prior units without repeating them. Front: a term, concept, or short problem cue. Back: the definition, explanation, or answer.
14 cards · basic cards · AI-written, checked twice. Edit anything.
- What is a design pattern?
- A general, reusable solution to a commonly occurring problem in software design
- What is the Singleton pattern?
- A pattern ensuring a class has only one instance and provides a global point of access to it
- What is the Factory pattern?
- A pattern that creates objects without specifying their exact class in the calling code
- What is the Observer pattern?
- A pattern where objects (observers) are notified automatically when a subject's state changes
- What is the Strategy pattern?
- A pattern that defines a family of interchangeable algorithms and selects one at runtime
- What is the Decorator pattern?
- A pattern that adds behavior to an object dynamically without altering its class
- What is the Adapter pattern?
- A pattern that allows incompatible interfaces to work together by wrapping one in another
- What is the Builder pattern?
- A pattern that separates complex object construction from its final representation
- What is the Model-View-Controller (MVC) pattern?
- A pattern separating an application into data (Model), display (View), and logic (Controller)
- Why are design patterns useful?
- They provide proven, well-understood solutions and a shared vocabulary among developers
- What is a creational design pattern?
- A pattern concerned with object creation mechanisms, like Singleton or Factory
- What is a structural design pattern?
- A pattern concerned with composing classes and objects into larger structures, like Adapter
- What is a behavioral design pattern?
- A pattern concerned with communication and responsibility between objects, like Observer
- What problem does the Singleton pattern risk introducing?
- Global state that can make testing and reasoning about code more difficult