Week 5- Modelling requirements and class stereotypes Flashcards

1
Q

What do we use to model requirements?

A

We use UML diagrams.

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

What is a class diagram

A

A class diagram is a diagram that describes the structure of the system by showing the system’s classes, attributes, methods, and relationship amongst the objects.

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

What is an association

A

Associations are solid lines drawn between classes

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

What does an unlabelled relation(just a solid line) mean by default?

A

By default, an unlabelled relation means “has a”. For example, Player has an address.
If it is unlabelled an undecorated, it also means
“one-to-one”, so its both “has-a” and “one-to-one”

Player—————-(solid line)———- Address

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

What are constraints?

A

Constraints on associations, are placed at the ends of a relationship.

They denote HOW MANY INSTANCES of the classes may be a member of the relation at run time.

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

What does one-to-one constraint mean?

Player (1) ——————– (1) Address

A

This means that A player has an address and EACH address is associated with ONE player (1-1)

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

Labelling Associations: Can associations be labelled with identifiers?

A

Yeah they can be used to provide specific interpretations of the association, instead of a default ‘has a’ or ‘has some’.

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

How would you read this (refer to lect slide if no understand..)

Player ————– (workAddress) Address
————– (homeAddress)

A

A player has a workAddress and a homeAddress

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

How would you read this

Team () ——playsFor———–(0..) Player

A

A team consists of zero or more players
and a player can play for many different teams

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

How would you read this

Manager(0..1) ——managers>—– (0,1,2)Team

A

A maanger can manage no, one or two teams and a team can have at most one manager.

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

What are reflexive associations?
Please go through lecture example as well

A

A reflexive association is whereby a class maintains an association to themselves. Objects of the same class will have references to each other

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

(a) What is “Uses/Depends on”? For example, When does Class A depend on Class B?
(b) How do we represent a dependency?

A

Class A depends on Class B if at some point it uses class B.
In code, Class A would be using a Class B method (refer lecture notes if no get)

We represent a dependency by a dotted line and open arrow indicating the dependency direction.

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

What is an aggregation?
How do we represent aggregation?

Patient(1)—<>(1)Patient Record
Consultation (1)—<> (1)Patient Record

A

In the real world, objects are made up of different parts.
UML provides a special type of association between classes to express the “IS PART OF” relationship called Aggregation

A”Patient Record” is an aggregate that contains exactly one “Patient” and one or many “Consultations”. It’s important to note that aggregation does not imply ownership. Unlike composition (a stronger form of aggregation denoted by a filled diamond), in aggregation, the lifecycle of the part is not strictly tied to the lifecycle of the whole; the “Patient” and “Consultation” can exist independently of the “Patient Record”.

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

How do indicate composition?

A

The plain/full diamond indicates that the contained objects are not shared

When the container object is destroyed, the contained objects disappear with it

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

Comparison between composition and aggregation based on word choice

(OWNS) vs (USES)

A

A text editor owns a buffer (composition)
A text editor uses a file (aggregation)

When Text Editor is closed, Buffer is destroyed but not the file

Remember to look at the code implementation as well to see the difference, in lecture slides

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

What are the 3 main types of classes in Unified Modelling Language (UML)

A
  1. Entity
  2. Boundary
  3. Control
17
Q

What do entity classes model?

A

They model long lived information

18
Q

What do boundary classes model?

A

They model the interaction between the system/product and the environment.

They act as the user interface for actors to interact with the outside system.
They act as the gateway for external systems to interact with our system.

19
Q

What do control classes model?

A

Control classes model complex algorithms and computation

20
Q

What do control classes model?

A

Control classes model complex algorithms and computation