Objects Flashcards

(45 cards)

1
Q

What does an object represent?

A

Different individuals in the system, such as, but not exclusively people. Animals, plants and inanimate objects like cars can also be described as objects.

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

What is the relationship between objects called?

A

A link. In UML, a normal line is used to show that two objects are linked.

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

What are the characteristics of an object?

A

The characteristics of an object include structural characteristics (attributes) and its behavior (its operations).

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

Can two objects have two different sets of operations?

A

No, operations are identical for all objects of a class and are therefore usually described exclusively for the class.

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

Can two objects have the same set of attributes?

A

No, objects have different attributes from one another, but share the same behavior (operations). If two people share the same name and date of birth, they would have to be represented as two objects, such as maxMiller1 and maxMiller2.

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

What does multiplicity indicate?

A

The multiplicity of an attribute indicates how many values an attribute can contain. For example, how many students (objects) can attend a lecture.

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

What does this multiplicity notation mean? [1..*]

A

The minimum limit is 1, there is no upper limit

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

What does {ordered} mean in a class context?

A

A fixed order of attribute values, for example, an address should follow the order: street, street number, zip code, city, country.

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

What does {unique} and {non-unique} mean in a class context?

A

Specifies whether duplicates of attributes are allowed or not. An address, for example, should only be entered once and is therefore unique.

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

Define how operations are characterized

A

Operations are characterized by their name, their parameters and the type of their return value.

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

What does a parameter with an inward direction indicate?

A

If a parameter has the direction in, this indicates that when the operation is used, a value is expected from this parameter.

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

What does a parameter with an outward direction indicate?

A

The specification of the direction out expresses that after the execution of the operation, the parameter has adopted a new value. If an operation should have multiple return values rather than just one, you can express this using multiple parameters with the direction out.

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

What does a parameter with an inout direction indicate?

A

This indicates a combined input/output parameter. If no direction is specified, in is the default value.

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

What is used to realize the important concept of information hiding?

A

Visibilities such as public, private and protected are used to realize information hiding.

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

Why is setting the correct visibility for an attribute important?

A

Setting the correct visibility ensures that unauthorized access of the attribute is not possible.

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

What does “public visibility” mean? Illustrated via +

A

Access by objects of any classes is permitted

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

What does “private visibility” mean? Illustrated via -

A

Access only within the object itself is permitted

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

What does “protected visibility” mean? Illustrated via #

A

Access by objects of the same class and its subclasses is permitted

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

What does “package visibility” mean? Illustrated via ~

A

Access by objects whose classes are in the same package is permitted

20
Q

What is a class variable?

A

As opposed to instance variables, class variables are only created once per class. They can also be referred to as static attributes or class attributes. One example of a class variable is interest on a bank account. This is set once for all the objects in that class. The current balance of the bank account is in this case an instance variable, since it state changes within objects and is different for different objects.

21
Q

What is a class operation?

A

A class operation is a static operation that can be used even if no instance of the corresponding class has been created. For a person class, getting the amount of objects in the class can be accessed via get.PCounter, which is called directly via the class and not via an instance. This would correspond to a static variable called pCounter or person counter.

22
Q

What is a binary association?

A

A binary association allows us to associate the instances of two classes with one another. For example, professor and student.

23
Q

What does the following navigability mean?

A <—–> B

A

A can access the visible attributes and operations of B and vice versa. The two objects can navigate freely between each other.

24
Q

What does the following navigability mean?

A x——> B

A

This is a non-navigable association. A can access visible attributes and operations of B, but B can not access attributes and operations of A.

25
What does a multiplicity of association specify?
Multiplicities of associations are given as an interval in the form minimum...maximum. They specify the number of objects that may be associated with exactly one object of the opposite side.
26
What is an N-ary association?
If more than two partner objects are involved in a relationship, this is modeled with an n-ary association. (a hollow diamond in the center)
27
What is an association class?
An association class is used when you want to assign attributes or operations to the relationship between one or more classes, rather than to a class itself. The association class is represented by a class and an association that is connected by a dashed line.
28
If a duplicate is required for an association class, at least one association end must be identified as...
{non-unique}. If this property is not specified explicitly, the default value {unique} is assumed.
29
What is an aggregation?
An aggregation is a special form of association that is used to express that instances of one class are parts of an instance of another class. UML differentiates between two types: shared aggregation and composition.
30
What does a shared aggregation express?
A shared aggregation expresses a weak belonging of the parts to a whole, meaning that parts also exist independently of the whole.
31
What does a composition express?
The use of a composition expresses that a specific part can only be contained in at most one composite object at one specific point in time. This results in a maximum multiplicity of 1 at the aggregating end. If the composite object is deleted, its parts are also deleted.
32
When is generalization used?
Generalization is to highlight commonalities between classes, meaning that common characteristics don't have to be defined multiple times. A professor is, for example, an instance of a research associate. An assistant is also a research associate, meaning that the assistant and professor both can be generalized as research associates and then divided into their relevant subclasses, with research associate as a superclass.
33
What is a subclass?
A subclass is an instance of a superclass. The subclass inherits all attributes and operations from the superclass.
34
Can an abstract class be instantiated?
No, an abstract class can not be instantiated, since it is abstract. Only non-abstract subclasses of the class can be instantiated.
35
What does multiple classification mean?
A class that is an instance of multiple classes, which is allowed in UML. The classes don't have to be associated in an inheritance way. A tutor, for example is both a university employee and a student. The tutor inherits from both the employee class and the student class.
36
What does overlapping generalization mean?
In an overlapping generalization set, an object may be an instance of multiple subclasses simultaneously.
37
What does disjoint generalization mean?
An object may be an instance of a maximum of one subclass.
38
What does complete and incomplete generalization mean?
In a complete generalization set, each instance of the superclass must be an instance of at least one of the subclasses. In incomplete generalization sets, this is not necessary. In complete generalizations, every possible type of subclass is defined, in incomplete generalizations, all are not defined.
39
What would a complete generalization of the class "vehicle" contain?
That all subclasses of vehicle are known and depicted in the diagram. If the subclasses are "car" and "motorcycle", no other types of vehicles could be added later.
40
What is an interface?
An interface is a contract that defines a set of operations (behaviors) that a class must implement - without providing the implementation details. A class says "here's how I work", an interface says "here's what I promise you can ask me to do".
41
What is the purpose of an interface?
Interfaces are used to specify common behavior that multiple classes can share, even if otherwise unrelated. They enable polymorphism, code that can work with "anything that implements this interface" rather than with one specific class. A "printable" interface can be used if several, unrelated classes need to be printable, without the classes having to be otherwise related, such as "Document" and "Photo".
42
What are the four primitive data types pre-defined in UML?
Boolean, integer, UnlimitedNatural and String.
43
What is an enumeration?
Enumerations are data types whose values are defined in a list. For example, the enumeration AcademicDegree can list bachelor, master, phd, i.e. all known academic degrees in a system.
44
If you see <> Date in a UML diagram, is that a user-defined data-type or a primitive data type?
Date is a user-defined data type. Primitive data types are denoted with <>.
45
What are the attributes of an enumeration called?
Literals