0% found this document useful (0 votes)
110 views12 pages

Uml Advanced Classes

This document provides an overview of key concepts in UML class modeling, including classifiers, relationships, attributes, operations, and templates. It defines classifiers as modeling elements that can have instances, such as classes, instances, datatypes, signals, components, nodes, use cases, and subsystems. Relationships describe structural connections between classifiers. Attributes and operations have properties like visibility, scope, multiplicity, and parameters that define their behavior and accessibility. Templates allow defining generic classes that can be instantiated with specific types.

Uploaded by

Satish Varma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views12 pages

Uml Advanced Classes

This document provides an overview of key concepts in UML class modeling, including classifiers, relationships, attributes, operations, and templates. It defines classifiers as modeling elements that can have instances, such as classes, instances, datatypes, signals, components, nodes, use cases, and subsystems. Relationships describe structural connections between classifiers. Attributes and operations have properties like visibility, scope, multiplicity, and parameters that define their behavior and accessibility. Templates allow defining generic classes that can be instantiated with specific types.

Uploaded by

Satish Varma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

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

component node subsystem 4


Special properties of attributes and
operations
• Visibility
– Public[+]: any outside classifier with visibility to the given
classifier can use this feature.
– Protected[#]: any descendant of the classifier can use the
feature.
– Private[-]: only the classifier itself can use the feature.

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

Button concrete class


display() polymorphic operation

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

consolePort [2..*] : Port

8
Attributes
• The syntax of an attribute in the UML is
[ visibility ] name [ multiplicity ] [ : type ] [ = initial-value ] [ { property-string } ]

+ origin [0..1] : string = (0,0) {frozen}

• There are three defined properties


1. changeable : no restrictions on modifying the
attribute’s value
2. addOnly : additional value may be added for attributes
with a multiplicity > 1, but once created, a value may
not be removed or altered.
3. frozen : the attribute’s value may not be changed after9
object is initialized.
Operations
• The syntax of an operation in UML is
[ visibility ] name [ ( parameter-list ) ] [ : return-type ] [ { property-string } ]
[ direction ] name : type [ = default-value ]
in, out, inout : means parameter may be modified or not.

• There are five defined properties


1. leaf : may not be overridden <page 7>
2. isQuery : leave the state of subsystem unchanged.
3. sequential : only one flow is in the object at a time.
4. guarded : sequentializing all calls.
5. concurrent : treating the operation as atomic.
– 3. 4. 5. are for concurrence.
In Rational Rose
10
is Synchronize
• In: An input parameter; may not be
modified

• Out: An output parameter; may be


modified to communicate information to
the caller

• inout: An input parameter; may be


modified.

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

+bind(in i : Item, in v : Value) : Boolean


+isBound(in i : Item) : Boolean explicit binding
<<bind>> (Customer, Order, 3)
implicit binding

Map<Customer, Order, 3> OrderMap


12

You might also like