C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
Published byModified over 6 years ago
Presentation on theme: "C++ Training Datascope Lawrence D’Antonio Lecture 11 UML."— Presentation transcript:
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML
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.
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.
UML Building Blocks There are three kinds of building blocks in UML. Things Relationships Diagrams
UML Things Structural things Behavioral things Grouping things Annotational things
UML Structures Structures. Different types of UML structures are: Classes. A class has attributes, operations, and relationships.
UML Structures 3 Collaboration Diagram. Defines an interaction and a collection of roles and other elements that work together to provide some cooperative behavior.
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.
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.
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.
Example 3 System objects: Course Administrator Course Topic Tutor User
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.
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.
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.
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.
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.
Courseware example Who are the actors in the courseware management system? Course Administrator Tutor Student
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
UML Structures 5 Active Class. These is a class whose objects own one or more processes or threads and therefore can initiate control activity.
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.
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.
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.
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).
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.
UML Behaviors UML behaviors are the verbs of a model. There are three primary types of behaviors in UML: interactions, state machines, and actions.
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.
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).
UML Behaviors 6 In a state machine the focus is on the life cycle of a single object.
UML Behaviors 7 State machine for enrolling a seminar.
UML Behaviors 9 In a UML activity the focus is on the sequence of actions taken. Each action is rendered as a rounded rectangle.
UML Behaviors 10 Activity diagram. Workflow for an order processing system.
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.
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.