Thursday, January 11, 2007

UML Notes


  • Draw UML Diagrams
  • Interpret UML diagrams.
  • State the effect of encapsulation, inheritance, and use of interfaces on architectural characteristics.

UML 2 has two categories of diagrams:
1) Structure diagrams: Shows the static structure of the system being modeled. Example: Class, Component or object diagram.

2) Behavior diagrams: Shows the dynamic behavior between the objects of the systems, like there methods, collaboration and activities. Example activity, Use case and sequence diagrams.

Classifier: In general a classifier is a class but technically a classifier is a more general term that refers to a class, an interface, a data type and a component.

Class name
The UML representation of a class is a rectangle containing 3 compartments stacked vertically.

The attribute section has name: attribute type. The uml specification allows for default values in the attribute list. Ex balance: Dollars = 0.

The operations are documented as name(parameter list): return type Ex getArrivalTime():Date

The ability of one class to inherit the functionality of another class and then add new functionality of its own. This is denoted by a solid line with a closed, unfilled arrowhead pointing to the super class.

Five type of Association:
1) Uni-directional: This is indicated with a solid line arrow à. This case only one class knows about the other. Only one end has the assigned name and multiplicity value.
2) Bi-directional: This is indicated with a solid line connecting both classes with an assigned name and the multiplicity values at both ends.
3) Association class.
4) Aggregation: An associate with an aggregation relationship indicates that one class is part of another. They may be able to live dependently or not.
a. Basic Aggregation: This type the child class can outlive parent class, like the wheels can exist without a car.

b. Composite Aggregation. This is similar to the above diagram except that the diamond is filled. In this case the child class cannot live without the parent class. Ex classrooms cannot exist without school.

5) Reflexive Association. This is an association with the same class.

Packages are for organizing classes or classifier into a namespace. This is sort of folder like structure for the model. This is represented as a rectangle with a tab at the top-left. The classes included can be should inside a package or with a small circle with solid lines to each class.

Interface: This is considered to be a specialization of the class modeling element. It is represented exactly as a class with the top compartment having an additional text like this <>

A dotted line with an unfilled arrowhead means realization or implementation.
A solid line with a filled arrowhead means inheritance.

Public +
Protected #
Private -
Package ~

Added in UML 2
Internal Structure
The above notes are from developerworks

No comments:

Post a Comment