Object-Oriented Design Principles Flashcards

1
Q

In which pattern does a centralized class a method instantiate and return a class instance, commonly referencing either a specific subclass or shared interface?

A

Factory Design Pattern

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

In a composition relationship, which phrase describes how interface modifications to a container class affects the interface of its contained class?

A

loosely coupled

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

In the Factory design pattern, which type of coupling exists between the factory and product classes?

A

Loose coupling

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

In which object-oriented mechanism do subclasses provide unique implementation to methods in a superclass?

A

class inheritance

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

Which UML relationship is a type of class association that uses strong aggregation to represent a “whole-part” relationship?

A

Composition

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

In which two relationships can implementation found in multiple classes be aggregated?

A

Composition and generalization

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

Which types can implement the Singleton pattern?

A

Concrete classes and enumerations

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

Which three components are contained by classes that implement the Singleton design pattern?

A

A private constructor, a static member referencing the instance, and a public static accessor method returning that reference

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

Which interface member can be hidden in a class or subinterface?

A

Constants

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

Which UML relationship is a type of class association that uses weak aggregation to represent a “whole-part” relationship?

A

Aggregation

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

In class inheritance, which phrase describes how interface modification to a superclass affects the interface of its subclasses?

A

tightly coupled

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

In a composition relationship between classes, which phrase describes how an instance forwards method invocations to another class instance?

A

request-forwarding

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

In which pattern is a data-related class is concerned only with storage and read/write access to its instance members?

A

Transfer Object

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

Which design pattern is implemented by a class that restricts instantiation to only a single instance?

A

Singleton

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

What is another term for the Factory Method design pattern?

A

Virtual Constructor

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

Which UML relationship is a type of class association where objects are relevant outside of the container class?

A

Aggregation

17
Q

Which UML relationship is a type of “is a” relationship, where subclasses inherit their interface and implementation from a common superclass?

A

Generalization

18
Q

In class inheritance, which term describes the unique implementation of a superclass method in a subclass?

A

polymorphism

19
Q

What is another term for request-forwarding in a composition relationship?

A

method delegation