Lecture 2 Flashcards

1
Q

What is UML.

A

Unified Modelling Language.
Provides standard visual notation for designing a software system.
Two kinds of diagrams.
* Structural.
* Behavioral.

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

Structural Diagrams. UML.

A

Component, object, class, and deployment diagrams.

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

Behavioral Diagrams. UML.

A

Use Case, State, Sequence, and Interaction Diagrams.

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

UML Use Case Diagrams.

A

The primary form of a system/software requirements. Specify the expected behavior (what, not how). One specified, can be denoted by textual and visual representation. Helps us design a system from the end user’s perspective.

REVIEW GRAPHICS.

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

UML. Actors.

A

Something or someone that interacts with a use case (system function).
Similar to concept of a user in many cases.
Primary actors: Triggers a use case.
Supporting actors: Indirectly involved.

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

How to identify actors?

A

Who uses…
Who installs…
Who starts…
Who maintains…
Who shuts down…
What other systems use…
Who gets information from…
Who provides information to…
…the system.
Does anything happen automatically at a certain time?

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

Use case.

A

Represents a system function.
Names by verb+noun.
Each actor needs to be connected to a use case, but some use cases may not be linked to every actor.

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

Ways to identify use cases.

A

What functions does the actor want from the system?
Does the system store information? What actors manage this information?
Does the system need to notify actors about anything?
Are there any external events the system needs to know about? What actors inform the system of this?

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

Use case relationships.

A

Extends: The base case may conditionally execute the associated use case.
Include: The base case always executes the associated case.
Generalization: A child use case inherits the behavior and meaning of the parent.

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

What is a UML Class Diagram?

A

Provides an overview of the classes that make up a software system.
Shows the different attributes and methods for each class.
Shows the relationships between different classes.
Akin to a blueprint of a mechanical machine. Does not show the actual step-by-step functionality of the system.

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

Class diagrams importance.

A

Allows developers to model the entire system before implementation.
It is easy to change a model. It is harder to change the implementation.
Not as much technical knowledge needed.

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

Data types in UML.

A

Boolean.
Integer.
String.
Real.
Custom Classes.

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

UML visibility.

A

Protected (visible to other classes in same package, and subclasses in other packages).

”+” Public (visible to all classes in system).
“-“ Private (only visible within itself).
“#” Protected (visible to other classes within the same package and subclasses in other packages).

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

Best practices for visibility.

A

Generally, choose the most restrictive visibility to achieve the goals of the design.
Almost never use public attributes.
Methods that define an interface (executed by other objects) should be public.
Methods that do something internal to the class (like a calculation) should be private.

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

Parameter direction.

A

in: states that a parameter is passed to a method by the caller.
out: states that a parameter is not set by the caller, but modified by the method.
inout: states that a parameter is passed to a method by the caller and possibly modified.

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

Relationships between classes (arrows).

A

B inherits from A: Solid arrow to A. Hollow triangle head.
B implements A: Dashed line to A. Hollow triangle head.
A and B call each other: Solid line between them. No direction.
B can call A’s attributes, but not vice versa: Solid line to A. Corner as head.
Reflexive association (class may have many function or responsibilities). Box overlaying another box.
Aggregation (A contains B, B can survive if A is deleted). Solid arrow to A. Hollow diamond head.
Composition (A contains B, B cannot exist without A). Solid arrow to A. Solid diamond head.
Multiplicities (how many objects of one class relate to another). Numbers (and other stuff) by each box.

Make this more cards.
Review diagrams.

18
Q
A