Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

Similar documents
Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Progress Report. Object-Oriented Software Development: Requirements elicitation and analysis. Object-oriented analysis, design, implementation

Use Case Modeling. Bernd Bruegge Carnegie Mellon University School of Computer Science. 8 September Bernd Brügge Software Engineering 1

Unified Modeling Language (UML)

Chapter 5: Structural Modeling

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

LABORATORY 1 REVISION

Object-Oriented Systems Analysis and Design Using UML

OO Techniques & UML Class Diagrams

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

UNIT-4 Behavioral Diagrams

Unified Modeling Language (UML)

Lecture 8: Use Case -Driven Design. Where UML fits in

UNIT 5 - UML STATE DIAGRAMS AND MODELING

Interaction Modelling: Use Cases

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

Object-Oriented Systems Development: Using the Unified Modeling Language

Object-Oriented Design and Modeling Using the UML

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

CS 451 Software Engineering

Basic Structural Modeling. Copyright Joey Paquet,

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Computer Science for Engineers

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

UML. By Somenath Mukhopadhyay.

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel

Database Systems. Overview - important points. Lecture 5. Some introductory information ERD diagrams Normalization Other stuff 08/03/2015

Chapter 2, lecture 2 Modeling with UML

CSSE 374: UML Activity Diagrams. Shawn Bohner Office: Moench Room F212 Phone: (812)

IS 0020 Program Design and Software Tools

Unified Modeling Language

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

UNIT-II Introduction to UML

Activity Diagram Written Date : September 02, 2016

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

UML diagrams. Software artifacts include: SRS, SDS, test cases, source code, technical/user manual, software architecture, etc.

UML Primer. -Elango Sundaram

From Analysis to Design. LTOOD/OOAD Verified Software Systems

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

Unified Modeling Language (UML) Class Diagram

user.book Page 45 Friday, April 8, :05 AM Part 2 BASIC STRUCTURAL MODELING

Visual Modeling with UML 2

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak

A Rapid Overview of UML

Class Diagrams in Analysis

More on the Chen Notation

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 09/29/2015

Introduction to Software Engineering. 5. Modeling Objects and Classes

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Software Engineering Fall 2014

+ Public - Private # Protected # Protected (Overridable) Static

Practical UML - A Hands-On Introduction for Developers

UML UNIFIED MODELLING LANGUAGE EXEMPLIFIED ON BLACKJACK. Object Oriented Programming (Samy Zafrany)

ER modeling. Lecture 4

Chapter 2, Modeling with UML, Part 2

Suggested answers are provided below. These answers are presented top-down, left to right.

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Interactions A link message

Objectives. Explain the purpose and objectives of objectoriented. Develop design class diagrams

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Design Patterns. Design Patterns

Object-Oriented Development and UML. Announcement. Agenda 7/3/2008. Class will resume on July 22. Try to complete the lab assignments by July.

Unit 6 - Software Design and Development LESSON 10 DESIGN TOOLS, INPUTS, OUTPUTS, STORYBOARDS

Object Orientated Analysis and Design. Benjamin Kenwright

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

Structured and Object Oriented Analysis and Design

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

Engineering Design w/embedded Systems

Chapter 5, Analysis: Dynamic Modeling

SEEM4570 System Design and Implementation Lecture 11 UML

COMP Instructor: Dimitris Papadias WWW page:

Introducing the UML Eng. Mohammed T. Abo Alroos

Chapter : Analysis Modeling

Today s Topic. Lecture 5. What is UML? Why Use UML. UML Diagrams. Introduction to UML. What is UML Why use UML? UML Diagrams

On to Iteration 3, and Activity Diagrams CSSE 574: Session 6, Part 1

Software Life-Cycle Models

Unified Modeling Language (UML)

7. UML Sequence Diagrams Page 1 of 1

UML: Unified Modeling Language

Progress Report. Object-Oriented Software Development: Requirements elicitation (ch. 4) and analysis (ch. 5) Object-oriented software development

Classes. Logical method to organise data and functions in a same structure. Also known as abstract data type (ADT).

Practical UML : A Hands-On Introduction for Developers

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Chapter 1: Principles of Programming and Software Engineering

Shopping Basket and Order Requirements

MTAT Software Engineering. Written Exam 17 January Start: 9:15 End: 11:45

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

ITEC420: Software Engineering Lecture 3: Recap OO/UML Requirement Workflow

Business Process Modelling

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L

Class modelling (part 2)

SEEM4570 System Design and Implementation. Lecture 10 UML

