Introduction to UML Sources:

Slides:



Advertisements
Similar presentations
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Advertisements

Object-Oriented Analysis and Design
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION UNIFIED MODELING LANGUAGE (UML) Autumn 2011
Chapter 15: System Modeling with UML
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
© Copyright Eliyahu Brutman Programming Techniques Course.
SE-565 Software System Requirements More UML Diagrams.
1 CSE 403 Design and UML Class Diagrams Reading: UML Distilled Ch. 3, by M. Fowler These lecture slides are copyright (C) Marty Stepp, They may not.
1 TCSS 360, Spring 2005 Lecture Notes Design Phase and UML Class Diagrams Relevant Reading: UML Distilled, Third Edition M. Fowler.
UML January 24, 2011 CSE 403, Winter 2011, Brun Design and UML Class Diagrams.
Unified Modeling Language
The Unified Modeling Language (UML) Class Diagrams.
Introduction to UML Lian Yu Department of Computer Science and Engineering Arizona State University Tempe, AZ
ITEC 370 Lecture 10 Design. Review Design –Why is it part of the process? –Who is the audience for design?
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Chapter 5 System Modeling Sommerville, "software engineering ", 9 th Ed., 2011.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Model Lecture p6 T120B pavasario sem.
CSE 403, Spring 2008, Alverson Using UML to express Software Architecture.
CSE 403, Spring 2007, Alverson Using UML to express Software Architecture.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
CSE 219 Computer Science III UML. UML Diagrams UML - Unified Modeling Language UML diagrams are used to design object-oriented software systems –represent.
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Introduction to UML Todd Bacastow Rational Unified Process A process for the effective implementation of key “Best Practices” Control Changes Manage.
Chapter 3: Introducing the UML
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Unified Modeling Language (UML)
1 More About UML Todd Bacastow Penn State University Geospatial System Analysis & Design.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Design and UML Class Diagrams
Introduction to UML.
Software Design Models UML
TCSS 305 (Stepp) OO Design with UML Class Diagrams
CHAPTER
UML Diagrams: Class Diagrams The Static Analysis Model
UML(Unified Modeling Language)
Unified Modeling Language Tutorial
Unified Modeling Language
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Unified Modeling Language—UML A Very Brief Introduction
Chapter 11 Object-Oriented Design
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Lecture on Design Phase and UML Class Diagrams
Abstract descriptions of systems whose requirements are being analysed
Introduction to UML: Unified Modeling Language
A tool for presentation of Architecture
A tool for presentation of Architecture
Introduction to Unified Modeling Language (UML)
Object Oriented Analysis and Design
Systems Analysis and Design With UML 2
Introduction to Unified Modeling Language (UML)
CIS 375 Bruce R. Maxim UM-Dearborn
Unified Modelling Language
Copyright 2007 Oxford Consulting, Ltd
Object Oriented Programming Review
CIS 375 Bruce R. Maxim UM-Dearborn
Object Oriented System Design Class Diagrams
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
ITEC324 Principle of CS III
From Class Diagram to Contract Diagram
Presentation transcript:

Introduction to UML Sources: Design and UML Class Diagrams, UML Distilled , Ch. 3, by M. Fowler Introduction to UML: Structural Modeling and Use Cases by Cris Kobryn

Why do we model? Provide structure for problem solving Experiment to explore multiple solutions Furnish abstractions to manage complexity Reduce time-to-market for business problem solutions Decrease development costs Manage the risk of mistakes

Introduction to UML UML is Unified Modeling Language. UML: pictures of an OO system programming languages are not abstract enough for OO design UML is an open standard; lots of companies use it What is legal UML? a descriptive language: rigid formal syntax (like programming) a prescriptive language: shaped by usage and convention it's okay to omit things from UML diagrams if they aren't needed by team/supervisor/instructor Source: Design and UML Class Diagrams, UML Distilled , Ch. 3, by M. Fowler

Uses for UML as a sketch: to communicate aspects of system forward design: doing UML before coding backward design: doing UML after coding as documentation often done on whiteboard or paper used to get rough selective ideas as a blueprint: a complete design to be implemented sometimes done with CASE (Computer-Aided Software Engineering) tools as a programming language: with the right tools, code can be auto-generated and executed from UML only good if this is faster than coding in a "real" language

