Object Oriented Modeling

Similar documents
UML: Unified Modeling Language

Object Oriented Methods with UML

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Introduction to Software Engineering. 6. Modeling Behaviour

Unified Modeling Language (UML)

Unified Modeling Language (UML)

Software Service Engineering

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Engineering Design w/embedded Systems

Course 3 7 March

UML Primer. -Elango Sundaram

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

What is UML / why. UML is graphical and notational representation for software system requirements analysis and design. (Software Engineering )

CSE 308. UML Overview Use Case Diagrams. Reference. Class diagrams. Session 6 UML Intro/Use cases. Robert Kelly, B. Bruegge,

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

Unified Modeling Language (UML)

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

CSE 308. UML Overview Use Case Diagrams. Reference. en.wikipedia.org/wiki/class_diagram. Robert Kelly, B. Bruegge,

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

Lecture 33 April 4, Unied Modelling Language. ECE155: Engineering Design with Embedded Systems Winter Patrick Lam version 1

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

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

Design and UML Class Diagrams

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

Software Engineering Lab Manual

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

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

OBJECT ORIENTED ANALYSIS AND DESIGN

Introduction to UML. Danang Wahyu utomo

Object-Oriented Analysis and Design. Pre-UML Situation. The Unified Modeling Language. Unification Efforts

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Computer Science 520/620 Spring 2013 Prof. L. Osterweil" Use Cases" Software Models and Representations" Part 4" More, and Multiple Models"

Computer Science 520/620 Spring 2013 Prof. L. Osterweil" Software Models and Representations" Part 4" More, and Multiple Models" Use Cases"

MechEng SE3 Lecture 7 Domain Modelling

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

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

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

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

Introduction to Software Engineering. 5. Modeling Objects and Classes

Chapter 2, Modeling with UML, Part 2

CISC 322 Software Architecture

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

UML (Unified Modeling Language)

Unified Modeling Language (UML)

Unified Modeling Language (UML) Class Diagram

UML Diagrams & And Some Of Their Elements

The Unified Modeling Language (UML)

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

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

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

Meltem Özturan

IS 0020 Program Design and Software Tools

Software Engineering

Course "Softwaretechnik Modeling with UML Stephan Salinger

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Object-Oriented Systems Development: Using the Unified Modeling Language

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

2 UML for OOAD. 2.1 What is UML? 2.2 Classes in UML 2.3 Relations in UML 2.4 Static and Dynamic Design with UML. UML for OOAD Stefan Kluth 1

Architecture and the UML

Object-Oriented Systems Analysis and Design Using UML

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

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation

3.0 Object-Oriented Modeling Using UML

Computer Science 520/620 Spring 2014 Prof. L. Osterweil" Use Cases" Software Models and Representations" Part 4" More, and Multiple Models"

Design Patterns. Design Patterns

UML Tutorial. Unified Modeling Language UML Tutorial

Object-Oriented and Classical Software Engineering

UML Modeling. Sumantra Sarkar. 29 th June CIS 8090 Managing Enterprise Architecture

Object-Oriented Analysis Techniques Coad s OOA Technique Short History Terminological Comparison Postscript and Remarks

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

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

Developing Shlaer-Mellor Models Using UML

Chapter 4. Capturing the Requirements. 4th Edition. Shari L. Pfleeger Joanne M. Atlee

Principles of Software Construction: Objects, Design and Concurrency. Just enough UML. toad

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

LABORATORY 1 REVISION

UML part I. UML part I 1/41

Experiment no 4 Study of Class Diagram in Rational Rose

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011

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

An Introduction To Object Modeling System Concept for Object Modeling The Overall View Components of UML Diagram

UML- a Brief Look UML and the Process

What is a Model? Copyright hebley & Associates

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

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

A Tutorial on Agent Based Software Engineering

Petri Nets" Computer Science 520/620 Spring 2011 Prof. L. Osterweil" Software Models and Representations" Part 3" Some Semantics"

Computer Science 520/620 Spring 2011 Prof. L. Osterweil" Software Models and Representations" Part 3" Petri Nets"

Recap : UML artefacts. Black Box Requirements. Functional Specification. System. System. Test. Design. System. System. Development.

Agenda. Why Model. Why Model? History of OO Modeling Methodologies Object Modeling Technique (OMT) Unified Modeling Language (UML)

CIS 771: Software Specifications

Introducing the UML Eng. Mohammed T. Abo Alroos

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

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

Index. Add Diagram > Sequence Diagram command,

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 8 Data Modeling Advanced Concepts

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

