Object-Oriented Modeling with UML

Slides:



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

UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Unified Modeling Language
2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang Assistant Professor.
Kari R. Schougaard, PhD Stud. Værktøjer og Teknikker, 2006 UNIVERSITY OF AARHUS Department of Computer Science Unified Modeling Language Visual language.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Itntroduction to UML, page 1 Introduction to UML.
Chapter 4: Object-Oriented Data Modeling
UML and Object Oriented Concepts
Structural Modeling: Class Diagrams Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2005 Pearson Education Copyright © 2009 Kannan Mohan CIS 4800.
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Introduction to the Unified Modeling Language “The act of drawing a diagram does not constitute analysis or design. … Still, having a well-defined and.
Introduction to UML By: Prof. Aiman Hanna Department of Computer Science, Concordia University, Montreal, Canada.
Slide 1 UML Review Chapter 2: Introduction to Object-Oriented Systems Analysis and Design with the Unified Modeling Language, Version 2.0 Alan Dennis,
Unified Modeling Language, Version 2.0
Software development process ธนวัฒน์ แซ่ เอียบ. The development process Process –set of rules which define how a development project. Methodology and.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
16 August, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 7 Unified Modeling Language.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
An Introduction to the Unified Modeling Language
 What is Modeling What is Modeling  Why do we Model Why do we Model  Models in OMT Models in OMT  Principles of Modeling Principles of Modeling 
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
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.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Unified OO becomes commonly used in the late 1980s Various analysis and design methods The “three amigos” join forces in Rational Software Also include.
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
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.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
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.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Introduction to UML.
Unified Modeling Language (UML)
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Introduction to the Unified Modeling Language
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Systems Analysis and Design With UML 2
Introduction to Unified Modeling Language (UML)
Introduction to Unified Modeling Language (UML)
Software Modeling Lecture # 11.
Systems Analysis and Design With UML 2
University of Central Florida COP 3330 Object Oriented Programming
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Software Architecture & Design Pattern
Introduction to Unified Modeling Language (UML)
UML Class Diagrams: Basic Concepts
Object Oriented Analysis and Design
The Unified Modeling Language
Object Oriented Analysis and Design
Software Engineering Lecture #11.
Introduction to Unified Modeling Language (UML)
Introduction to UML.
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Introduction to the Unified Modeling Language
Understand and Use Object Oriented Methods
Dynamic Modeling Lecture # 37.
Copyright 2007 Oxford Consulting, Ltd
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
Presentation transcript:

Object-Oriented Modeling with UML Lecture # 30

Object-Oriented Modeling Methods Shlaer/Mellor - 1988 Coad/Yourdon – 1991 Booch - 1991 OMT by Rumbaugh et. al. – 1991 Wirfs-Brock – 1991 And many more

Unification Effort 1994 key researchers Grady Booch, James Rambaugh, and Ivar Jacobson joined hands to unify their respective methodologies In 1997 Object Management Group (OMG) finally approved the Unified Modeling Language (UML)

Unified Modeling Language - 1 Visualizing, specifying, constructing, and documenting object-oriented systems is exactly the purpose of the unified modeling language or UML The rules of UML focus on the conceptual and physical representation of a system

Unified Modeling Language - 2 Process independent Notation has well-defined semantics It has become the de-facto standard for modeling Many vendors provide tools that support different modeling views

Unified Modeling Language - 3 UML provides a very rich set of concept areas Static structure Dynamic behavior Implementation constructs Model organization Extensibility mechanisms

Static Structure - 1 Any precise model must first define the universe of discourse, that is, the key concepts from the application, their internal properties, and their relationships to each other This set of constructs is the static view

Static Structure - 2 The application concepts are modeled as classes, each of which describes a set of discrete objects that hold information and communicate to implement behavior The information they hold is modeled as attributes; the behavior they perform is modeled as operations

UML Notation for Classes Window Window origin size Window origin size open() close() move() display()

Objects and Classes An object is an instantiation of a class It has an identity, state, and behavior

UML Notation for Objects aObject bObject : Class :Class

