Object-Oriented Design

Similar documents
Object-Oriented Design

Object-Oriented Design

Object-Oriented Design

Object-Oriented Design

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

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

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

Object-Oriented Design

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

Unified Modeling Language (UML) Class Diagram

Introduction to Unified Modelling Language (UML)

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

SE 1: Software Requirements Specification and Analysis

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

Object-Oriented and Classical Software Engineering

Object Oriented Modeling

Data Warehouse and Data Mining

Unified Modeling Language (UML)

UML: Unified Modeling Language

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Scenario-based Synthesis of Annotated Class Diagrams in UML

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

LABORATORY 1 REVISION

Object-Oriented Design and Modeling Using the UML

UNIT V *********************************************************************************************

IS 0020 Program Design and Software Tools

NOTES ON OBJECT-ORIENTED MODELING AND DESIGN

Computer Science for Engineers

Graphical Notation for Topic Maps (GTM)

From Analysis to Design. LTOOD/OOAD Verified Software Systems

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

Introduction to Software Engineering. 5. Modeling Objects and Classes

Activities Radovan Cervenka

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

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

UNIT 5 - UML STATE DIAGRAMS AND MODELING

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

Chapter 8: Enhanced ER Model

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

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

Use of UML in Tranmodel

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

Software Service Engineering

Object-Oriented Design

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

Managing Change and Complexity

Chapter 2: Entity-Relationship Model

Part II Black-Box Composition Systems 10. Business Components in a Component-Based Development Process

Interactions A link message

Software Development Methodologies

UNIT-II Introduction to UML

Requirements & Domain Models. Lecture 13: Object Oriented Modelling. Nearly anything can be an object. Object Oriented Analysis

Software Development Methodologies

Object-Oriented Design

10.1 Big Objects, Business Objects, and UML Components

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

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model.

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

Lecture 17: (Architecture V)

Pattern for Structuring UML-Compatible Software Project Repositories

SEEM4570 System Design and Implementation. Lecture 10 UML

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak

System Structure Modeling

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Unified Modeling Language

JOURNAL OF OBJECT TECHNOLOGY

Object-Oriented Systems Development: Using the Unified Modeling Language

Software Engineering from a

Model Driven Development Unified Modeling Language (UML)

OO System Models Static Views

Software Design And Modeling BE 2015 (w. e. f Academic Year )

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

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 : ,

Accessibility. EEC 521: Software Engineering. Classes and Objects. Inheritance. Classes and Objects (OO Analysis)

SOFTWARE ENGINEERING Prof.N.L.Sarda Computer Science & Engineering IIT Bombay. Lecture #10 Process Modelling DFD, Function Decomp (Part 2)

Business Process Modelling

Lecture 34 SDLC Phases and UML Diagrams

Chapter 6: Entity-Relationship Model

Credit where Credit is Due. Last Lecture. Goals for this Lecture

Geog 469 GIS Workshop. System Requirements - Data

Chapter 11 Object and Object- Relational Databases

Learning objectives: Software Engineering. CSI1102: Introduction to Software Design. The Software Life Cycle. About Maintenance

Refining the Requirements Model

Unified Modeling Language (UML) and Modeling

Notation Part 1. Object Orientated Analysis and Design. Benjamin Kenwright

Component Design. Systems Engineering BSc Course. Budapest University of Technology and Economics Department of Measurement and Information Systems

Introduction to Software Engineering. 5. Modeling Objects and Classes

Engineering Design w/embedded Systems

CSCU9T4: Managing Information

OO Techniques & UML Class Diagrams

UML-Based Conceptual Modeling of Pattern-Bases

JOURNAL OF OBJECT TECHNOLOGY

Object-Oriented Design

The Essence of Object Oriented Programming with Java and UML. Chapter 2. The Essence of Objects. What Is an Object-Oriented System?

Object-Oriented Design

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Analysis and Design with the Universal Design Pattern

Transcription:

Object-Oriented Design Lecture 15: Refining Analysis Relationships Department of Computer Engineering Sharif University of Technology 1

Refining Analysis Relationships Relationships in analysis are converted to implementable design relationships. Refining analysis relationships to design relationships involves: adding navigability; adding multiplicity to both ends of the association; adding a role name at both ends of the association, or at least on the target end of the association; implementing one-to-one, one-to-many, many-to-one, and many-to-many associations; implementing bidirectional associations and association classes; using structured classifiers for modeling composition. Sharif University of Technology 2

Aggregation Relationship Whole-part relationship where objects of one class act as the whole or aggregate, and objects of the other class act as the parts; general semantics: Assembly, Containment, or Membership; can be used in analysis as well as design; the whole uses the services of the parts; the parts service the requests of the whole; the whole is the dominant, controlling side of the relationship; the part tends to be more passive; aggregation is transitive: If C is part of B and B is part of A, then C is part of A. Sharif University of Technology 3

Aggregation Relationship: Asymmetry Aggregation relationship is asymmetric: a whole can never directly or indirectly be a part of itself; there must never be a cycle in the aggregation graph. Sharif University of Technology 4

Aggregation Relationship: Asymmetry Aggregation relationship is asymmetric: a whole can never directly or indirectly be a part of itself; there must never be a cycle in the aggregation graph. Sharif University of Technology 5

Aggregation and Composition There are two types of aggregation relationship: Aggregation; Composition Aggregation - usually referred to simply as Composition. Sharif University of Technology 6

