Object-Oriented Design Flashcards

1
Q

How to approach

A

Handle ambiguity (6 w’s but especially who and how).

Define the core objects

Analyze Relationships (which objects are members of which other objects? Do any objects inherit from any others? Are relationships many-to-many or one-to-many?)

Investigate Actions (key actions that objects will take and how they related to one another)

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

Singleton Class

A

Ensures that a class has only one instance and ensures access to the instance through the application. May be looked down on especially for unit testing.

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

Factory Method

A

Offers and interface for creating an instance of a class, with its subclasses deciding which class to instantiate. You may want to implement this with the creator class being abstract and not providing an implementation for the Factory method. Or, you could have the Creator class be a concrete class that provides an implementation for the Factory method. In this case, the Factory class would take a parameter representing which class to instantiate.

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