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

Similar documents
Model Driven Development Unified Modeling Language (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?

OO Analysis and Design with UML 2 and UP

12 Tutorial on UML. TIMe TIMe Electronic Textbook

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

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

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

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

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Introduction to Software Engineering. 5. Modeling Objects and Classes

Object Oriented Modeling

3.0 Object-Oriented Modeling Using UML

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

Index. Add Diagram > Sequence Diagram command,

Unified Modeling Language (UML)

Enterprise Architect Training Courses

Models are used for several purposes. We believe that some of the most important are:

Unified Modelling Language

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

Object Oriented System Development

Meltem Özturan

Software Service Engineering

Object-Oriented Systems Development: Using the Unified Modeling Language

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

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

Engineering Design w/embedded Systems

Software Engineering with Objects and Components Open Issues and Course Summary

Object-Oriented and Classical Software Engineering

UML 2.0 State Machines

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Software Engineering from a

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

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

UML Primer. -Elango Sundaram

ISO/IEC INTERNATIONAL STANDARD. Information technology Open Distributed Processing Unified Modeling Language (UML) Version 1.4.

What's New in UML 2.0

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

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

The UML Extension Mechanisms

Introduction to Software Engineering. 5. Modeling Objects and Classes

CISC 322 Software Architecture

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

Unified Modeling Language (UML)

Architecture and the UML

Representing System Architecture

06. Analysis Modeling

OMG Modeling Glossary B

UML part I. UML part I 1/41

Object-Oriented Design

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

IS 0020 Program Design and Software Tools

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

Course 3 7 March

TTool Training. I. Introduction to UML

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

Introduction to UML p. 1 Introduction to the Object-Oriented Paradigm p. 1 What Is Visual Modeling? p. 6 Systems of Graphical Notation p.

Object-Oriented Analysis and Design Using UML

UML Start-Up Training UB1

NOTES ON OBJECT-ORIENTED MODELING AND DESIGN

INTERACTION ARCHITECTURAL MODELING. Lecture 9 Interaction Architectureal Modeling

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

Object-Oriented Systems Development: Using the Unified Modeling Language

Unified Modeling Language

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

UML Tutorial. Unified Modeling Language UML Tutorial

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

CIS 771: Software Specifications

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

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

Objectives. UML Extension Mechanisms. What is UML? Is the UML enough? UML Extension Mechanisms. Specifications. By Jasmine Farhad

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

Object-Oriented Systems Analysis and Design Using UML

Introduction to UML. Danang Wahyu utomo

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

UML Unified Modeling Language

Software Engineering Lab Manual

Index. : (colon), 80 <<>> (guillemets), 34, 56

UML: Unified Modeling Language

Outline. A little history. Outline. The Unified Modeling Language Opportunities and Challenges for Formal Methods

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation

History of object-oriented approaches

Introduction to UML What is UML? Motivations for UML Types of UML diagrams UML syntax Descriptions of the various diagram types Rational Rose (IBM.. M

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

MechEng SE3 Lecture 7 Domain Modelling

User Interface Design with Components

UML big picture. Perdita Stevens. School of Informatics University of Edinburgh

Hippo Software BPMN and UML Training

SHRI ANGALAMMAN COLLEGE OF ENGINEERING & TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR,TRICHY

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

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

Software Development Methodologies

Week 9 Implementation

UML Diagrams & And Some Of Their Elements

Unified Modeling Language for Real-Time Systems Design

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

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

From Analysis to Design. LTOOD/OOAD Verified Software Systems

Unified Modeling Language Specification Version formal/

SEEM4570 System Design and Implementation. Lecture 10 UML

Transcription:

Object-Oriented Analysis and Design Analysis vs. Design Analysis Activities Finding the Objects/ Classes An Analysis Example The Unified Modeling Language Pre-UML Situation Early 90s Explosion of OO methods/notations No agreed terminology No standards No method/notation that satisfies a users needs completely Booch, OMT and OOSE among the most popular methods New generations of methods/notations Unification efforts OOSD--fall'04 Copyright by jubo@cs.umu.se 28 OOSD--fall'04 Copyright by jubo@cs.umu.se 29 Unification Efforts UML consortium Booch, OMT and OOSE Rational Booch, Rumbaugh (10/94) Jacobson (fall 95) Unified (v0.8, 10/95) UML consortium ( 96) UML (v0.9, 06/96) Unified process ( 98/ 99) OPEN consortium Fusion, MOSES, SOMA Firesmith, Graham, Henderson-Sellers, Yourdon, Toolbox approach Tailorable The Unified Modeling Language UML partners: Microsoft, Oracle, IBM, HP, Ericsson,... Here v1.4 (no visible difference to v1.5) Notations (8 official diagram types) Use case diagram Class diagram Interaction diagram Sequence diagram Collaboration diagram Statechart diagram Activity diagram Component diagram Deployment diagram OMG standard (v1.1, 11/97) ISO standard (v1.3, 10/00) OML ( 97) OPEN process ( 97) Integration with UML? OOSD--fall'04 Copyright by jubo@cs.umu.se 30 XMI (XML Metadata Interchange, standardised XML- DTD for UML, developed by an IBM-lead consortium) UML 2.0 adopted (draft, 06/03) OOSD--fall'04 Copyright by jubo@cs.umu.se 31

Rational s 4+1 View Logical View Process View packages, classes, scenarios, STDs Use Case View processes, threads, synchronization Implementation View actors, use cases Deployment View physical nodes subsystems, modules, code UML 2.0 Infrastructure: UML kernel and extension mechanisms Superstructure: UML user level constructs OCL: Object Constraint Language Diagram Interchange The UML metamodel describes the UML model elements Abstract syntax in terms of UML Well-formedness rules in terms of OCL and English prose Semantics (model usage) in terms English prose OOSD--fall'04 Copyright by jubo@cs.umu.se 32 OOSD--fall'04 Copyright by jubo@cs.umu.se 33 UML 2.0 Diagrams Organising Models Packages diagrams are used to organise models Defines namespaces á la C++ GUI User Forms Admin Forms javax.swing DB Interface Can be used for all diagram types Inofficial UML1.x diagram OOSD--fall'04 Copyright by jubo@cs.umu.se 34 OOSD--fall'04 Copyright by jubo@cs.umu.se 35

Class Diagrams Static analysis and design models Types of objects and their (static) interrelationships Basically similar to UML2.0 (but more carefully defined) Main elements: <class name> Classes <attribute list> Attributes Methods Relationships <method list> Dependency Association strength Aggregation/Composition Generalisation Realisation OOSD--fall'04 Copyright by jubo@cs.umu.se 36 Class Notations Analysis Window Window size: Area maxsize create() resize() repaint() Design Window {author = Joe, status = tested} +size: Area = (100, 100) #maxsize: Rectangle -xwindowptr -components [*] {ordered} +create() +resize( in f: real = 1.25): Area #repaint( in gc: Graphics) Attribute :: [visibility] [/] name [: type] [multiplicity] [= default-value] [{ property-string }] Operation :: [visibility] name ( [parameter-list] ) [: return-type [{ property-string }]] Parameter :: [direction] name : type-expression [multiplicity] [= default-value] [{ property-string }] OOSD--fall'04 Copyright by jubo@cs.umu.se 37 Dependency Dependencies define a usage relationship A change in the used thing may affect things that use it Dependencies can have names (there is a set of predefined dependency keywords stereotypes) VideoClip name play( on: Channel) start() stop() rewind() <<use>> Channel Association 1 Associations specify structural relationships It specifies that objects are interconnected Associations can be navigated in both directions (default) Associations are quite similar to the relationships known from ER modelling Associations have cardinalities Associated classes may have roles Company * Works-for 1..* employer employee Person OOSD--fall'04 Copyright by jubo@cs.umu.se 38 OOSD--fall'04 Copyright by jubo@cs.umu.se 39

Association 2 Associations may have attributes and behaviour (association classes) Association classes are quite similar to the relationship types known from ER modelling Association names may have reading directions Aggregation and Composition Aggregation and composition are specific associations They denote the part-of or has relationship Composition is the stronger form Parts are not shared Parts are existence dependent on the whole Company * Works-for 1..* employer employee Person Aggregation 1 Polygon 1 Composition Job salary worker * boss 0..1 Manages Point 3..* 1 Graphics color Texture OOSD--fall'04 Copyright by jubo@cs.umu.se 40 OOSD--fall'04 Copyright by jubo@cs.umu.se 41 Generalisation Generalisation specifies the is-a relationship It is the strongest relationship between classes Subclasses inherit properties from superclasses Shown as class hierarchies Also known as specialisation or inheritance Person Notes, Constraints, Qualifiers, and Interfaces BankAccount balance compare () Responsibilities: -- keep current balance -- handle deposits and withdrawals {> 0} {or} CID PersNr Corporation Person gender: {female, male} wife 0..1 husband 0..1 Student Employee Sortable Notes, like this one can be attached to any notational element {self.wife.gender = #female and self.husband.gender = #male} A constraint written in OCL (Object Constraint Language) Mentor Manager OOSD--fall'04 Copyright by jubo@cs.umu.se 42 OOSD--fall'04 Copyright by jubo@cs.umu.se 43

Some Guidelines for Class Diagrams Keep the analysis model simple Many simple classes are better than a few complex ones Use meaningful and familiar names Avoid god classes, behaviour should be distributed among classes Use multiple inheritance very sparely Try to avoid the too general dependency Associate methods with the providers of a service, i.e. the responsible classes Name all associations Document your model carefully Sequence Diagrams Graphical notation for scenarios Describe how objects collaborate to provide a service Good tool to uncover missing behaviour and/or missing objects/classes Very useful to document CRC role-plays Sequence diagrams OIDs (see [OOTC 97]) Collaboration diagrams are semantically equivalent, but focus on structural relationships between objects OOSD--fall'04 Copyright by jubo@cs.umu.se 44 OOSD--fall'04 Copyright by jubo@cs.umu.se 45 Sequence Diagram Example Sequence Diagram Details add a course time :Registrar 1: enter id 3: create course 4: enter course info 5: submit 8: close form Course Maintenance Form 2: verify id 6: create 7: save tdbc18: Course The lifeline of the object An activation bar Provide lots of annotations Comments (script text) Object creation and deletion Message return Conditional messages and Iteration... Supports notations for concurrency Timing and activation Asynchronous messages Quite some changes in UML2.0 OOSD--fall'04 Copyright by jubo@cs.umu.se 46 OOSD--fall'04 Copyright by jubo@cs.umu.se 47

Some Guidelines for Sequence Diagrams Keep the analysis scenarios simple (do not overspecify your OIDs) Analysis scenarios should usually be initiated by an actor Discriminate instances of the same class Make all assumption clear, use pre- and postconditions Concentrate on the major scenarios Manage consistency between use cases, scenarios/oids, and class diagrams Focus on general behaviour, do not implement methods too early (in UML2.0 you could actually do that) The GSS Case Study Continued 1 Assign a judge to an event An event has a judging panels assigned to it The judging panel consists of qualified scorers for this event How could this work? :League_Official assign( thejudge) success theevent is_assigned is_qualified( theevent) addjudge( thejudge) thejudge [is_assigned == `false and is_qualified == `true ] is_qualified( theevent, thejudge) Shouldn't there be a third party to decide on that???? OOSD--fall'04 Copyright by jubo@cs.umu.se 48 OOSD--fall'04 Copyright by jubo@cs.umu.se 49 The GSS Case Study Continued 2 Alternative 1: Let Event handle qualified scorers Make Event an abstract class Defer determination of qualified scorers to specific event classes Competition 5 Judge is_assigned( ): boolean 1 * Judging Panel 1..n Event {abstract} assign( Judge) is_qualified( Judge) BalanceBeam Floor Vault The GSS Case Study Continued 3 Alternative 2..n: Try to give other existing classes this responsibility League Equipment... Define a special purpose class Find out where this responsibility lies in the real world OOSD--fall'04 Copyright by jubo@cs.umu.se 50 OOSD--fall'04 Copyright by jubo@cs.umu.se 51

Statechart Diagrams 1 Graphical notation for class behaviour modelling Describe all possible states and state changes triggered by external stimuli Good tool to describe complex object life cycles Good tool to uncover missing state information and behaviour start An internal transition A deferred event <state name> <attribute list> entry / <action> exit / <action> do / <action> <event> / <action> <event> / defer event trigger [guard condition]/ action if event then if condition then trigger transition; execute action else nothing happens; <state name> stop Statechart Diagrams 2 States can be nested Substates may be concurrent Transitions may have multiple sources and/or destinations Basically unchanged in UML2.0 OOSD--fall'04 Copyright by jubo@cs.umu.se 52 OOSD--fall'04 Copyright by jubo@cs.umu.se 53 Some Guidelines for Statechart Diagrams Use STDs when there is (complex) state- dependent behaviour Use STDs when you are not sure when things can (are allowed to) happen Ensure that all events are covered Ensure that all states are reachable Ensure that all states can be exited Ensure that all transitions can be triggered Check each pair of states for missing transactions Check consistency with other models Contents Introduction Object-Oriented Software Development Project Management Requirements Gathering (G)UI Design Object-Oriented Analysis and Design Advanced Topics in OOA&D Implementation and Testing References OOSD--fall'04 Copyright by jubo@cs.umu.se 54 OOSD--fall'04 Copyright by jubo@cs.umu.se 61

Implementation and Testing REMEMBER: This no programming course. We assume you already know something about this topic from earlier courses. Some links are available from the course web page. OOSD--fall'04 Copyright by jubo@cs.umu.se 62