Relationships Between Objects - 1 A relationship is a connection among things. In object-oriented modeling, the three most important relationships are dependencies, generalizations, and associations Graphically, a relationship is rendered as a path, with different kinds of lines used to distinguish the kinds of relationships

Relationships Between Objects - 2 Dependencies, generalizations, and associations are all static things defined at the level of classes In the UML, these relationships are usually visualized in class diagrams These relationships convey the most important semantics in an object-oriented model

Dependency Relationship A dependency is a using relationship that states that a change in specification of one thing may affect another thing that uses it, but not necessarily the reverse Graphically, a dependency is rendered as a dashed line, directed to the thing being depended on Use dependencies when you want to show one thing using another thing

Dependency Relationship FilmClip name playOne(c:Channel) start() stop() reset() Channel

Generalization Relationship A generalization is a relationship between a general thing (called a super class or parent) and a more specific kind of that thing (called the subclass or child) Generalization is sometimes called an ‘is-a-kind-of’ relationship

Generalization Relationship Shape origin move() resize() display() Rectangle Circle Polygon corner: Point radius: Float points: List display()

Association Relationship - 1 An association is a structural relationship that specifies that objects of one thing are connected to objects of another. Given an association connecting two classes, you can navigate from an object of one class to an object of the other class, and vice versa Graphically, an association is rendered as a solid line connecting the same of different classes

Association Relationship - 2 Use associations when you want to show structural relationships An association can have four adornments Name Role Multiplicity Aggregation Captures the ‘whole-part’ relationship Composition – a stronger ‘whole-part’ relationship

Association Relationship: Name Works for Person Company Association Names

Association Relationship: Role Person Company employee employer Roles

Association Relationship: Multiplicity 1..* * Person Company employee employer Multiplicity

Association Relationship: Aggregation Company 1 * Department Aggregation

Association Relationship: Composition Company Department Composition

Hints and Tips - 1 Use dependencies only when the relationships you are modeling are not structural Use generalization only when you have ‘is-a-kind-of’ relationship; multiple inheritance can often be replaced with aggregation

Hints and Tips - 2 Keep your generalization relationships generally balanced; inheritance latices should not be too deep (more than five levels or so should be questioned) nor too wide (instead, look for the possibility of intermediate abstract classes)

Hints and Tips - 3 Beware of introducing cyclical generalization relationships Use associations primarily where there are structural relationships among objects

Class Inheritance and Object Composition

Class Inheritance: Advantages Class inheritance is defined statically at compile-time Class inheritance is straightforward to use, as it is supported directly by object-oriented programming languages Class inheritance makes it easy to modify the implementation being reused

Class Inheritance: Disadvantages - 1 You cannot change the implementations inherited from parent class at run-time, because inheritance is defined at compile-time Parent classes often define at least part of their subclasses’ physical representation. Any change in the parent’s implementation will force the subclass to change

Class Inheritance: Disadvantages - 2 Inheritance breaks encapsulation Implementation dependencies can cause problems when you’re trying to reuse a subclass

Object Composition: Advantages - 1 Object composition is defined dynamically at run-time through objects acquiring references to other objects Composition requires objects to respect each others’ interfaces, that requires you to carefully define interfaces of classes

Object Composition: Advantages - 2 Encapsulation is not broken Very few implementation dependencies

Object Composition: Advantages - 3 Object composition has a positive affect on the system design Classes are encapsulated and focused on one task Classes and class hierarchies will remain small There will be more objects than classes, and the system’s behavior will depend on their interrelationships instead of being defined in one class

Favor object composition over class inheritance

Summary We discussed Object-Oriented Modeling using UML We can model classes and objects in UML The relationships between classes can be modeled using UML notation The adornments can be added to the relationships among classes for modeling additional information about the relationships Object composition should be favored over class inheritance

References ‘The Unified Modeling Language User Guide’ by G. Booch, J. Rambaugh, & I. Jacobson, Addison-Wesley, 1998 ‘The Unified Modeling Language Reference Guide’ by J. Rambaugh, I. Jacobson, & G. Booch, Addison-Wesley, 1998 ‘Design Patterns: Elements of Reusable Object-Oriented Software’ by E. Gamma et. al., Addison-Wesley, 1994