UML Diagrams Practical Tutorial

Slides:



Advertisements
Similar presentations
UML an overview.
Advertisements

UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Information System Design IT60105
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
Unified Modeling Language
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 21. Review ANALYSIS PHASE (OBJECT ORIENTED DESIGN) Functional Modeling – Use case Diagram Description.
Other UML Diagramming Techniques CS 124. UML Diagramming Techniques Class Diagrams Use Case Diagrams Interaction Diagrams Sequence diagrams Collaboration.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
Unified Modeling Language* Keng Siau University of Nebraska-Lincoln *Adapted from “Software Architecture and the UML” by Grady Booch.
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
An Introduction to the Unified Modeling Language
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
UML (Unified Modeling Language)
Chapter 3: Introducing the UML
UML. Model An abstract representation of a system. Types of model 1.Use case model 2.Domain model 3.Analysis object model 4.Implementation model 5.Test.
1 An Overview of UML. 2 The Unified Modeling Language UML is a graphical language used by software engineers to model software systems during development.
Design Review.
Introduction to UML.
Systems Analysis and Design in a Changing World, Fourth Edition
Appendix 3 Object-Oriented Analysis and Design
CHAPTER
UML Diagrams By Daniel Damaris Novarianto S..
Chapter 5 System modeling
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
University of Central Florida COP 3330 Object Oriented Programming
UML Diagrams Jung Woo.
System Modeling Chapter 4
OBJECT MODELLING USING UML
Business System Development
UML dynamic Modeling (Behavior Diagram)
Object-Oriented Software Design (lecture 7)
A tool for presentation of Architecture
A tool for presentation of Architecture
Unified Modeling Language
UML: Unified Modeling Language
Week 12: Activity & Sequence Diagrams
Introduction to UML.
Chapter 20 Object-Oriented Analysis and Design
Object oriented analysis and design
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix A Object-Oriented Analysis and Design
Design and Implementation
Other UML Diagramming Techniques
Software Design Lecture : 15.
Copyright 2007 Oxford Consulting, Ltd
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Chapter 22 Object-Oriented Systems Analysis and Design and UML
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix A Object-Oriented Analysis and Design
Chapter 4 System Modeling.
Appendix 3 Object-Oriented Analysis and Design
CS 501: Software Engineering
Presentation transcript:

UML Diagrams Practical Tutorial

Object Modelling Using UML UML is a modelling language Not a system design or development methodology Used to document object-oriented analysis and design results. Independent of any specific design methodology.

UML Origin OOD in late 1980s and early 1990s: Different software development houses were using different notations. Methodologies were tied to notations. UML developed in early 1990s to: Standardize the large number of object-oriented modelling notations

UML Lineology Based Principally on: OMT [Rumbaugh 1991] Booch’s methodology[Booch 1991] OOSE [Jacobson 1992] Odell’s methodology[Odell 1992] Shlaer and Mellor [Shlaer 1992]

Different Object Modeling Techniques in UML Booch’s Methodology OOSE OMT

UML as A Standard Adopted by Object Management Group (OMG) in 1997 OMG is an association of industries Promotes consensus notations and techniques Used outside software development Example car manufacturing

Developments to UML UML continues to develop: Refinements Making it applicable to new contexts UML 1.X Application to embedded systems UML 2.0

Why are UML Models Required? A model is an abstraction mechanism: Capture only important aspects and ignores the rest. Different models result when different aspects are ignored. An effective mechanism to handle complexity. UML is a graphical modelling tool Easy to understand and construct

Modeling a House

UML Diagrams Nine diagrams are used to capture different views of a system. Views: Provide different perspectives of a software system. Diagrams can be refined to get the actual implementation of a system.

UML Model Views Views of a system: User’s view Structural view Behavioral view Implementation view Environmental view

UML Diagrams Behavioural View Structural View User’s View Use Case Diagram Structural View Class Diagram Object Diagram Implementation View Component Diagram Environmental View Deployment Diagram Behavioural View Sequence Diagram Collaboration Diagram - State-chart Diagram - Activity Diagram Diagrams and views in UML

Are All Views Required for Developing A Typical System? NO Use case diagram, class diagram and one of the interaction diagram for a simple system State chart diagram required to be developed when a class state changes However, when states are only one or two, state chart model becomes trivial Deployment diagram in case of large number of hardware components used to develop the system

Use Cases Different ways in which a system can be used by the users Corresponds to the high-level requirements Represents transaction between the user and the system Defines external behavior without revealing internal structure of system Set of related scenarios tied together by a common goal.

Use Cases Cont… Normally, use cases are independent of each other Implicit dependencies may exist Example: In Library Automation System, renew-book & reserve-book are independent use cases. But in actual implementation of renew-book: a check is made to see if any book has been reserved using reserve-book.

Example Use Cases For library information system issue-book query-book return-book create-member add-book, etc.

Representation of Use Cases Represented by use case diagram A use case is represented by an ellipse System boundary is represented by a rectangle Users are represented by stick person icons (actor)‏ Communication relationship between actor and use case by a line External system by a stereotype

An Example Use Case Diagram Use case model Tic-tac-toe game Play Move Player

Why Develop A Use Case Diagram? Serves as requirements specification How are actor identification useful in software development: User identification helps in implementing appropriate interfaces for different categories of users Another use in preparing appropriate documents (e.g. user’s manual).

