SEEM4570 System Design and Implementation Lecture 11 UML

Similar documents
SEEM4570 System Design and Implementation. Lecture 10 UML

Practical UML - A Hands-On Introduction for Developers

Notation Part 1. Object Orientated Analysis and Design. Benjamin Kenwright

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

Practical UML : A Hands-On Introduction for Developers

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

Software Service Engineering

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

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

Unified Modeling Language (UML)

COSC 3351 Software Design. An Introduction to UML (I)

SEEM4570 System Design and Implementation. Lecture 11 From Design to Implementation

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

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

Software Life-Cycle Models

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

Question Sheet There are a number of criticisms to UML. List a number of these criticisms.

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

UML Tutorial. Unified Modeling Language UML Tutorial

UNIT-4 Behavioral Diagrams

Object-Oriented and Classical Software Engineering

UML. By Somenath Mukhopadhyay.

Unified Modeling Language I.

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

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

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

OO Techniques & UML Class Diagrams

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

Unified Modeling Language (UML)

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

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

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

Object-Oriented Systems Analysis and Design Using UML

UML Primer. -Elango Sundaram

Ali Khan < Project Name > Design Document. Version 1.0. Group Id: S1. Supervisor Name: Sir.

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

INTRODUCTION TO UNIFIED MODELING MODEL (UML) & DFD. Slides by: Shree Jaswal

1/17/2014. UML Help and Details (from: UML for cse UML for a class. UML and project clarifications

Meltem Özturan

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

Computer Science for Engineers

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

Object-Oriented Software Engineering Practical Software Development using UML and Java

Unified Modeling Language

Object Oriented Modeling and Design

CSI 32. Lecture Object-Oriented Paradigm. UML (Unified Modeling Language)

Vidyalankar. T.Y. Diploma : Sem. VI [IF/CM] Object Oriented Modeling and Design Prelim Question Paper Solution

Unified Modeling Language

Software Engineering Lab Manual

Introducing the UML Eng. Mohammed T. Abo Alroos

MSO Analysis & UML. Hans Philippi (based on the course slides of Wouter Swierstra) August 24, Analysis & UML 1 / 56

Selection of UML Models for Test Case Generation: A Discussion on Techniques to Generate Test Cases

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Course 3 7 March

Software Development Cycle. Unified Modeling Language. Unified Modeling Language. Unified Modeling Language. Unified Modeling Language.

Today s Agenda UML. CompSci 280 S Introduction to Software Development. 1.Introduction UML Diagrams. Topics: Reading:

Topic 3 Unified Modeling Language UML. Objective: Student will use UML to represent relationshiops between objects, its structure and dynamics.

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

Object Orientated Analysis and Design. Benjamin Kenwright

UNIT-IV BASIC BEHAVIORAL MODELING-I

What is a Class Diagram? A diagram that shows a set of classes, interfaces, and collaborations and their relationships

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

What is a Class Diagram? Class Diagram. Why do we need Class Diagram? Class - Notation. Class - Semantic 04/11/51

INF 111 / CSE 121: Announcements Quiz #3- Thursday What will it cover?

Design Engineering. Dr. Marouane Kessentini Department of Computer Science

Activity Diagram Written Date : September 02, 2016

Unified Modeling Language (UML)

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

Object-Oriented Modeling. Sequence Diagram. Slides accompanying Version 1.0

BASICS OF UML (PART-2)

Unit Wise Questions. Unit-1 Concepts

CHAPTER 5 CO:-Sketch component diagram using basic notations 5.1 Component Diagram (4M) Sample Component Diagram 5.2 Deployment Diagram (8M)

Design and UML Class Diagrams

VISHNU INSTITUTE OF TECHNOLOGY Vishnupur, BHIMAVARAM

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

BPMN Getting Started Guide

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Interactions A link message

Experiment no 4 Study of Class Diagram in Rational Rose

CISC 322 Software Architecture

UML- a Brief Look UML and the Process

OO System Models Static Views

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

Interaction Modelling: Sequence Diagrams

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

Chapter 2: Entity-Relationship Model

Lecture 34 SDLC Phases and UML Diagrams

Introduction. Chapter 1. What Is Visual Modeling? The Triangle for Success. The Role of Notation. History of the UML. The Role of Process

Object-Oriented Design

Introduction to Software Engineering. 6. Modeling Behaviour

Business Process Modelling

IDERA ER/Studio Software Architect Evaluation Guide. Version 16.5/2016+ Published February 2017

LABORATORY 1 REVISION

OOPD UNIT V OBJECT MODELLING USING UML OVERVIEW OF BASIC OBJECT-ORIENTATION CONCEPTS

IS 0020 Program Design and Software Tools

administrivia today UML start design patterns Tuesday, September 28, 2010

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

Software Modeling & Analysis

Ans 1-j)True, these diagrams show a set of classes, interfaces and collaborations and their relationships.

