Refining Analysis Relationships-Object-Oriented Design-Lecture 17 Slides-Computer Engineering, Slides of Object Oriented Analysis and Design

Refining Analysis Relationships, Aggregation Relationship, Aggregation, Composition, Many-to-One Association, One-to-Many Association, Collections, Modeling with Collections, Reifying Analysis Relationships, Structured Classifier, Structured Class, Raman Ramsin, Lecture Slides, Object Oriented Design, Department of Computer Engineering, Sharif University of Technology, Iran.

Typology: Slides

2011/2012

Uploaded on 02/19/2012

hester
hester 🇮🇷

4.5

(13)

84 documents

1 / 27

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Department of Computer Engineering 1 Sharif University of Technology
Object-Oriented Design
Lecturer: Raman Ramsin
Lecture 17:
Refining Analysis Relationships
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Refining Analysis Relationships-Object-Oriented Design-Lecture 17 Slides-Computer Engineering and more Slides Object Oriented Analysis and Design in PDF only on Docsity!

Department of Computer Engineering

Sharif University of Technology

Object-Oriented Design

Lecturer: Raman Ramsin

Lecture 17 :

Refining Analysis Relationships

Department of Computer Engineering

Sharif University of Technology

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.

Department of Computer Engineering

Sharif University of Technology

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.

Department of Computer Engineering

Sharif University of Technology

Aggregation and Composition  There are two types of aggregation relationship:  Aggregation ;  Composition Aggregation - usually referred to simply as Composition.

Department of Computer Engineering

Sharif University of Technology

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.

Department of Computer Engineering

Sharif University of Technology

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.

Department of Computer Engineering

Sharif University of Technology

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).

Department of Computer Engineering

Sharif University of Technology

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.

Department of Computer Engineering

Sharif University of Technology

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;

Department of Computer Engineering

Sharif University of Technology

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;

Department of Computer Engineering

Sharif University of Technology

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;

Department of Computer Engineering

Sharif University of Technology

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;
  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.

Department of Computer Engineering

Sharif University of Technology

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

Department of Computer Engineering

Sharif University of Technology

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.