UML Structural Models Flashcards

1
Q

When is modelling in software development relevant?

A

Throughout the entire development process.

Analysis
System design
Detailed design
Implementation
Quality Assurance
Maintenance

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

What are the three structural diagrams we have discussed in class?

A

Class diagrams, object diagrams, deployment diagrams

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

Class diagram:
How to draw class

A

Rectangle with name.
Three sections:
name, attributes, methods

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

Class diagram:

Attribute

A

In second section.

<Visibility> <name> : <type>
</type></name></Visibility>

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

Class diagram:

Method

A

In third section.

<Visibility> <name>() : <type>

<Visibility> <name>(<parameters>) : <type>

Parameter: <name> : <type>
</type></name></type></parameters></name></Visibility></type></name></Visibility>

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

Class diagram:
Visibility modifiers

A

Private -
Public +
Protected #

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

Class diagram:
Class members

A

Underlined
Same value/declaration for all objects of class
Static in Java

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

Class diagram:
Comments

A

Add little note with flap in right corner and dotted line to where the comment is for.

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

Class diagram:
Associations

A

Specifies that there is a reference between the involved entities.

Reference to another class’ objects

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

Class diagram:
Aggregation

A

Empty diamond arrow.
A special case of association.

The objects of the referenced class are “owned” (unlike plain association)
The aggregation implies a relationship where the child can exist independently of the parent.

Library is made up of one or more books. Diamond shape near parent class.

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

Class diagram:
Composition

A

Filled out diamond arrow.
A special case of association.

The objects of the referenced class are “owned” (unlike plain association)
A composition means that the referenced object is ‘part of’ the referencing object – manages the lifecycle of the referenced object.

That is, the contained class will be obliterated when the container class is destroyed. For example, a shoulder bag’s side pocket will also cease to exist once the shoulder bag is destroyed.

Again diamond at parent class.

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

Class diagram:
Abstract classes and methods

A

Writing in italics.

The UML Generalisation denotes inheritance similar to Java albeit with a different terminology.
Sub-class == specialisation
Super-class == generalisation

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

Class diagram:
Interface

A

Are marked by so called stereotypes.
In first section:
«interface»

<name>
Second:
nothing
Third:
<visibility> <name>() : <type>
</type></name></visibility></name>

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

Class diagram:
enumeration

A

Are marked by so called stereotypes.
Two sections.
«enumeration»

<name>

all the different categories
</name>

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

Protected visibility in UML vs Java

A

UML: visible only for class and subclasses
Java: Visible for class, subclass, and same package.

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

Multiple inherence UML vs java

A

java doesn’t support multiple inherence but UML does

17
Q

Class diagram:
Inheritance (or generalisation)

A

A generalisation is a taxonomic relationship between a more general classifier and a more specific classifier.

The relationship is displayed as a solid line with a hollow arrowhead that points from the child element to the parent element.

I.e. class Rectangle extends BaseShape
relationship between abstract class and subclasses of it

18
Q

Class diagram:
Association

A

Simple association is just regular arrow ->
A structural link between two peer classes.

19
Q

Class diagram:
Dependency

A

An object of one class might use an object of another class in the code of a method. If the object is not stored in any field, then this is modelled as a dependency relationship.

Exists between two classes if changes to the definition of one may cause changes to the other (but not the other way around).

The relationship is displayed as a dashed line with an open arrow.

I.e. person takes object book and return true if read.

20
Q

Class diagram:
Realisation

A

Realization is a relationship between the blueprint class and the object containing its respective implementation level details. This object is said to realize the blueprint class. In other words, you can understand this as the relationship between the interface and the implementing class.

I.e. between an interface and class that implements interface. Arrow pointing on interface.

Dashed line with filled out arrow.

21
Q

Object diagrams primary use

A

Is to make an example of instances of classes, e.g. to explain certain value constellations.

Show example of objects with their specific values.

22
Q

Object diagram, how to draw object

A

Two sections:

name: Class (underlined)
attribute = value

example:
norbert : TurtleBot (underlined)
name = “Norbert”

23
Q

Object diagram:
Object

A

Instance of class
Header is underlined
Name is optional i.e. :TurtleBot

24
Q

Object digram
Attributes

A

Have values (if relevant)

25
Q

Object digram
Methods

A

Omitted

26
Q

Object diagram
Associations

A

Have no arrow

27
Q

Deployment diagram primary use

A

UML deployment diagrams specify which parts of a distributed application run on which part of the infrastructure.

As many of today’s software systems do not run on a single computer system anymore, an essential activity of software design is to determine how the parts of a software system should be distributed.

28
Q

Deployment diagram how to draw

A

3D box
«device»
:name

One is called a node.
Nodes describe “instances” of specific pieces of hardware (web server, laptop, database server, etc.)

May have attributes (relevant properties CPU rate, RAM)
May be nested

29
Q

Deployment diagram
Artifact

A

Generally just “pieces of software” and may encompass components, objects, documents etc.

Denoted by :Name in a rectangle.

29
Q

Deployment diagram
Communication paths

A

Connect nodes
Line between nodes
May have stereotypes like «web», «cable»
May have multiplicities, i.e., A «pc» can connect to one or more «robot», a «robot» is connected by one «pc».

30
Q
A
31
Q
A