Factoring Use Cases Two main reasons for factoring: Complex use cases need to be factored into simpler use cases To represent common behavior across different use cases Three ways of factoring: Generalization Includes Extends

Factoring Use Cases Using Generalization Pay membership fee Pay through library pay card Pay through credit card

Factoring Use Cases Using Includes Base use case Common use case <<include>> Issue Book Update Selected books Get user selection Check for reservation Renew book <<include>>

Factoring Use Cases Using Extends Base use case Common <<extends>>

Hierarchical Organization of Use Cases External users use case 3.1 use case 3. 2 use case 3.3 Subsystems use case 1 use case 2 use case 3 Method

Use Case Packaging Accounts Query balance Receive grant Print Balance sheet Make payments Accounts

Class Diagram Describes static structure of a system Main constituents are classes and their relationships: Generalization Aggregation Association Various kinds of dependencies

Class Diagram Entities with common features, i.e. attributes and operations Classes are represented as solid outline rectangle with compartments Compartments for name, attributes, and operations. Attribute and operation compartments are optional depending on the purpose of a diagram.

Class Diagram Different representations of the LibraryMember class Member name Membership number Address Phone number E-mail address Membership admission date Membership expiry date Books issued issueBook( ); findPendingBooks( ); findOverdueBooks( ); returnBook( ); findMembershipDetails( ); LibraryMember Member name Membership number Address Phone number E-mail address Membership Admission date Membership expiry date Books issued LibraryMember Different representations of the LibraryMember class

Interaction Diagram Models how groups of objects collaborate to realize some behaviour Typically each interaction diagram realizes behaviour of a single use case

Interaction Diagram Two kinds: Sequence and Collaboration diagrams. Two diagrams are equivalent Portray different perspectives These diagrams play a very important role in the design process.

Sequence Diagram Objects are shown as boxes at top Shows interaction among objects as a two- dimensional chart Objects are shown as boxes at top If object created during execution then shown at appropriate place Objects existence are shown as dashed lines (lifeline)‏ Objects activeness, shown as a rectangle on lifeline

Sequence Diagram Cont… Messages are shown as arrows Each message labelled with corresponding message name Each message can be labelled with some control information Two types of control information condition ([])‏ iteration (*)‏

Elements of a Sequence Diagram object lifetime control message

Example Cont… Sequence of message sending

An Example of A Sequence Diagram :Library Boundary Book Renewal Controller Register :Book Member renewBook displayBorrowing selectBooks [reserved] apology confirm find MemberBorrowing bookSelected * find update updateMemberBorrowing Sequence Diagram for the renew book use case

Collaboration Diagram Shows both structural and behavioural aspects Objects are collaborator, shown as boxes Messages between objects shown as a solid line A message is shown as a labelled arrow placed near the link Messages are prefixed with sequence numbers to show relative sequencing

An Example of A Collaboration Diagram :Library Boundary Book Renewal Controller Register :Book Member 1: renewBook 3: display Borrowing 4: selectBooks [reserved] 8: apology 12: confirm 2: findMemberBorrowing 5: book Selected 6: * find 9: update 7: apology 10: confirm updateMemberBorrowing Collaboration Diagram for the renew book use case

Activity Diagram Not present in earlier modelling techniques: Possibly based on event diagram of Odell [1992] Represents processing activity, may not correspond to methods Activity is a state with an internal action and one/many outgoing transitions Somewhat related to flowcharts

Activity Diagram vs Flow Chart Can represent parallel activity and synchronization aspects Swim lanes can be used to group activities based on who is performing them Example: academic department vs. hostel

Activity Diagram Normally employed in business process modelling. Carried out during requirements analysis and specification stage. Can be used to develop interaction diagrams.

An Example of An Activity Diagram check student records Academic Section receive fees allot room hostel create hospital record conduct medical examination register in course Accounts Section Hostel Office Hospital Department issue identity card Activity diagram for student admission procedure at IIT

Activity Diagram: Example 2 Stock Manager Finance Order Processing Receive Order Receive Supply *[for each line item on order] Choose Outstanding Order Items Check Line Item Authorize Payment [failed] * [for each chosen order item] Cancel Order [in stock] Assign to Order Assign Goods to Order [succeeded] [need to reorder] Reorder Item [all outstanding order items filled] [stock assigned to all line items and payment authorized] Dispatch Order

State Chart Diagram Based on the work of David Harel [1990] Model how the state of an object changes in its lifetime Based on finite state machine (FSM) formalism

State Chart Diagram Cont… State chart avoids the problem of state explosion of FSM. Hierarchical model of a system: Represents composite nested states

State Chart Diagram Cont… Elements of state chart diagram Initial State: A filled circle Final State: A filled circle inside a larger circle State: Rectangle with rounded corners Transitions: Arrow between states, also boolean logic condition (guard)‏

An Example of A State Chart Diagram Unprocessed Order Fulfilled Pending Accepted Rejected order received [reject] checked [accept] checked [some items not available] processed [all items available] newsupply [some items available] processed / deliver Example: State chart diagram for an order object

Component Diagram Captures the physical structure of the implementation (code components)‏

Component Diagram Captures the physical structure of the implementation Built as part of architectural specification Purpose Organize source code Construct an executable release Specify a physical database Developed by architects and programmers

Deployment Diagram Captures the topology of a system’s hardware A piece of hardware