Software Engineering Lab Manual

Object-Oriented Design

Design Engineering. Dr. Marouane Kessentini Department of Computer Science

INF 111 / CSE 121. Laboratory 6: Package and Sequence Diagrams using ArgoUML

3. Advanced E/R Concepts

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

Transcription:

Modeling with UML A language or notation intended for analyzing, describing and documenting all aspects of the object-oriented software system. UML uses graphical notations to express the design of software projects. UML helps project teams communicate, explore potential designs, and validate the architectural design of the software. (1) Use Case Diagram (2) Class Diagram (3) Interaction Diagram (4) State Diagram 1

Use Case Diagrams Used during the analysis phase of a project to identify and partition system functionality. They separate the system into actors and use cases. Actors represent roles that can are played by users of the system. Those users can be humans, other computers, or even other software systems. The only criterion is that they must be external to the part of the system being partitioned into use cases. They must access to that part of the system, and they must receive outputs from it. Use cases describe the behavior of the system. This behavior is described textually. It describes the inputs from actor and outputs to other actors, and the behaviors that convert the inputs to the outputs. The use case diagram shows which actors interact with each use case. 2

Accident Management System The fieldofficer invokes the use case ReportEmergency to notify the Dispatcher of a new emergency. As a reponse, the dispatcher invokes the OpenIncident use case to create an incident report and initiate the incident handling. The dispacher enters preliminary information from the fieldofficer and orders additional unit with the AllocateResources. 3

Template to describe a use case Name of the use case Participating actors (actors interacting with the use case) Flow of events: sequence of interactions of the use case. Entry conditions: conditions that need to be satisfied before the use case is initiated. Exit conditions: conditions that need to be satisfied after the use case is initiated. ReportEmergency Use case description Use case name ReportEmergency Participating actors FieldOfficer and Dispatcher Flow of Events 1. The fieldofficer activates the report Emergency function of her computer 2. The computer response a form 3. The fieldofficer fill out the form by selecting the emergency level, type, location and submit the form. 4. Computer receives the form and notify the dispatcher. 5. The dispatcher acknowledges the report. 6. Computer displays the acknowledgment to the FieldOfficer. Entry condition The FieldOfficer is logged into her computer Exit Condition The FieldOfficer s report has received an acknowledgment 4

How to Draw Use Cases Diagrams List a sequence of steps a user might take in order to complete an action. Place an order: A user place an order with a sales company might follow these steps. 1. Browse catalog and select items. 2. Call sales representative. 3. Give shipping information. 4. Give payment information. 5. Get confirmation number from salesperson. 5

Use case diagrams: types of relationships Communication relationship: Actors and use cases communicate when information is exchanges between them. Depicted by solid line between actor and the use case. 6

Uses relationship: When describing a complex system, its use case model can become quite complex and can contain redundancy. -- Reduce the complexity of the model by identifying commonalities in different use cases. <<uses>> or <<include OpenIncident ViewMap AllocateResource <<uses>> or <<include>> 7

Extend Relationship: An alternate means for reducing complexity in the use case model. An extend association from Use Case B to Use Case A indicates that B is an extension of A. Example: The use case ReportEmergency is completed by itself, but can be extended by the use case Help for a specific scenario in which the user requires help B FieldOfficer A <<extend>> Help ReportEmergency 8

When to Use: Use Cases Diagrams Use cases are powerful tools for analysts to use when partitioning the functionality of a system. Help analysts to structure use cases such that their textual descriptions contain a minimum of redundant information. Not design tools. They do not specify the structure of the eventual software, nor do they imply the existence of any classes or objects. They are purely functional descriptions written in a formalism that is completely separate from software design. Class Diagrams Used to refine the use case diagram and define a detailed design of the system. Classifies the actors defined in the use case diagram into a set of interrelated classes. The relationship or association between the classes can be Associations Dependency Aggregation Inheritance 9

Association, Aggregation, Composition Association: all object have their own lifecycle and there is no owner. Example: Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers but there is no ownership between the objects and both have their own lifecycle. Both can create and delete independently. Aggregation: a specialize form of Association where all object have their own lifecycle but there is ownership. Example: Department and teacher. A single teacher cannot belongs to multiple departments, but if we delete the department teacher object will not destroy. We can think about has-a relationship. Composition : a specialize form of Aggregation. It is a strong type of Aggregation. Child object dose not have their lifecycle and if parent object deletes all child object will also be deleted. Example: House and rooms. 10