UML-Based Conceptual Modeling of Pattern-Bases

Transcription:

Overview UML Unified Modeling Language What is Modeling? What is UML? A brief history of UML Understanding the basics of UML UML diagrams UML Modeling tools 2 Modeling Object Oriented Modeling Describing a system at a high level of Abstraction A model of the system Used for requirements and specification Is it necessary to model software systems? Many notations over time State machines Entity-relationship diagrams Dataflow diagrams 3 4 What is UML? UML stands for Unified Modeling Language It is a industry-standard graphical language for specifying, visualizing, constructing, and documenting the artifacts of software systems The UML uses mostly graphical notations to express the OO analysis and design of software projects Simplifies the complex process of software design 5 Why we use UML for Modeling? Use graphical notation to communicate more clearly than natural language (imprecise) and code (too detailed) Help acquire an overall view of a system UML is not dependent on any one language or technology UML moves us from fragmentation to standardization 6 1

History of UML Recent History: 1980 s The rise of object-oriented programming New class of OO modeling languages By early 90 s, over 50 OO modeling languages 7 8 Recent History: 1990 s Three leading OO notations decide to combine Grady Booch (BOOCH) James Rumbaugh (OML: Object Modeling Technique) Ivar Jacobsen (OOSE: OO Soft. Eng) Why? Natural evolution towards each other Effort to set an industry standard 9 UML UML stands for Unified Modeling Language Design by committee Many interest groups participating Everyone wants their favorite approach to be in 10 UML Resulting design is huge Many features Many loosely unrelated styles under one roof Could also be called Union of all Modeling Languages This Lecture We discuss Use Case Diagrams Class Diagrams Sequence Diagrams Activity Diagrams State Diagrams This is a subset of UML But probably the most used subset 11 12 2

Overview of UML Diagrams Structural : element of spec. irrespective of time Class Component Deployment Object Composite structure Package Profile Behavioral : behavioral features of a system / business process Activity State machine Use case Interaction Interaction : emphasize object interaction Communication(collaberati on) Sequence Interaction overview Timing Use-Cases Describe functionality from the user s perspective One (or more) use-cases per kind of user May be many kinds in a complex system Use-cases capture requirements 13 14 An Example Use-Case in UML An Example Use-Case in UML Name Normal Train Ride Actors Passenger Entry Condition Passenger at station Exit Condition Passenger leaves station Event-flow Passenger presses request button Train arrives and stops at platform Doors open Passenger steps into train Doors close Passenger presses request button for final stop Doors open at final stop Passenger exits train Non-functional requirements 15 16 Use Case Diagram Class Diagrams Graph showing Actors Use cases Edges actor-case if that actor is involved in that case Actors Stick figures Use cases Ovals Describes the structure of a system by showing the system s classes, their attributes, operations (or methods), and the relationships among the classes Used for requirement capture, end-user interaction Detailed class diagrams are used for developers 17 18 3

Class Representation An example of a Class Each class is represented by a rectangle subdivided into three compartments Name Attributes Operations Modifiers are used to indicate visibility of attributes and operations. + is used to denote Public visibility (everyone) # is used to denote Protected visibility (friends and derived) - is used to denote Private visibility (no one) By default, attributes are hidden and operations are visible. Describe classes In the OO sense Each box is a class List attributes List operations The more detail, the more like a design it becomes Account_Name - Customer_Name - Balance +addfunds( ) +withdraw( ) +transfer( ) Name Attributes Operations 19 20 Class Diagrams: OO Relationships OO Relationships: Generalization Many different kinds of edges to show different relationships between classes Generalization (parent-child relationship) Association (student enrolls in course) Associations can be further classified as Aggregation Composition Subtype1 Supertype Subtype2 Generalization express a parent-child relationship (inheritance) among related classes Used for abstracting details in several layers Denoted by open triangle 21 22 Generalization Example OO Relationships: Associations 23 Represent relationship between instances of classes Student enrolls in a course Courses have students Courses have exams Etc. Association has two ends Role names (e.g. enrolls) Multiplicity (e.g. One course can have many students) Navigability (unidirectional, bidirectional) 24 4

