Software Architecture Design Patterns Flashcards

(46 cards)

1
Q

Delegation

A

Let an object hand off work to a helper object; useful for sharing behavior without inheritance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Interface

A

Define a contract of operations without implementation; implemented by concrete classes to ensure consistency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Abstract Superclass

A

Factor out shared code into a base class with abstract methods for subclass-specific behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Interface and Abstract Class

A

Define an API via an interface and share default code via an abstract class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Immutable

A

Create objects whose state cannot change after construction; ensures thread-safety.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Marker Interface

A

Empty interface used to tag classes with metadata for special handling (e.g., Serializable).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Proxy

A

Provide a surrogate for another object to control access, add behavior, or lazy-load the real subject.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Factory Method

A

Define an interface for creating an object, but let subclasses decide which concrete class to instantiate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Abstract Factory

A

Provide an interface for creating families of related objects without specifying their concrete classes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Builder

A

Separate construction of a complex object from its representation, allowing step-by-step creation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Prototype

A

Clone existing objects instead of creating from scratch; useful for performance-sensitive creation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Singleton

A

Ensure a class has only one instance and provide a global point of access to it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Object Pool

A

Reuse a set of initialized objects instead of creating/destroying them repeatedly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Filter

A

Process a stream of data through a chain of filters, each performing part of the work.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Composite

A

Compose objects into tree structures to represent part-whole hierarchies; treat leaves and composites uniformly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Read-Only Interface

A

Expose only read operations to certain clients by providing an interface without mutators.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Adapter

A

Convert the interface of a class into another interface clients expect by wrapping it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Iterator

A

Provide sequential access to the elements of an aggregate without exposing its representation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Bridge

A

Decouple an abstraction from its implementation so both can vary independently.

20
Q

Façade

A

Provide a simplified interface to a complex subsystem.

21
Q

Flyweight

A

Share fine-grained objects to minimize memory use by externalizing shared state.

22
Q

Dynamic Linkage

A

Load modules or classes at runtime, enabling pluggable architectures.

23
Q

Virtual Proxy

A

Act as a placeholder for an object that is expensive to create, instantiating it on demand.

24
Q

Decorator

A

Attach additional responsibilities to an object dynamically by wrapping it.

25
Cache Management
Store results of expensive operations for quick retrieval to avoid repeated work.
26
Chain of Responsibility
Pass a request along a chain of handlers until one handles it.
27
Command
Encapsulate a request as an object, allowing parameterization, queuing, and undo.
28
Mediator
Define an object that encapsulates how a set of objects interact, promoting loose coupling.
29
Snapshot
Capture and externalize an object’s internal state without violating encapsulation.
30
Observer
Define a one-to-many dependency so observers are notified when a subject’s state changes.
31
State
Allow an object to alter its behavior when its internal state changes via state objects.
32
Null Object
Provide an object with default do-nothing behavior to avoid null checks.
33
Strategy
Define a family of algorithms, encapsulate each one, and make them interchangeable.
34
Template Method
Define the skeleton of an algorithm in a method, deferring some steps to subclasses.
35
Visitor
Represent an operation to be performed on elements of an object structure without changing their classes.
36
Asynchronous Processing
Decouple request submission from execution using threads or queues for nonblocking operations.
37
Single Threaded Execution
Serialize all access to a resource by funneling requests through a single thread.
38
Guarded Suspension
Make a thread wait until a precondition is met before proceeding.
39
Producer-Consumer
Coordinate producers and consumers via a shared buffer to decouple production from consumption.
40
Lock Object
Use locks (mutexes) to enforce mutual exclusion around critical sections.
41
Balking
Immediately reject an operation if an object isn’t ready, rather than blocking.
42
Scheduler
Control when and which tasks or threads execute according to defined policies.
43
Read/Write Lock
Allow multiple readers or one writer at a time to improve concurrency.
44
Two-Phase Termination
Gracefully shut down threads by signaling then waiting for termination.
45
Double Buffering
Use two buffers so one is read while the other is written, then swap for smooth flow.
46
Future (Promise)
Represent a placeholder for a result that’s initially unknown, to be provided later.