Coursera-Object-Oriented-Design Flashcards

1
Q

What does UML stand for?

A

UML stands for the Unified Modelling Language.

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

What does CRC card stand for?

A

CRC card stands for class responsibility collaborator card.

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

Is a conceptual design more detailed than a technical design?

A

The technical design builds on the conceptual design and the technical will include more details than the conceptual design.

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

Name four major design principles in object-oriented programming.

A

Four of the major design principles in object-oriented programming are abstraction, encapsulation, decomposition, and generalization.

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

What does abstraction do?

A

Abstraction hides away low level details and results in a simplified description or procedure.

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

What does encapsulation do?

A

Encapsulation will bundle attributes and behaviors in a virtual capsule and restrict what parts that can be accessed from the outside of the capsule.

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

What does decomposition do?

A

Decomposition takes a whole thing and breaks it down into different smaller parts.

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

What does generalization do?

A

Generalization identifies parts that are shared between two or more objects and breaks out these part to reduce redundancy.

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

What are the three types of relationships in decomposition?

A

The three types of relationships in decomposition are, association, aggregation, and composition.

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

What is association in object-oriented programming.

A

Association is a weak relationship between objects. The objects will have a “using” relationship, but will otherwise have their own life time, and there is no owner object.

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

What is the symbol used for association in UML?

A

The symbol for association comes in two variants in UML. If a class is aware of the other class but not the other way around so is the symbol an open arrow from the class that is aware. If both classes are aware of each other so can the arrow head be omitted and the simply becomes a simple line, this last version is also sometimes symbolized by an double sided open arrow.

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

What is aggregation in object-oriented programming?

A

Aggregation is a relationship between objects where a whole has parts that belongs to it, it’s a “has-a” relationship. Aggregation is a weak relationship in the sense that the parts can exist without being part of the whole, and vice versa.

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

What is the symbol used for aggregation in UML?

A

The UML symbol for aggregation is an arrow with an unfilled diamond shaped head. The arrow points towards the whole, so for example if we have a Car and a Wheel class so would there be an arrow pointing from the Wheel to the Car class.

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

What is composition in object-oriented programming?

A

Composition is a relationship between objects where a whole has parts that belong to it, it’s a “has-a” relationship. Composition is a strong and exclusive relationship between objects, the whole cannot exist without the parts, and vice versa.

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

What is the symbol used for composition in UML?

A

The UML symbol for composition is an arrow with a filled diamond shaped head. The arrow points towards the whole, so for example if we have a House and a Room class so would there be an arrow pointing from the Room to the House class.

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

What is inheritance in object oriented programming?

A

Inheritance is a mechanism in which one class acquires the property of another class. For example, a child inherits the traits of his/her parents. With inheritance, we can reuse the fields and methods of the existing class.

17
Q

What is the symbol used for inheritance in UML?

A

The UML symbol for inheritance is an arrow with with a unfilled triangle shaped head. The arrow points from the child class towards the parent class. The convention is that the parent class shall be placed above the child class and the arrow will hence point upwards.