1. Home
  2. Explore
  3. Computer Science
  4. Design Patterns Review

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Design Patterns Review

  • 77Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Pattern Foundations
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

Who initiated the design-pattern movement, and in which domain did it begin?

Tap to flipClick to flipspace

Christopher Alexander initiated the pattern movement in the domain of architecture.

Or swipe the card

77 cards

  1. Who initiated the design-pattern movement, and in which domain did it begin?

    Christopher Alexander initiated the pattern movement in the domain of architecture.

  2. What book established the foundation of the pattern movement?

    Christopher Alexander's book A Pattern Language established its foundation.

  3. What essential elements must a design pattern describe?

    A pattern should describe its name, context, problem, forces, solution, consequences, and known uses.

  4. How did the pattern movement expand beyond architecture?

    It spread from architecture to software development and software architecture.

  5. What is the central definition of a design pattern?

    A design pattern is a proven solution template for a recurring problem.

  6. Why is a design pattern not a concrete implementation?

    It describes the general idea and structure of a solution, leaving implementation details to the particular system.

  7. Why must a design pattern be proven?

    Repeated successful use demonstrates that the solution works for the recurring problem and captures practical experience.

  8. What is the purpose of giving a pattern a catchy name?

    A concise name provides a shared vocabulary for discussing a recurring design problem and its solution.

  9. What is a pattern language?

    A pattern language is an organized collection of related patterns that helps people describe and construct solutions within a domain.

  10. What role do known uses play in establishing a pattern?

    Known uses show that the pattern has been applied repeatedly in real systems and that its solution is practically validated.

  11. What is the context of a design pattern?

    The context specifies the domain and circumstances in which the pattern applies.

  12. What should the problem section of a pattern explain?

    It should explain the nontrivial design problem that needs to be solved.

  13. What are forces in a design pattern?

    Forces are conflicting constraints or pressures that make the problem difficult to solve.

  14. How can limited resources act as forces in software design?

    Limited memory, CPU capacity, or energy can constrain which solutions are feasible or reasonable.

  15. What should the solution section of a pattern provide?

    It should provide a generic description of how to resolve the problem.

  16. What are the static aspects of a pattern solution?

    They describe the participating classes and objects and their structural relationships.

  17. What are the dynamic aspects of a pattern solution?

    They describe how participants collaborate at runtime, including communication, construction, and method calls.

  18. What are the consequences of a design pattern?

    Consequences are the benefits, liabilities, limitations, and trade-offs that result from applying the pattern.

  19. Why should a pattern document both benefits and drawbacks?

    Because the consequences capture the practical experience needed to judge whether the pattern is appropriate.

  20. What is a possible consequence of using a Broker pattern?

    A Broker can introduce communication overhead, additional processes or machines, and registration requirements.

  21. Why can excessive use of the Observer pattern reduce performance?

    If millions of observers must be notified synchronously after one change, the application may become very slow.

  22. What does the pattern-house metaphor represent?

    The roof represents the context; the interior contains the problem, forces, solution, and consequences; and the foundation represents known uses.

  23. What is the main purpose of wrapping patterns?

    Wrapping patterns add a layer of abstraction around another component or layer to solve a design problem.

  24. Which patterns are examples of wrapping patterns?

    Adapter, Proxy, Decorator, and Facade are wrapping patterns.

  25. What is the main purpose of creational patterns?

    Creational patterns manage or simplify the creation of objects.

  26. How does the Builder pattern create objects?

    Builder constructs an object through multiple controlled steps.

  27. What is the Prototype pattern?

    Prototype uses an existing object or template as a basis for creating objects, potentially at runtime.

  28. What does the Singleton pattern guarantee?

    Singleton guarantees that a class has only one instance and controls its creation.

  29. What is the main purpose of behavioral patterns?

    Behavioral patterns define or modify how objects behave and collaborate.

  30. What problem does the Strategy pattern address?

    Strategy encapsulates an algorithm behind an abstraction so that algorithms can be selected or exchanged, including at runtime.

  31. What does the Command pattern encapsulate?

    Command encapsulates a method, request, or action as an object.

  32. What problem does the State pattern solve?

    State changes an object's behavior when its internal state changes.

  33. Which architectural patterns were discussed?

    Examples include Layers, Broker, Master–Slave, Client–Server, Pipes-and-Filters, and Model–View–Controller.

  34. What is the Iterator pattern used for?

    Iterator provides a way to traverse elements of a collection without exposing the collection's internal representation.

  35. What is the focus of communication patterns?

    Communication patterns organize how objects send information, decouple senders from receivers, and package data into messages.

  36. What concern does Model–View–Controller address?

    MVC separates responsibilities among the model, view, and controller and defines how these roles communicate.

  37. Which concurrency patterns were covered?

    The concurrency patterns included locks, Monitor, Active Object, Future, scoped locking, and asynchronous or synchronous execution techniques.

  38. What is the purpose of resource-management patterns?

    They determine when resources are acquired and help ensure that resources are released correctly.

  39. Which techniques or patterns were associated with resource management?

    Examples include garbage collection, leasing, and scoped resources.

  40. What is the purpose of a reference-counting or smart-pointer pattern?

    It tracks how many references use an object and deletes or releases the object when no references remain.

  41. Which additional patterns were discussed outside the main categories?

    Examples include Memento, reference-counting or smart pointers, Chain of Responsibility, and Interpreter.

  42. What does the Single Responsibility Principle state?

    A class should have one responsibility and one reason to change.

  43. What does the Open–Closed Principle state?

    Software entities should be open for extension but closed for modification.

  44. How can Strategy or State support the Open–Closed Principle?

    They allow behavior to be changed or extended through supplied strategies or states while leaving the original class code unchanged.

  45. What does the Liskov Substitution Principle require?

    Objects of a derived class should be usable wherever objects of the base class are expected.

  46. What does the Interface Segregation Principle recommend?

    Clients should depend on small, focused interfaces rather than large interfaces containing unnecessary operations.

  47. What does the Dependency Inversion Principle recommend?

    High-level code should depend on abstractions, such as interfaces or abstract classes, rather than concrete implementations.

  48. What usability rule was emphasized for interfaces?

    Interfaces should be easy to use correctly and difficult to use incorrectly.

  49. What is decomposition?

    Decomposition breaks a large, difficult problem into smaller problems that can be solved step by step.

  50. What is abstraction?

    Abstraction hides unnecessary implementation details behind a simpler interface or layer.

  51. How do Adapter and Proxy illustrate abstraction?

    They provide a simpler or alternative layer around a complicated component, hiding details from the client.

  52. What is decoupling?

    Decoupling reduces direct dependencies between components so that they can change or communicate more independently.

  53. How does programming against abstractions promote decoupling?

    Components depend on interfaces or abstract classes instead of concrete classes, allowing implementations to be replaced independently.

  54. What does shifting decision times later mean in software design?

    It means delaying the choice of a concrete implementation or communication partner until configuration or runtime.

  55. What is the relationship between simplicity and over-engineering?

    Simplicity discourages adding complexity that is not currently needed and helps avoid over-engineered solutions.

  56. What is premature optimization?

    Premature optimization is optimizing before a real need or performance problem has been established.

  57. What does it mean to adhere to context-specific expectations?

    Code should follow the conventions, styles, tools, and idioms expected in the programming language or organization.

  58. How do design patterns differ from language-specific idioms?

    Design patterns express solutions independently of a programming language, whereas idioms solve small problems using features specific to one language.

  59. What are architectural patterns?

    Architectural patterns influence the structure of an entire software system or application.

  60. What are classical design patterns?

    They influence several components or classes but generally do not determine the architecture of the entire application.

  61. What are idioms?

    Idioms are small design solutions specific to a particular programming language.

  62. What was the main contribution of the Gang of Four design-pattern book?

    It collected and summarized widely used object-oriented software design patterns into a common reference.

  63. Who are the four authors known as the Gang of Four?

    They are Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides.

  64. What is the relationship between Douglas Schmidt and pattern-oriented software architecture?

    Douglas Schmidt was a major contributor and author associated with pattern-oriented software architecture works and collected and documented patterns.

  65. What does reflection provide in a software system?

    Reflection allows a program to inspect information about objects or classes at runtime, such as available methods and attributes.

  66. What is the Extension Interface pattern intended to provide?

    It provides simple and advanced interfaces to the same object, allowing clients to choose the level of complexity they need.

  67. What is the Half-Sync/Half-Async pattern intended to combine?

    It combines synchronous and asynchronous invocation and synchronizes interactions between those two modes.

  68. What are the major learning objectives of studying design patterns?

    They include understanding pattern theory, core principles such as SOLID, pattern description, pattern languages, common patterns, appropriate application, consequences, and design trade-offs.

  69. Why should design patterns generally be independent of programming languages?

    Language independence allows the underlying design solution to be reused across different programming languages.

  70. How should a developer decide whether to use a particular pattern?

    The developer should compare the problem and forces with the pattern's benefits, liabilities, limitations, and requirements.

  71. Why should patterns not be used in a trivial program?

    Applying patterns to a simple script or a 'Hello, World' program can add unnecessary complexity and constitute over-engineering.

  72. When can patterns be especially valuable in a larger project?

    They can improve flexibility, avoid common design problems, and provide reusable solutions without reinventing the wheel.

  73. Why is it important to know the difference between patterns such as Mediator and Observer?

    Understanding their different consequences helps determine which pattern is more appropriate for a specific use case.

  74. What does it mean to balance forces and consequences?

    It means selecting a solution whose benefits and trade-offs are acceptable for the system's particular requirements and constraints.

  75. How does a design pattern help developers communicate?

    A shared pattern name and basic idea let developers discuss complex design choices concisely.

  76. How should design-pattern knowledge become useful rather than merely memorized?

    It should be made explicit, organized understandably, and applied to real problems and contexts.

  77. What is the difference between a pattern's solution and its consequences?

    The solution explains how to address the problem; the consequences explain what benefits and costs result from doing so.

Card 1 of 77
Card 1 of 77

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent