12.07.2015 Views

DEV475 Mastering Object-Oriented Analysis and Design with UML ...

DEV475 Mastering Object-Oriented Analysis and Design with UML ...

DEV475 Mastering Object-Oriented Analysis and Design with UML ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Module 2 - Concepts of <strong>Object</strong> OrientationWhat Is Multiplicity?What Is Multiplicity?• Multiplicity is the number of instances one classrelates to ONE instance of another class.• For each association, there are two multiplicitydecisions to make, one for each end of theassociation.• For each instance of Professor, many CourseOfferings may be taught.• For each instance of Course Offering, there may beeither one or zero Professor as the instructor.Professor+ instructor0..1 0..*CourseOffering<strong>Mastering</strong> <strong>Object</strong> <strong>Oriented</strong> <strong>Analysis</strong> <strong>and</strong> <strong>Design</strong> <strong>with</strong> <strong>UML</strong>Copyright © 2003 Rational Software, all rights reserved 39Multiplicity can be defined as:The number of instances of one class that relate to one instance of another class.• For each role, you can specify the multiplicity of its class <strong>and</strong> how many objectsof the class can be associated <strong>with</strong> one object of the other class.• Multiplicity is indicated by a text expression on the role. The expression is acomma-separated list of integer ranges.• It is important to remember that multiplicity is referring to instances of classes(objects) <strong>and</strong> their relationships. In this example, a Course Offering object canhave either zero or one Professor object related to it. Conversely, a Professorobject can have zero or more Course Offering objects related to it.• Multiplicity must be defined on both ends of the association.2 - 39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!