UML 2.0 2 types of diagrams Structure Diagrams Behavior Diagrams Provide a way for representing the data and static relationships that are in an information system Example: Class diagram Behavior Diagrams Has several new diagrams not in earlier versions of UML Earlier versions focused on the analysis and design activities Other types of structural diagrams: Object diagram Shows the relationships between objects Very similar to class diagrams Primary purpose: to allow analyst to uncover additional details of a class Instantiating a class may reveal additional attributes, relationships and/or operations OR may reveal that they are misplaced Package diagram Essentially class diagrams that only show packages, instead of classes Groups UML elements together to form higher-level constructs Deployment Diagram Shows the physical architecture and software components of system Used to represent the relationships between the hardware components used in the physical infrastructure of an information system the software components and how they are deployed over the physical architecture or infrastructure of an information system Examples: communication relationships on a network Environment for the execution of software Component Diagram Models the physical relationships among software components When designing client-server systems, useful to show which classes or packages of classes will reside on client nodes and which on the server Useful when designing component-based systems Composite Structure Diagram Illustrates internal structure of a class New diagram for when the internal structure of a class is complex Used to model the relationships among parts of a class

UML Modeling Notations Class Diagrams information structure relationships between data items modular structure for the system Use Cases user’s view Lists functions visual overview of the main requirements Package Diagrams Overall architecture Dependencies between components Statecharts responses to events dynamic behavior event ordering, reachability, deadlock, etc Sequence Diagrams individual scenario interactions between users and system Sequence of messages Activity diagrams business processes; concurrency and synchronization; dependencies between tasks; 6

UML Building Blocks The basic building blocks of UML are: model elements (classes, interfaces, components, use cases, etc.) relationships (associations, generalization, dependencies, etc.) diagrams (class diagrams, use case diagrams, interaction diagrams, etc.)

UML class diagrams What is a UML class diagram? What are some things that are not represented in a UML class diagram? UML class diagram: a picture of the classes in an OO system, their fields and methods, and connections between the classes that interact or inherit from each other details of how the classes interact with each other algorithmic details; how a particular behavior is implemented

Diagram of one class class name in top of box attributes (optional) write <<interface>> on top of interfaces' names use italics for an abstract class name attributes (optional) should include all fields of the object operations / methods (optional) may omit trivial (get/set) methods but don't omit any methods from an interface! should not include inherited methods

Class attributes attributes (fields, instance variables) visibility name : type [count] = default_value visibility: + public # protected - private ~ package (default) / derived underline static attributes derived attribute: not stored, but can be computed from other attribute values attribute example: - balance : double = 0.00

Class operations / methods visibility name (parameters) : return_type visibility: + public # protected - private ~ package (default) underline static methods parameter types listed as (name: type) omit return_type on constructors and when return type is void method example: + distance(p1: Point, p2: Point): double

Comments represented as a folded note, attached to the appropriate class/method/etc by a dashed line

Relationships btwn. classes generalization: an inheritance relationship inheritance between classes interface implementation association: a usage relationship dependency aggregation composition

Generalization relationships generalization (inheritance) relationships hierarchies drawn top-down with arrows pointing upward to parent line/arrow styles differ, based on whether parent is a(n): class: solid line, black arrow abstract class: solid line, white arrow interface: dashed line, white arrow we often don't draw trivial / obvious generalization relationships, such as drawing the Object class as a parent

Associational relationships associational (usage) relationships 1. multiplicity (how many are used) *  0, 1, or more 1  1 exactly 2..4  between 2 and 4, inclusive 3..*  3 or more 2. name (what relationship the objects have) 3. navigability (direction)

Multiplicity of associations one-to-one each student must carry exactly one ID card one-to-many one rectangle list can contain many rectangles

Association types aggregation: "is part of" Car 1 aggregation 1 aggregation: "is part of" symbolized by a clear white diamond composition: "is entirely made of" stronger version of aggregation the parts live and die with the whole symbolized by a black diamond dependency: "uses temporarily" symbolized by dotted line often is an implementation detail, not an intrinsic part of that object's state Engine Page Book composition * 1 Lottery Ticket Random dependency

Class diagram example 1

Class diagram example 2 1..* 1 0..1 DVD Movie VHS Movie Video Game Rental Item Rental Invoice 1..* 1 Customer Checkout Screen 0..1 Simple Association Class Abstract Aggregation Generalization Composition Multiplicity

Class diagram example 3 StudentBody Student Address 1 100 - firstName : String - lastName : String - homeAddress : Address - schoolAddress : Address + main (args : String[]) + toString() : String Address - streetAddress : String - city : String - state : String - zipCode : long + toString() : String

Tools for creating UML diags. Violet (free) http://horstmann.com/violet/ Rational Rose http://www.rational.com/ Visual Paradigm UML Suite (trial) http://www.visual-paradigm.com/ (nearly) direct download link: http://www.visual-paradigm.com/vp/download.jsp?product=vpuml&edition=ce (there are many others, but most are commercial)