Wednesday, August 4, 2010

UML - class diagram

All text are from: http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/


Class

  • name
  • attributes
  • operations


Inheritance

  1. class
  2. interface
a) class
 
The class BankAccount is abstract class and the method: withdrawal is abstract. Notice the italicized text. You can use stereotype abstract too.


b) interface
 

Asociation

  1. Bi-directional
  2. Uni-directional
a) Bi-directional
 


b) Uni-directional




Association class
In modeling an association, there are times when you need to include another class because it includes valuable information about the relationship. For this you would use an association class that you tie to the primary association. An association class is represented like a normal class.
 

Aggregation
An association with an aggregation relationship indicates that one class is a part of another class. In an aggregation relationship, the child class instance can outlive its parent class.
 


Composition
Because the relationship is a composition relationship, when the Company instance is removed/destroyed, the Department instance is automatically removed/destroyed as well. Another important feature of composition aggregation is that the part class can only be related to one instance of the parent class.
 


Reflexive association
A class can also be associated with itself, using a reflexive association.
 


Visibility

MarkVisibility type
+Public
#    Protected
-    Private
~Package


Multiplicity

IndicatorMeaning
0..1    Zero or one
1One only
0..*Zero or more
*    Zero or more
1..*One or more
3Three only
0..5Zero to Five
5..15    Five to Fifteen

No comments:

Post a Comment