Associations: Multiplicity and Roles University Symbol Meaning 1 Multiplicity 1 One and only one 0..1 Zero or one M..N 0..1 employer From M to N (natural language) * From zero to any positive integer 0..* From zero to any positive integer 1..* From one to any positive integer student * * teacher Person Role A given university groups many people; some act as students, others as teachers. A given student belongs to a single university; a given teacher may or may not be working for the university at a particular time. 25 OO Relationships: Aggregation AGGREGATION Example Container Class Class C Class E 1 Class E 2 Apples Containee Classes Bag Milk [From Dr.David A. Workman] Aggregation: is a variant of the has a or association relationship; aggregation is more specific than association. It is an association that represents a part-whole or part-of relationship. It is a specific kind of Container- Containee relationship. Aggregation can occur when a class is a collection or container of other classes, but where the contained classes do not have a strong life cycle dependency on the container essentially, if the container is destroyed, its contents are not. 26 OO Relationships: Composition Whole Class Class W Class P 1 Class P 2 Example Engine Part Classes Automobile Transmission Composition: is a stronger variant of the owns a or association relationship; composition is more specific than aggregation. It is a specific kind of Whole-Part relationship. Composition usually has a strong life cycle dependency between instances of the container class and instances of the contained class(es): If the container is destroyed, normally every instance that it contains is destroyed as well. It expresses a relationship where an instance of the Whole-class has the responsibility to create and initialize instances of each Part-class. Composition should also be used to express relationship where instances of the Whole-class have exclusive access to and control of instances of the Part-classes. Composition should be used to express a relationship where the behavior of Part instances is undefined without being related to an instance of the Whole. And, conversely, the behavior of the Whole is ill-defined or incomplete if one or more of the Part instances are undefined. Sequence Diagrams Sequence diagrams Refine use cases Gives view of dynamic behavior of classes A sequence diagram shows object interactions arranged in time sequence. It depicts the objects and classes involved in the scenario and the sequence of messages exchanged between the objects needed to carry out the functionality of the scenario. [From Dr.David A. Workman] 27 28 Sequence Diagrams Example Sequence Diagram A table Columns are classes or actors Rows are time steps Entries show control/data flow Method invocations Important changes in state Classes & Actors 29 30 5

Example Sequence Diagram Example Sequence Diagram Method invocation Note: These are all synchronous method calls. There are other kinds of invocations. Invocation lifetime spans lifetimes of all nested invocations 31 32 Example Sequence Diagram Example Sequence Diagram: Make a phone call Caller Phone Recipient Picks up Lifelines fill in time between invocation s Dial tone Dial Ring notification Ring Picks up Hello 33 34 Sequence Diagram: Object interaction Activity Diagrams Self-Call: A message that an Object sends to itself. A Synchronous B Reincarnation of flow charts Uses flowchart symbols Condition: indicates when a message is sent. The message is sent only if the condition is true. Asynchronous Transmission delayed Emphasis on control-flow Condition Iteration [condition] remove() *[for each] remove() Two useful flowchart extensions Hierarchy A node may be an activity diagram Self-Call Swim lanes 35 36 6

Example Activity Diagram Example Activity Diagram 37 38 Example Activity Diagram Another Example Activity Diagram 39 40 StateCharts State Diagrams (Traffic light example) Hierarchical finite automata Invented by David Harel, 1983 Transition State Traffic Light Red Start Specify automata with many states compactly Yellow Complications in meaning of transitions What it means to enter/exit a compound state Event Green 41 42 7

Example Simple StateChart StateChart for Buttons + Train 43 44 Opinions about UML: What s Good Opinions On UML: What s Bad A common language Makes it easier to share requirements, specs, designs Hodge-podge of ideas Union of most popular modeling languages Sublanguages remain largely unintegrated Visual syntax is useful, to a point A picture is worth 1000 words For the non-technical, easier to grasp simple diagrams than simple pseudo-code To the extent UML is precise, forces clarity Much better than natural language Commercial tool support Something natural language could never have 45 Visual syntax does not scale well Many details are hard to depict visually Ad hoc text attached to diagrams No visualization advantage for large diagrams 1000 pictures are very hard to understand Semantics is not completely clear Some parts of UML underspecified, inconsistent Plans to fix 46 UML is Happening What UML Modeling tools we use today? UML is being widely adopted By users By tool vendors By programmers A step forward Seems useful First standard for high-levels of software process Expect further evolution, development of UML List of UML tools http://en.wikipedia.org/wiki/list_of_uml_tools ArgoUML: http://argouml.tigris.org/ Rational Rose (www.rational.com) by IBM UML Studio 7.1 ( http://www.pragsoft.com/) by Pragsoft Corporation: Capable of handling very large models (tens of thousands of classes). Educational License US$ 125.00; Freeware version. TogetherSoft Control Center; TogetherSoft Solo ( http://www.borland.com/together/index.html) by Borland 47 48 8