Unified Modeling Language (UML)

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
CIT731: Database Development Object Oriented Modeling (OOM)
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Object-Oriented Analysis and Design
Objects and Classes OO model an approximate interpretation of real world – Objects represent real world entities which have identities, states and behaviors.
Software Engineering COMP 201
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Systems Analysis and Design in a Changing World, Fourth Edition
UML – Class Diagrams.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
© Copyright Eliyahu Brutman Programming Techniques Course.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
1 Object-Oriented Modeling Using UML CS 3331 Fall 2009.
Unified Modeling Language
Object-Oriented Analysis and Design
Chapter 7: The Object-Oriented Approach to Requirements
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
CS 360 Lecture 6.  A model is a simplification of reality  We build models to better understand the system being developed.  We build models of complex.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
Object-Oriented Modeling Using Modified Modeling Language (UML)
Object-Oriented Modeling Using Modified Modeling Language (UML)
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
An Introduction to the Unified Modeling Language
M Taimoor Khan Sequence Diagrams Illustrates how objects interacts with each other. Emphasizes time ordering of messages.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Systems Analysis and Design in a Changing World, Fourth Edition
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Object Oriented Analysis and Design Using the UML
Chapter 3: Introducing the UML
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Basic Characteristics of Object-Oriented Systems
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.
Unified Modeling Language. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems,
Project 2: Phase 1 Submission 7 Late submissions 10% 10 No submissions 14% Better than project 1 phase 3 submissions 10-point bonus: If you catch the deadline.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Systems Analysis and Design in a Changing World, Fourth Edition
Appendix 3 Object-Oriented Analysis and Design
Unified Modeling Language (UML)
UML Diagrams By Daniel Damaris Novarianto S..
The Movement To Objects
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Unified Modeling Language
UML Diagrams Jung Woo.
Software Architecture & Design Pattern
Object Oriented Analysis and Design
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Unified Modelling Language
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Presentation transcript:

Unified Modeling Language (UML)

What is a Model? A model is a simplification of reality. A model may provide blueprints of a system Organization of the system Dynamic of the system

Why We Model Model is built to Communicate the desired structure and behavior of the system Visualize and control the system’s architecture Better understand the system that being built Manage risk Expose opportunities for simplification and reuse

Why We Model We build models so that we can see and better understand the system we are developing.

Importance of Modeling Models help us to visualize a system as it is or as we want it to be. to specify the structure or behavior of a system. in providing a template that guides us in constructing a system. in providing documenting the decisions we have made.

Objected-Oriented Modeling Two most common ways in modeling software systems are Algorithmic Procedures or functions Object oriented Objects or classes

What is UML? Stands for Unified Modeling Language UML is a language for Visualizing Specifying Constructing Documenting

1. Class Diagram A class diagram describes the types of objects in the system and the various kinds of static relationships that exist among them A graphical representation of a static view on static elements A central modeling technique that is based on object-oriented principles

Objects and Classes Interpretation in the Real World Interpretation in the Model Object An object is a thing that can be distinctly identified. An object has an identity, a state, and a behavior. Class A class represents a set of objects with similar characteristics and behavior. This objects are called the instances of the class. A class characterizes the structure of states and behaviors that are shared by all instances.

Objects Each of object has a unique identity. The state of an object is composed of a set of fields (data fields), or attributes. Each field has a name, a type, and a value. Behaviors are defined by methods. Each method has a name, a type, and a value. Each method may or may not return a value. Features are a combination of the state and the behavior of the object.

Classes A class defines a template for creating or instantiating its instances or objects. A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics.

Classes A class defines -- the names and types of all fields the names, types, implementations of all methods The values of the fields are not defined or fixed in the class definition. Each instance of the class has its own state. Different instances of the class may have different states. The implementations of methods are defined in the class definition and fixed for a given object.

