- Last Updated on 19 February 2011
- Written by Administrator
- Hits: 1412
A class has a name, fields and operations
A class is NOT an object, objects are instances of classes
Each field or method has a visibility: public, protected, private or package internal
Expresses: "Class A has a relationship with Class B"
An association might be directed and/or have a multiplicity/cardinality
Expresses: "The whole "comprises" the parts", "The parts "belong to" the whole"
Destroying the "whole" does not destroy the parts
The parts may be shared with other classes
Expresses: "The whole "has"/"contains" the parts", "The parts "are member of" the whole"
The parts are destroyed along with the "whole"
A composition is an aggregation and
Note about association/aggregation/composition
An aggregation and a composition are both more specific cases of an association
A composition is a strong relationship of the parts to the whole, if the parts can live without the whole, use an aggregation
Expresses: "The derived class "is a" base class"
The base class generalizes/abstracts the derived classes
Derived classes specialize/extend the base class
Expresses: "The derived class "behaves like" the interface"
The interface is a specification/contract/behaviour for the class
The classe implements the behaviour of the interface
Use case diagrams
Actually a role taken on by some actor
Actions accessible to specific actors
The rules for associations are similar to the ones of class diagrams