Software Patterns, Creational Flashcards

(9 cards)

1
Q

Abstract factory

A

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

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

Builder

A

Separate the construction of a complex object from its representation allowing the same construction process to create various representations.
And hep against tunneling constructors with 5 parameters.

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

Factory method

A

Define an interface for creating a single object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses

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

Lazy initialization

A

Tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed. This pattern appears in the GoF catalog as “virtual proxy”, an implementation strategy for the Proxy pattern.

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

-Multiton

A

Ensure a class has only named instances, and provide global point of access to them.

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

-Object pool

A

Avoid expensive acquisition and release of resources by recycling objects that are no longer in use. Can be considered a generalisation of connection pool and thread pool patterns.

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

Prototype

A

Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.

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

-Resource acquisition is initialization

A

Ensure that resources are properly released by tying them to the lifespan of suitable objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
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