Download presentation
Presentation is loading. Please wait.
1
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML
2
What is UML? UML is a language for visualizing. It allows the designer to express the model for a system in graphical language. UML is a language for specifying. It specifies all analysis, design and implementation decisions in constructing a system.
3
What is UML? 2 UML is a language for constructing. It should be possible to map from a model in UML into an implementation language. UML is a language for documenting. It documents artifacts such as requirements, architecture, design, source code, prototypes, and testing.
4
UML Building Blocks There are three kinds of building blocks in UML. Things Relationships Diagrams
5
UML Things Structural things Behavioral things Grouping things Annotational things
6
UML Structures Structures. Different types of UML structures are: Classes. A class has attributes, operations, and relationships.
7
Window Class
8
UML Structures 2 Interfaces. A collection of operations that specify a service of a class or component.
9
Window Interface
10
UML Structures 3 Collaboration Diagram. Defines an interaction and a collection of roles and other elements that work together to provide some cooperative behavior.
11
Collaboration Diagram ElementSymbol Object: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined. Relation/Association: A link connecting the associated objects. Qualifiers can be placed on either end of the association to depict cardinality. Messages: An arrow pointing from the commencing object to the destination object shows the interaction between the objects. The number represents the order/sequence of this interaction.
12
Course Management Example An organization that offers a variety of courses needs to create a courseware management system. Each course is made up of a set of topics. Tutors in the organization are assigned courses to teach according to the area that they specialize in and their availability.
13
Example 2 The organization publishes and maintains a calendar of the different courses and the assigned tutors every year. There is a group of course administrators in the organization who manage the courses including course content, assign courses to tutors, and define the course schedule.
14
Example 3 System objects: Course Administrator Course Topic Tutor User
15
Example 4 Manage Course Information Scenario A user who is a course administrator invokes the manage course functionality. The manage course functionality of the course administrator invokes either the course creation or course modification functionality of a course.
16
Example 5 After the course is either created or modified, the manage topic functionality of the course administrator calls the topic creation or modification functionality of a topic. Finally, the user invokes the assign tutor to course functionality of the course administrator to assign a tutor to the selected course.
17
Example 6
18
Another example
19
UML Structures 4 Use Case. This is a description of sequences of actions that a system performs relevant to particular actors who interact with the system. The Use case diagram is used to identify the primary elements and processes that form the system. The primary elements are termed as "actors" and the processes are called "use cases." The Use case diagram shows which actors interact with each use case.
20
Elements of Use Cases Actors: An actor portrays any entity (or entities) that performs certain roles in a given system. An instance of an actor represents an individual interacting with the system in a specific way. For example, in a banking system there may be actors named Loan Officer and Customer. Actors are active participants in the system.
21
Use Case: Use Case: A use case in a use case diagram is a description of a set of sequences of actions, including variants, that a system performs to yield an observable result of value to an actor. Graphically, a use case is represented as an ellipse. For example, in an ATM ValidateUser may be one use case.
22
Courseware example Who are the actors in the courseware management system? Course Administrator Tutor Student
23
Example 2 What are the use cases for the courseware management system? View courses Manage course information Manage topics for a course View course calendar View tutors Manage tutor information Assign courses to tutors
24
Example 3
25
Another example
26
UML Structures 5 Active Class. These is a class whose objects own one or more processes or threads and therefore can initiate control activity.
27
UML Structures 6 Component. This is a modular part of the system design that hides its implementation behind a set of external interfaces. An interface that a component realizes is called a provided interface. An interface that a component uses is called a required interface.
28
Simple example
29
Example 2 In this example there are three components: Order System, Inventory System, Customer Repository. The Order System requires an interface for customer lookup. This interface is provided by the Customer Repository.
30
Courseware example We may wish to group together classes such as CourseAdministrator, Course, Topic, and Student in a Model layer. We will need to provide a consistent interface to enable other classes and components to interact with them and utilize their services.
31
Example 2
32
UML Structures 7 Node. This is a physical element that exists at run time and represents a computational resource (usually having memory and processing capability).
33
UML Structures 8 Deployment Diagram. A deployment diagram shows a set of nodes and their relationships. They illustrate the static view of an architecture. Deployment diagrams are related to component diagrams in that a node typically encloses one or more components.
34
Example
35
Example 2
36
UML Behaviors UML behaviors are the verbs of a model. There are three primary types of behaviors in UML: interactions, state machines, and actions.
37
UML Behaviors 2 Interactions. Represents messages passed among a set of objects, in order to achieve a particular purpose. In an interaction diagram the focus is on the set of objects that interact in a system.
38
UML Behaviors 3 Sequence diagram
39
UML Behaviors 4 Collaboration diagram
40
UML Behaviors 5 State machine. Represents the series of states an object goes through in its lifetime, in response to different events. A state machine consists of states (rendered as a rounded rectangle), transitions (the flow between states), events (that trigger a transition), and activities (the response to a transition).
41
UML Behaviors 6 In a state machine the focus is on the life cycle of a single object.
42
UML Behaviors 7 State machine for enrolling a seminar.
43
UML Behaviors 8 Complete seminar life cycle.
44
UML Behaviors 9 In a UML activity the focus is on the sequence of actions taken. Each action is rendered as a rounded rectangle.
45
UML Behaviors 10 Activity diagram. Workflow for an order processing system.
46
UML Groupings The primary construct in UML for grouping things is the package. A package is a general purpose mechanism for organizing the design, as opposed to classes that organize implementation constructs. Packages may include in type of UML things.
47
UML Groupings 2 A class package diagram groups classes together that are related by inheritance, composition, or collaboration. A data package diagram organizes data entities. A use case package diagram represents a high level view of a use case.
48
UML Groupings 3 Use case diagram package.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.