🏗️

Design Patterns & OOP/SOLID Principles

60 cards · 🇺🇸 English

The Gang of Four design patterns plus object-oriented and SOLID principles.

Study all 60 cards for free

Flashcards, quizzes, pixel-art games and a daily review that remembers for you.

Study this deck free

Try the first 10 cards

1 / 10
Question

Abstract Factory (Creational)

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Already have an account? Sign in

Cards

  1. 1Abstract Factory (Creational)
    Groups object factories that have a common theme. Creates families of related objects without specifying their concrete classes.
  2. 2Builder (Creational)
    Constructs complex objects by separating construction and representation. Allows step-by-step object creation.
  3. 3Factory Method (Creational)
    Creates objects without specifying the exact class to create. Defines an interface for creating objects, letting subclasses decide which class to instantiate.
  4. 4Prototype (Creational)
    Creates objects by cloning an existing object. Useful when creation is expensive.
  5. 5Singleton (Creational)
    Restricts object creation for a class to only one instance. Provides a global point of access to that instance.
  6. 6Adapter (Structural)
    Allows classes with incompatible interfaces to work together by wrapping its own interface around that of an already existing class.
  7. 7Bridge (Structural)
    Decouples an abstraction from its implementation so that the two can vary independently. Separates interface from implementation.
  8. 8Composite (Structural)
    Composes zero-or-more similar objects so that they can be manipulated as one object. Creates tree structures of objects.
  9. 9Decorator (Structural)
    Dynamically adds/overrides behavior in an existing method of an object. Wraps objects to add responsibilities.
  10. 10Facade (Structural)
    Provides a simplified interface to a large body of code. Hides complexity by providing a unified interface to a subsystem.
  11. 11Flyweight (Structural)
    Reduces the cost of creating and manipulating a large number of similar objects. Shares common state among multiple objects.
  12. 12Proxy (Structural)
    Provides a placeholder for another object to control access, reduce cost, and reduce complexity. Acts as a surrogate or representative.
  13. 13Chain of Responsibility (Behavioral)
    Delegates commands to a chain of processing objects. Passes requests along a chain until one handles it.
  14. 14Command (Behavioral)
    Creates objects that encapsulate actions and parameters. Turns requests into objects that can be queued, logged, or undone.
  15. 15Interpreter (Behavioral)
    Implements a specialized language. Defines a grammar and an interpreter for sentences in the language.
  16. 16Iterator (Behavioral)
    Accesses the elements of an object sequentially without exposing its underlying representation. Provides sequential access to aggregate objects.
  17. 17Mediator (Behavioral)
    Allows loose coupling between classes by being the only class that has detailed knowledge of their methods. Centralizes complex communications.
  18. 18Memento (Behavioral)
    Provides the ability to restore an object to its previous state (undo). Captures and externalizes object state without violating encapsulation.
  19. 19Observer (Behavioral)
    A publish/subscribe pattern, which allows a number of observer objects to see an event. Notifies dependents when subject changes state.
  20. 20State (Behavioral)
    Allows an object to alter its behavior when its internal state changes. The object appears to change its class.
  21. 21Strategy (Behavioral)
    Allows one of a family of algorithms to be selected on-the-fly at runtime. Defines a family of interchangeable algorithms.
  22. 22Template Method (Behavioral)
    Defines the skeleton of an algorithm as an abstract class, allowing its subclasses to provide concrete behavior. Defers steps to subclasses.
  23. 23Visitor (Behavioral)
    Separates an algorithm from an object structure by moving the hierarchy of methods into one object. Adds operations to objects without modifying them.
  24. 24Object-Oriented Programming (OOP)
    A programming paradigm based on objects - software entities that encapsulate data and functions
  25. 25First language with primary OOP features
    Simula, developed in Norway during 1961-1967, introduced classes, inheritance, and dynamic binding
  26. 26Encapsulation
    Keeping related fields and methods together, and hiding internal details from outside code
  27. 27Information hiding
    Keeping the internal details of an object hidden from outside code, exposing only public members
  28. 28Class
    A blueprint that defines data (variables) and methods (logic) that objects of that type will have
  29. 29Object
    An instance of a class created via a constructor, with its own copy of instance variables
  30. 30Inheritance
    A mechanism where a class (subclass) inherits variables and methods from another class (superclass)

And 30 more cards. Study the whole deck free

Articles about this deck

More Programming decks

See all
Study all 60 cards free