Relations Between Objects Flashcards

1
Q

Association is

A

a type of relationship in which one object uses or interacts with another. In UML diagrams the association relationship is shown by a simple arrow drawn from an object and
pointing to the object it uses.

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

having a bi-directional association is a

A

completely normal thing. In this case,
the arrow has a point at each end.

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

In general, you use an association to represent

A

something like
a field in a class.

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

Dependency is

A

a weaker variant of association that usually
implies that there’s no permanent link between objects.
Dependency typically (but not always) implies that an object
accepts another object as a method parameter, instantiates, or
uses another object.

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

how you can spot a dependency
between classes

A

a dependency exists between two classes if
changes to the definition of one class result in modifications
in another class.

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

Composition is

A

a “whole-part” relationship between two
objects, one of which is composed of one or more instances of
the other. The distinction between this relation and others is
that the component can only exist as a part of the container.
In UML the composition relationship is shown by a line with
a filled diamond at the container end and an arrow at the end
pointing toward the component.

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

Aggregation

A

is a less strict variant of composition, where one
object merely contains a reference to another. The contain-
er doesn’t control the life cycle of the component. The com-
ponent can exist without the container and can be linked to
several containers at the same time. In UML the aggregation
relationshipisdrawnthesameasforcomposition,butwithan
empty diamond at the arrow’s base.

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