Example Class name: Point class Point { Fields: x, y int x, y; Method: move public void move (int dx, int dy){ // implementation }

UML Notation for Classes ClassName The top compartment shows the class name. field1 … fieldn The middle compartment contains the declarations of the fields of the class. method1 methodm The bottom compartment contains the declarations of the methods

Field Declaration The name of the field is required in the field declaration. Field declaration may include: [Visibility][Type]Name[[Multiplicity]][=InitialValue] [Visibility]Name[[Multiplicity]][:Type][=InitialValue] Visibility or accessibility defines the scope: Public -- the feature is accessible to any class Protected -- the feature is accessible to the class itself, all the classes in the same package, and all its subclasses. Package -- the feature is accessible to the class itself and all classes in the same package. Private -- the feature is only accessible within the class itself.

Visibility syntax in Java and UML Visibilty Java Syntax UML Syntax public + protected # package ~ private -

Examples Java Syntax UML Syntax Date birthday Birthday:Date Public int duration = 100 +duration:int = 100 Private Student students[0..MAX_Size] -students[0..MAX_Size]:Student

Method Declaration The name of the method is required in the method declaration. Method declaration may include: [Visibility][Type]Name([Parameter, ...]) [Visibility]Name([Parameter, ...])[:Type] Each parameter of a method can be specified by -- Type Name

Examples Java Syntax UML Syntax void move(int dx, int dy) public int getSize() +int getSize()

Example Point private int x private int y public void move(int dx,int dy) Point -x:int -y:int +move(dx:int,dy:int) Point x y move()

UML Notation for Object ObjectName : ClassName The top compartment shows the object name and its class. field1 = value1 … fieldn = valuen The bottom compartment contains a list of the fields and their values. objectName -- objectName whose class is of no interest :ClassName -- anonymous object of ClassName which can be identify only through its relationship with other object.

Examples P1:Point Point p1 = new Point(); x = 0 y = 0 p1.x = 0; P1.y = 0; P1:Point Point p1 = new Point(); x = 24 y = 40 p1.x = 24; P1.y = 40;

Message Passing or Method Invocation Objects communicate with one another through message passing. A message represent a command sent to an object -- recipient A message consists of the receiving object, the method to be invoked and the arguments to method.

Example p1.move(10,20) Recipient p1 Method move() Arguments (10,20)

Modeling Relationships and Structures A class diagram consists of A set of nodes that represent classes and interfaces A set of links represent relationships among classes Class diagrams can be used to model: Inheritance -- extension and implementation Association -- aggregation and compostion Dependency

Inheritance Define a relationship among classes and interfaces Inheritance model -- the is-a(n) relationship

Example

Association Association represents binary relationship between classes * enroll * Student Course advisee * * teach 1 1 Faculty adviser

Aggregation and Compositon Aggregation is a special form of association Has-a or part-whole relationship Composition is a stronger form of aggregation

Example 1 1 1 * * * 1 1 Chairman-of Member-of 1 1..* University College Department Student 1 1 Chairman-of Member-of 1 1..* Faculty

Dependency Dependency is a relationship between entities such that the proper operation of one entity depends on the presence of the other entity, and changes in one entity would affect the other entity.

Example

2. Sequence diagram Depict object interaction by highlighting the time ordering of method invocation

Example

Object Object naming: syntax: [instanceName][:className] Name classes consistently with your class diagram (same classes). Include instance names when objects are referred to in messages or when several objects of the same type exist in the diagram. The Life-Line represents the object’s life during the interaction

Messages An interaction between two objects is performed as a message sent from one object to another A message is represented by an arrow between the life lines of two objects.

Return Values Optionally indicated using a dashed arrow with a label indicating the return value.

Object Creation An object may create another object via a <<create>> message.

Object Destruction An object may destroy another object via a <<destroy>> message. An object may destroy itself. Avoid modeling object destruction unless memory management is critical. :A :B <<destroy>>

Control information Condition Iteration syntax: ‘[‘ expression ’]’ message-label The message is sent only if the condition is true example: Iteration syntax: * [ ‘[‘ expression ‘]’ ] message-label The message is sent many times to possibly multiple receiver objects. [ok] borrow(member)

3. Use Case Diagram Use cases describes the externally observable behavior of system functions in the form of interactions between the system to be developed and the external entities -- Actors. Actors may represent roles played by users of the system or other systems. Consist of a name and scenarios One of scenarios is the main scenario

Use Case Diagram Consist of: Use cases Actors Relationships among actors and use cases

Extension relationships among actors

Dependency relationships among use cases

Case Study: An E-Bookstore