Lecture 2 Flashcards
What is UML.
Unified Modelling Language.
Provides standard visual notation for designing a software system.
Two kinds of diagrams.
* Structural.
* Behavioral.
Structural Diagrams. UML.
Component, object, class, and deployment diagrams.
Behavioral Diagrams. UML.
Use Case, State, Sequence, and Interaction Diagrams.
UML Use Case Diagrams.
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.
UML. Actors.
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 to identify actors?
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?
Use case.
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.
Ways to identify use cases.
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?
Use case relationships.
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.
What is a UML Class Diagram?
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.
Class diagrams importance.
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.
Data types in UML.
Boolean.
Integer.
String.
Real.
Custom Classes.
UML visibility.
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).
Best practices for visibility.
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.
Parameter direction.
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.