Transcription:

SEEM4570 System Design and Implementation Lecture 11 UML Introduction In the previous lecture, we talked about software development life cycle in a conceptual level E.g. we need to write documents, diagrams, etc. But how to write/draw them?

UML (1) Unified Modeling Language (UML) is a standardized generalpurpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group (OMG). OMG is a consortium. UML provides specifications but not implementation. Before a specification can be accepted as a standard by OMG, the team which propose the specification must guarantee they can use the specification to bring a product to a market within 1 year. This prevents un-implementable standard. UML was in the list of OMG adopted technologies in 1997, and also the industry standard for modeling software-intensive systems. Side Track About Consortium A consortium is an association of two or more individuals, companies, organizations or governments (or any combination of these entities) with the objective of participating in a common activity or pooling their resources for achieving a common goal. Consortium is a Latin word, meaning "partnership", "association" or "society" Con = "together" Sors = "fate" Consors = "Partner"

UML (2) UML is used to specify, visualize, modify, construct and document the artifacts of an object-oriented software-intensive system. UML offers a standard way to visualize a system's blueprint. It can be used with all processes, throughout the software development life cycle, and across different implementation technologies. UML (3) Current version is UML 2.4 UML 2.4 has 14 types of diagrams divided into two categories Each category represents a different view of a model (discuss in the next two slides)

Structure Diagrams Emphasize the things that must be presented in the system. Used extensively in documenting the software architecture Programmers will find them very useful in writing programs Diagrams Class diagram Object diagram Package diagram Component diagram Composite structure diagram Profile diagram Deployment diagram Behavior Diagrams Emphasize what must be happened in the system. Used extensively to describe the functionality of the system System managers and other non-programmers may find them useful in explaining the system Diagrams Activity diagram UML state machine diagram Use case diagram Communication diagram (a kind of interaction diagram) Interaction overview diagram (a kind of interaction diagram) Sequence diagram (a kind of interaction diagram) Timing diagram (a kind of interaction diagram)

Class Diagram Overview Describes the structure of a system by showing the system's classes, attributes, and relationships among classes In a class diagram, there are many classes. Each class is represented by a box with three parts Top The name of the class Middle The properties/attributes of the class Bottom The methods of the class #, +, are known as visibility (See next slide) Person # name string age int + setname(name string) + getname() + setage(age int) + getage() Class Diagram Drawing Visibility used to specify the visibility of the attributes and methods (not mandatory, but usually has) + Public Private # Protected Relationship define the logical relationship among classes Major relationships Bi-directional, Uni-directional, Aggregation, Reflexive, Generalization, Realization

Bi-Directional Relationship It is called Multiplicity Course name string code string + setname(name string) + getname() 0..* 0..1 assigned assigned Room location String room int + setlocation(name String) + getlocation() A classroom can be assigned to 0 to many courses A course can be assigned to 0 or 1 classroom Multiplicity Meaning x..y x to y (x 0, y > 0), e.g. 0..1, 0..2, 2..6, x..* x or more * Zero or more n n only, e.g. 1, 4, 10, Uni-Directional Relationship Printer name String + setname(name String) + getname() 0..* print Course name String description String + setname(name String) + getname() In a uni-directional association, two classes are related, but only one class knows that the relationship exists. In this example, only the Printer class knows the existence of the Course class. This modeling allows printers know which courses they are printing, but the courses do not know they are being printed. This loosens the coupling of the objects and therefore makes the system more adaptive to changes.