Associations: Relationships between instances of classes The UML representation of an association is a line with an optional arrowhead indicating the role of the object(s) in the relationship, and an optional notation at each end indicating the multiplicity of instances of that entity. 0..1 No instances, or one instance 1 Exactly one instance 0..* or * Zero or more instances 1..* One or more instances 11

12

Aggregation: depicted as an unfilled diamond and a solid line. Composition: depicted as a filled diamond and a solid line. It always implies a multiplicity of 1 or 0..1, as no more than one object at a time can have lifetime responsibility for another object. 13

Interaction Diagrams Model the behavior of use cases by describing the way groups of objects interact to complete the task. sequence collaboration A sequence diagram represents the interaction between different objects in the system. Sequence diagrams demonstrate the behavior of objects in a use case by describing the objects and the messages they pass. What Is a Message? Software objects interact and communicate with each other by sending messages to each other. 14

Sequence diagrams: The diagrams are read left to right and descending. The naming system has one of the following three formats: objectname : ClassName (full description) objectname: (class not specified) : ClassName (object not specified) 15

A sequence diagram for placing an order. If the item is in stock, create a new Delivery Item object. If the item is [OutOfStock], sends a message back to the Order Entry Window object stating that the object is out of stack. 16

Collaboration diagrams: Show the relationship between objects and the order of messages passed between them. Helps to identify all the possible interactions that each object has with other objects. The objects are listed as icons and arrows indicate the messages being passed between them. The numbers next to the messages are called sequence numbers. 17

Collaboration diagram for the placing an order use case When to Use: Interaction Diagrams When you want to model the behavior of several objects in a use case. They demonstrate how the objects collaborate for the behavior. 18

State Diagrams Each diagram usually represents objects of a single class and tracks the different states of its objects through the system. Describe all of the possible states of an object as events occur. Captures the transition of the object's state from an initial state to a final state in response to events affecting the system. How to Draw: State Diagrams Rounded boxes representing the state of the object and arrows indicting the transition to the next state. The activity section of the state symbol depicts what activities the object will be doing while it is in that state. State Name do/action Activity Transition 19

All state diagrams being with an initial state of the object. After the initial state the object begins changing states. Conditions based on the activities can determine what the next state the object transitions to. 20

A State Diagram for an Order object. When the object enters the Checking state it performs the activity "check items." After the activity is completed the object transitions to the next state based on the conditions [all items available] or [an item is not available]. 21

Activity Diagram Describe the workflow behavior of a system. Describe the state of activities by showing the sequence of activities performed. How to Draw: Activity Diagrams Have branches and forks to describe conditions and parallel activities. A fork is used when activities are occurring at the same time. The branch describes what activities based on a set of conditions. 22

Activity diagram for processing an order 23

Draw the UML class diagram showing the following data types and the relationships between those types. In the diagram, include the variable and method declarations for each data type and also indicate their visibility (public, private or protected) in UML notation. Please note that the bodies of the methods have been replaced by ellipsis ( ) to eliminate details that are not necessary in your diagram. public interface Buyable{ public double getprice(); } public abstract class Vehicle implements Buyable { protected int id; } public Vehicle(int i) { } public int getid() { } public abstract double getprice(); public class Car extends Vehicle { private double price; public Car(int i) { } public Car(int i, double p) { } public double getprice() { } } 24

<<interface>> Buyable +getprice():double Vehicle #id: int +Vehicle(i:int) +getid():int +getprice():double Car -price: double +Car(i:int) +Car(i:int, p:double) +getprice():double 25

A mail-order company wants to automate its order processing. The order processing system should be accessible to customers via the Web. Customers can also call the company by phone and interact with the system via a customer representative. The system allows customers to place orders, check the status of their orders, cancel an existing order and request a catalog. Customers may also return a product but this is only possible through the phone, not available on the Web. When placing an order, the customer can check the availability of the product from the inventory system. When the customer plays the order, credit card number, billing address and a specification of the cost of the order are used on the invoice. When the customer cancel order or return order, he/she will be billed. Draw a UML use case diagram for the order processing system described above. 26

Design a simulation of a basketball conference. Each conference has 10 teams. Each team has 12 players. Each player has a specific height, speed, and accuracy. Players know which team they belong to. Some players are scholarship players. Scholarship players need to record their current grade-point average. Players may be transferred between teams. Teams play basketball games against other teams in the conference. The result of each game is determined using a function based on the height, strength, speed, and accuracy of the players on each team. Name the classes and draw a UML class diagram showing classes (including variables, methods and relationships between classes with appropriate multiplicities.) 27