Aggregation: Semantics Aggregation is a weak Whole-Part relationship (like a computer system and its peripherals); The aggregate can sometimes exist independently of the parts, sometimes not; The parts may exist independently of the aggregate; It is possible to have shared ownership of the parts by several aggregates; Aggregation hierarchies and aggregation networks are possible; The whole always knows about the parts, but if the relationship is one-way from the whole to the part (which is typically the case), the parts don't know about the whole. Sharif University of Technology 7

Composition A strong form of aggregation (like a tree and its leaves): the parts belong to exactly one composite at a time; the composite has sole responsibility for the disposition of all its parts - this means responsibility for their creation and destruction; the composite may also release parts, provided responsibility for them is assumed by another object; if the composite is destroyed, it must destroy all its parts or give responsibility for them over to some other object; each part belongs to exactly one composite so you can only have composition hierarchies - composition networks are impossible. Sharif University of Technology 8

Refining Analysis Relationships: One-to-One Association Add navigability to the model; refine into Composition only if the semantics apply; you may also choose to merge the two classes. Sharif University of Technology 9

Refining Analysis Relationships: Many-to-One Association Add navigability; refine into Aggregation only if the semantics apply. Sharif University of Technology 10

Refining Analysis Relationships: One-to-Many Association There is a collection of objects on the target side: Use an inbuilt array (most OO languages directly support arrays) - they are generally quite inflexible but are usually fast. Use a collection class - they are more flexible than inbuilt arrays and are faster than arrays when searching the collection is required (otherwise they are slower). Sharif University of Technology 11

Collections Classes specialized so that their instances can manage a collection of other objects. All collection classes have operations for: adding objects to the collection; removing objects from the collection; retrieving a reference to an object in the collection; traversing the collection - stepping through the collection from the first object to the last. Sharif University of Technology 12

There are four options: Modeling with Collections 1.model the collection class explicitly; Sharif University of Technology 13

There are four options: Modeling with Collections 1.model the collection class explicitly; 2.tell the modeling tool which collection to use by adding a property to the relationship; Sharif University of Technology 14

Modeling with Collections There are four options: 1.model the collection class explicitly; 2.tell the modeling tool which collection to use by adding a property to the relationship; 3.tell the programmer what collection semantics are required by adding a property to the relationship; Sharif University of Technology 15

Modeling with Collections There are four options: 1.model the collection class explicitly; 2.tell the modeling tool which collection to use by adding a property to the relationship; 3.tell the programmer what collection semantics are required by adding a property to the relationship; Sharif University of Technology 16

Modeling with Collections There are four options: 1.model the collection class explicitly; 2.tell the modeling tool which collection to use by adding a property to the relationship; 3.tell the programmer what collection semantics are required by adding a property to the relationship; Sharif University of Technology 17

There are four options: Modeling with Collections 1.model the collection class explicitly; 2.tell the modeling tool which collection to use by adding a property to the relationship; 3.tell the programmer what collection semantics are required by adding a property to the relationship; 4.instead of refining one-to-many relationships to collection classes, leave it up to the programmers. Don't "overmodel" - the choice of a specific collection class is often a tactical issue that can be left to the programmer at implementation time. Sharif University of Technology 18

Modeling with Collections: The Map Also known as the dictionary; Given a key, the corresponding value may be found very quickly; Acts like a database table with two columns, the key and the value; Keys must be unique. Sharif University of Technology 19

Reifying Analysis Relationships Some relationships are pure analysis artifacts and must be made implementable by the process of reification: 1.Many-to-many associations 2.Bidirectional associations 3.Association classes Sharif University of Technology 20

Reifying Relationships: Many-to-Many Associations 1. Reify the relationship into a class. 2.Add navigability; Refine into Aggregation or Composition only if the semantics apply. Sharif University of Technology 21

Reifying Relationships: Bidirectional Associations Replace with two unidirectional associations or a reified class; refine into Aggregation or Composition only if the semantics apply. Sharif University of Technology 22

Reifying Relationships: Association Classes 1. Replace with a class (usually with the same name as the association class); 2.Add a constraint in a note to indicate that objects on each end of the reified relationship must form a unique pair. Sharif University of Technology 23

Structured Classifier A classifier (such as a class) that has an internal structure. Modeled as parts that are joined with connectors: part - a role that one or more instances of a classifier can play in the context of the structured classifier; name - the name of the part; type - the type of objects that can play the role; multiplicity - the number of objects that can play the role at any time; connector - a relationship between parts in the context of a structured classifier. Sharif University of Technology 24

Structured Classifier: Notation Sharif University of Technology 25

Structured Class A class that has an internal structure; Has the extra constraint that it owns (has an implicit containment relationship with) all of its parts, connectors, and ports. Sharif University of Technology 26

Structured Class: Modeling Internal structure can be shown on class diagrams or on a composite structure diagram. Sharif University of Technology 27

Structured Class: Modeling Car is shown as having a composition association with role name rear to a class Wheel role name e to a class Engine Any instance of class Engine can be linked to an arbitrary number of instances of class Wheel. Sharif University of Technology 28

Structured Class: Modeling rear and e belong to the internal structure of the class Car This allows specification of detail that holds only for instances of the Wheel and Engine classes within the context of the class Car within the context of class Car e may only be connected to two instances playing the role of rear instances playing the e and rear roles may only be linked if they are roles of the same instance of class Car. Sharif University of Technology 29

Reference Arlow, J., Neustadt, I., UML 2 and the Unified Process: Practical Object- Oriented Analysis and Design, 2 nd Ed. Addison-Wesley, 2005. Sharif University of Technology 30