Object Oriented Design Patterns Flashcards

1
Q

What are the characteristics of good design?

A

Maintainable, reusable, understandable, and consistent.

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

What is a design pattern?

A

A template with two parts: a design problem and a general solution.

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

How does an architectural style differ from a design pattern?

A

An architectural style provides a template for the whole application (high level), while a design pattern provides structure to a subsystem (low level).

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

What are the benefits of design patterns?

A

They collect expertise, improve productivity, are language-independent, enhance quality, and make designs more readable.

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

What are the three main categories of design patterns?

A

Structural, behavioural, and creational.

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

What do structural patterns do?

A

Compose objects to form more complex structures.

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

What do behavioural patterns focus on?

A

Dynamic communication between objects.

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

Name the 8 structural patterns.

A

Adapter, composite, aggregate, bridge, decorator, facade, flyweight, and proxy.

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

Name the 11 behavioural patterns.

A

Chain of responsibility, command, interpreter, template method, iterator, mediator, memento, observer, strategy, state, and visitor.

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

Name the 5 creational patterns.

A

Factory, abstract factory, builder, prototype, and singleton.

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

What is the singleton pattern?

A

A pattern that ensures a class has only one instance (e.g., the President of a country)

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

What are the two main parts of a design pattern description?

A

Problem and solution.

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

What does the problem part of a design pattern consist of?

A

Name, the problem it solves, environment, and motivation.

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

What does the solution part of a design pattern consist of?

A

Applicability, class diagram, classes involved, class interactions, implementation guidelines, examples, pros and cons, industrial applications, and related patterns.

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

Where can you find patterns for specific domains?

A

In web frameworks that come with their own libraries of design patterns.

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

What is the goal of the facade pattern?

A

To facilitate the usability of a large and complex software system.

17
Q

What design problem does the facade pattern solve?

A

How to provide a simplified, high-level interface to a complex system.