Chapter 18: Refining Analysis Relationships

Slides:



Advertisements
Similar presentations
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Advertisements

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426/CPE 426 Senior Projects University of Nevada, Reno.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] February 12, 2009.
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
Chapter 5: Advanced Use Case Modeling [Arlow and Neustadt, 2005] CS 426/CPE 426 Senior Projects University of Nevada, Reno Department of Computer Science.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
1 ODB Design: Handling Associations and Inheritance in ODL M. Akhtar Ali School of Informatics.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
What is UML? What is UP? [Arlow and Neustadt, 2005] January 23, 2014
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.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Lab 04.
Distributed Java Programming Distributed Java Programming Class #2 August 22, 2002.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Domain Modeling Part2: Domain Class Diagram Chapter 4 pp part 2 1.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Chapter 16 Applying UML and Patterns Craig Larman
1 Advanced Software Architecture Muhammad Bilal Bashir PhD Scholar (Computer Science) Mohammad Ali Jinnah University.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML Class Diagrams.
Chapter 4: Use Case Modeling [Arlow and Neustadt, 2005] CS 790M Project preparation (II) University of Nevada, Reno Department of Computer Science & Engineering.
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Relationships between classes Using UML
Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
1 ODB Design Handling Inheritance in ODL M. Akhtar Ali School of Informatics.
Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,
ER Diagrams ● Many different notations are available ● From wikipedia:wikipedia: Entity-relationship modelwikipedia: Entity-relationship model ● How do.
Data Modeling Using the Entity- Relationship (ER) Model
Modeling with UML – Class Diagrams
Class Relationships in C++
Object-Orientated Analysis, Design and Programming
Object-Oriented Modeling
Entity- Relationship (ER) Model
Enhanced Entity-Relationship and Object Modeling Objectives
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Chapter 16 UML Class Diagrams.
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
EKT472: Object Oriented Programming
Entity-Relationship Model
UML Class & Object Diagram II
Chapter 19: Interfaces and Components
UML Class Diagrams: Basic Concepts
Object Oriented Analysis and Design
CS 426 Senior Projects Chapter 9: Relationships
Domain Class Diagram Chapter 4 Part 2 pp
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
Chapter 5: Advanced Use Case Modeling
UML Class Diagram.
Chapter 4: Use Case Modeling
Chapter 20 Object-Oriented Analysis and Design
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
Appendix A Object-Oriented Analysis and Design
Unified Modelling Language
Understand and Use Object Oriented Methods
ODB Design: Handling Associations and Inheritance in ODL
Chapter 19: Interfaces and Components
Chapter 19: Interfaces and Components
Copyright 2007 Oxford Consulting, Ltd
Chapter 4: Use Case Modeling
Chapter 7: Entity-Relationship Model
Object Oriented System Design Class Diagrams
Interfaces and Components
Appendix A Object-Oriented Analysis and Design
Enhanced Entity-Relationship (EER) Modeling
Appendix A Object-Oriented Analysis and Design
Chapter 19: Interfaces and Components
Chapter 11: Class Diagram
Presentation transcript:

Chapter 18: Refining Analysis Relationships CS 426 Senior Projects in Computer Science Chapter 18: Refining Analysis Relationships [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering

Outline Design relationships Aggregation and composition How to refine analysis relationships One-to-one associations Many-to-one associations and One-to-many associations Collections Reified relationships

Design relationships Refining analysis relationships into design relationships involves: Refining associations to aggregations or compositions Implementing one-to-many associations Implementing many-to-one associations Implementing many-to-many associations Implementing bidirectional associations Implementing association classes

Design associations Design associations must have Navigability Multiplicity on both ends Design associations should have An association name A role name on at least the target end

Aggregation and composition Aggregation is a “whole-part” relationship Composition is a stronger type of aggregation (no sharing of parts; parts are destroyed when the assembly is destroyed)

Aggregation semantics The aggregate can sometimes exist independently of parts, sometimes not The parts can exist independently of the aggregate The aggregate is incomplete if some parts are missing It is possible to share parts among several aggregates

Aggregation semantics Aggregation is transitive Aggregation is asymmetric

Aggregation semantics However, association is symmetric

Aggregation semantics Another example of aggregation

Composition semantics The parts cannot be shared with any other aggregate The composite has sole responsibility for the disposition of its parts The composite may release parts, if responsibility for them is given to another composite If the composite is destroyed, it must destroy all its parts

Composition and attributes A part in a composite is equivalent with an attribute Why is necessary to use two ways to express the same thing? Attributes may be primitive data types (e.g., int, double) Utility classes are better modeled as attributes (e.g., Time, Date, String)

Refining analysis relationships Refining associations into aggregations or compositions: Add multiplicities and role names to the association Decide which side is a whole and which is a part If multiplicity at the whole is 1, then you may be able to use composition, otherwise it must be aggregation Add navigability from the whole to the part (design associations must be unidirectional)

One-to-one associations 1-to-1 associations almost always are compositions

One-to-one associations 1-to-1 associations can also be modeled using attributes

Many-to-one associations If there are no cycles in the aggregation graph, aggregations can be used

One-to-many associations There is a collection of objects on the part side of the relationship Use either native support for collection, or use collection classes (more flexible and powerful)

Collection classes A collection class is a class whose instances specialize in managing collections of other objects They 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

Collection classes Example of using collections:

Collection classes - strategies Four strategies for software modeling with collections: Model the class explicitly (see previous slide) Use tagged values to inform the modeling tool about implementation Use properties to specify semantics, but don’t specify implementation Do not refine one-to-many relationships to collections (leave it up to the programmers)

Collection classes Standard UML properties for collections:

Collection classes UML types of collections:

Collection classes: the maps Maps are optimized to quickly return a value, given a key Use notation {map, key}

Reified relationships Some types of relationships are pure analysis artifacts and need to be reified (reification = to make concrete, or real) The following analysis relationships need to be reified: Many-to-many associations Bidirectional associations Association classes

Reified relationships: Many-to-Many Decide which side is the whole and use aggregation or composition as appropriate Example: allocation association reified into Allocation class

Reified relationships: Bidirectional Bidirectional relationships are fine in analysis However, in design they must be reified due to lack of implementation support

Reified relationships: Association classes Association classes are purely analysis artifacts