Uni-Directional Relationship (cont'd) GameRecord GameStage1 GameStage2 MyDB + connect() + disconnect() Aggregation / Composition Relationship (1) Building securityguard Person 1..* has Person Building has a non-trivial class "Person"! That s why we need to link it back! Note A non-fill diamond indicates the relationship is weak, i.e. even if Building is destroyed, Person (i.e. security guards) will not be destroyed.

Aggregation / Composition Relationship (2) Building listofroom Room 1..* has Room Building has another non-trivial class! That s why we need to link it back! Note The diamond is filled, which means Room depends on Building, i.e. if the Building is destroyed, then all Rooms will also be destroyed. This type of strong aggregation is called Composition Aggregation / Composition Relationship (3) If necessary, we can have uni-directional relationship for aggregation/composition relationship ClassA ClassB ClassA ClassB

Reflexive Relationship A room contains some rooms, e.g. RM101 contains RM101A and RM101B Building # name String # listofroom Room 1..* has Room # subroom Room 0..* contains Staff 0..* supervises 1 supervisor A kind of reflexive relationship. Again, it can be bi-directional or uni-directional A staff supervises 0 or many staff A staff has one supervisor Generalization Relationship Person # name String Generalization relationship Student studentid String Staff # salary int Professor housingallowance int Admin Staff

Realization Relationship (1) <<interface>> Person getname() Realization relationship Generalization relationship Student studentid String Staff # salary int Professor housingallowance int Admin Staff Realization Relationship (2) Why realization? Remember what is interface? It is one of the major properties of OO modeling. If a class is defined as interface, it does not have any implementation details. Hence, we need to write the details that are defined in the interface in the implementing classes. In the diagram in the previous slide, we need to write the getname method in the Student Class and Staff Class. It is the responsibility of the program designer to drop down every single implementation issue carefully and clearly in the diagram

Class Diagram Summary Class A Class A Class A Reflexive Class B Class B Bi-Directional Uni-Directional Class A Class A Class A Class A Class B Class B Class B Class B Aggregation Composition Generalization Realization Object Diagram An object diagram in the Unified Modeling Language (UML), is a diagram that shows a complete or partial view of the structure of a modeled system at a specific time. Do you remember the differences between Class and Object? Object diagrams are more concrete than class diagrams, and are often used to provide examples. An Object diagram focuses on some particular set of object instances and attributes, and the links between the instances.

Object Diagram Example Building # name String # listofroom Room 1..* has Room # floor int ERB Building name = ERB listofroom = Vector<Room> has has ERM301 Room Floor 3 ERM401 Room Floor 4 has ERM506 Room Floor 5 Object Diagram More Information Object diagrams help clarify classes and inheritance They are useful to demonstrate what would happen in the system at a specific time. Can assist non-programmers to understand more about the system as they may find class diagrams are too abstract. Unfortunately, UML 2.4 specification provides no definition of object diagram! It does not have a concrete definition of how it should be drawn!

Package Diagram Describes how a system is split up into logical groupings by showing the dependencies among these groupings. For example, in a Java program package webshoppingcart; import basicwebcomponent; import java.io.*; import... The name of the package that we create We need to import these packages public XXX extends GeneralShoppingCart{ } We try to group programs into packages for better resources management. So we also need to tell the programmers how to implement our ideas! Notations Notation Package Import Access Merge Description Represents a group of model elements and/or diagrams. A relationship that shows the model elements in a package which are to be imported from another package and the visibility is public. A relationship that shows the model elements in a package which are to be imported from another package and the visibility is private. A relationship between two packages showing that their contents are to be combined. This should be used when elements in packages have the same name and represent the same concept.

Package Diagram Example package Web Shopping Cart Mobile Shopping Cart Wireless Shopping Cart import access merge Basic Web Components access access Universal Mobile Shopping Cart Basic Cart Component Component Diagram Describes how a software system is split up into components and shows the dependencies among these components. Developers find the component diagram useful because it provides them with a high-level, architectural view of the system Although may not be able to implement the system (too abstract), it helps developers formalizing a roadmap for the implementation, and make decisions about task assignments. System administrators find component diagrams useful because they get an early view of the logical software components that will be running on their systems.

Components A Component Services/interface to be provided to other components A Component Services/interface required from other components A Component Services/interface to be provided to other components Services/interface required from other components Component Diagram Example OrderProduct Order Product Services Customer Detail Customer Product Code Product

Composite Structure Diagram Visualizes the internal structure of a class. A kind of component diagram used in modeling a system at micro point-of-view. The key entities are Part A role played at runtime by an object or by a collection of objects Port An interaction point that can be used to connect other parts or the environment. Connector It binds entities together, allowing them to interact at runtime. Collaborator Represents by dotted oval. An abstract idea. Composite Structure Diagram Example environment Order Product Services part Search book Search CD Search Engine Search port Another Service A port Do Sth Request port Request Product port connector

Deployment Diagram Describes the hardware used in system implementations and the execution environments and artifacts (e.g. software) deployed on the hardware. Note This is not UML standard components (for illustration purpose only) Deployment Diagram Example

Use Case Diagram Describe a set of actions (use cases) that some systems should or can perform in collaboration with one or more external users (actors). Each use case should provide some observable and valuable result to the user of the system. Used to specify what the system should do but not how the system should do. Major elements of the use case diagram are Actor Association / Relationship Subject / System Use case Use Case Diagram Example Consider In a museum, visitors can purchase admission ticket through a clerk. Purchasing admission ticket requires a payment system, which will be connected to a bank. Note that purchasing admission ticket is a kind of help. In the museum, there is a manager who will mange the daily activities of the museum

Actor Visitor Use Case Diagram Example (cont'd) Association / relationship Ask question Buy Admission Ticket Seek Help <<extend>> <<include>> answer System Clerk Payment Bank Manage Museum Museum Manager Use Case Diagram Example (cont'd) Another example In a museum, visitors can purchase admission ticket through a clerk. Purchasing admission ticket requires a payment system, which will be connected to a bank. Note that the visitors can seek help when purchasing admission ticket. In the museum, there is a manager who will mange the daily activities of the museum

Use Case Diagram Example (cont'd) Note the keyword here also Seek Help answer Visitor Buy Admission Ticket <<include>> <<include>> Clerk $$$ Payment Bank Manage Museum Museum Manager Activity Diagram Graphical representations of workflows of stepwise activities and actions with support for choice, iteration and concurrency. Constructed from a limited number of shapes, connected with arrows. Common shapes Rounded rectangles represent activities; Diamonds represent decisions; Bars represent the start (split) or end (join) of concurrent activities; A black circle represents the start (initial state) of the workflow; An encircled black circle represents the end (final state).

Activity Diagram Example Online shopping dislike Search item found View item Not found like Continue shopping Add to cart Done shopping Check out Activity Diagram Example (cont'd) Process Order Payment Problem Receive Order Payment OK Send invoice Ship order Close Order

State Machine Diagram Describes the states and state transitions of the system Many software systems are event-driven They continuously wait for the occurrence of some external or internal event such as a mouse click, a button press... The response to an event generally depends on the type of the event and the state of the system E.g. if the user want to add an item to the shopping cart, but the shopping cart module is not available (i.e., the state of shopping cart module is down), then the user cannot perform the add item action. State Machine Diagram Example For example, in an ATM machine, there are three states, Idle, Active and Out of Service State Machine of ATM Shut down Damage Idle Put card Out of Services Fixed Take card Active

Sequence Diagram Sequence diagram is the most common kind of interaction diagram, which focuses on the message interchange between a number of lifelines. A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the order in which they occur. This allows the specification of simple runtime scenarios in a graphical manner. Sequence Diagram Example A simple online bank about transfer money sd online bank customer bank Transfer Money Response Logout Redirect to Homepage

Sequence Diagram Example (cont'd) Note that a customer should be able to have multiple transfers! sd online bank customer bank loop Transfer Money Response Logout Redirect to Homepage Sequence Diagram Example (cont'd) We also want to add an option to our customers, such that they can input note before making a transfer! loop opt Input reference number Transfer Money Response

Sequence Diagram Example (cont'd) How about if the customer do not have enough money? We should not make the transfer! loop opt Refer to the previous slide Transfer Money alt [enough money] Transfer OK [not enough money] Transfer fail Sequence Diagram of Facebook

Communication Diagram Represents a combination of information taken from Class, Sequence, and Use Case Diagrams, describing both the static structure and dynamic behavior of a system. Communication diagrams show a lot of the same information as sequence diagrams, but are clearer to show the interaction among elements, whereas sequence diagrams are clearer to show the order in which the interactions take place. Uses free-form arrangement of objects and links. To maintain the ordering of messages, messages are labeled with a chronological number and placed near the link the message is sent. Reading a communication diagram involves starting at message 1.0, and following the messages from object to object. Communication Diagram Example coursedetail 2 getcoursename(courseid) string 3 getlocation() json 4 getstudentlist() array course 3.1 getbuildingname(locationid) string 3.2 getlocationname(locationid) string location staff 1.1 input courseid 1.2 click enquiry 1.3 enquiry(courseid) object student 4.1 getstudentname(studentid) string 4.2 getstudentmajor(studentid) string

Timing Diagram Used to show interactions when the primary purpose of the diagram is to reason about time. Timing diagrams focus on conditions changing within and among lifelines along a linear time axis Server Processing Idle 100ms Browser Waiting Processing Idle 20ms 10ms Web User Viewing Waiting Idle Interaction Overview Diagram The interaction overview diagram is similar to combining activity diagrams, sequence diagrams and timing diagrams

Interaction Overview Diagram Example References http//www.uml-diagrams.org/ http//www.uml.org/ https//creately.com/blog/diagrams/uml-diagram-typesexamples/ http//www.visual-paradigm.com/