Uml Advanced Classes
Uml Advanced Classes
1
Outline
• What is “Classifier”
• Special properties of attributes and
operations and different kinds of classes
• What is “Relationship”
• Important relationships in UML
2
What is Classifier
• A classifier is a mechanism that describes
structural and behavioral features.
• In general, the modeling elements that can
have instances are called classifiers.
• Class, Instance, Datatype, Signal,
Component, Node, Use case, Subsystem
are classifiers. (packages are not.)
3
What is Classifier cont.
class use case datatype interface
Shape <<datatype>> IUnknow
Process loan Int
-origin
+move() signal
+resize() <<signal>>
+display() OffHook
egb_server <<subsystem>>
kernel32.dll Customer Service subsystem
Toolbar
public #currentSelection
protected
#toolCurrent
+pickItem()
+addTool()
+removeTool()
protected +getTool()
#checkOrphans()
private -compact() 5
Special properties of attributes and
operations
• Scope
– The owner scope of a feature specifies whether
the feature appears in each instance of the
classifier or whether there is just a single
instance of feature for all instances of the
classifier.
• instance : each instance holds its own value.
• classifier : just one value for all instances. [static]
Frame
instance scope
header : FrameHeader
class scope uniqueID : Long
6
Abstract, Root, Leaf and Polymorphic
Elements
Icon
{root} base class
Origin : Point
diaplay() abstract operation
getID() : Integer {leaf}
abstract class concrete operation
RectangularIcon ArbitraryIcon
height : Integer edge : LineCollection
width : Integer
isInside(p : Point) : Boolean abstract class
OKButton
{leaf}
7
display() leaf class
Multiplicity
• It’s reasonable to assume that there may
be any number of instances of classes.
• The number of instances a class may
have is called multiplicity.
singleton class multiplicity
NetworkController 1 ControlRod 3
8
Attributes
• The syntax of an attribute in the UML is
[ visibility ] name [ multiplicity ] [ : type ] [ = initial-value ] [ { property-string } ]
11
Template Classes
• Like template classes in C++ and Ada.
• Cannot use a template directly; you have to
instantiate it first. template parameters
template class
Item, Value, Buckets:int
Map