Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
m Objects
m A value is a piece of data.
m An attribute is a named property of a class that
describes a value held by each object of the class.
m Object is to class as value is to attribute.
m Name, Birthdate and weight are attributes of
person.
m Color, modelYear and weight are attributes of Car
objects.
m Each attributes has a value for each object.
m Class with Attributes
name:string
birthdate:date
name:string color
birthdate:date position
name= ³Joe Smith´
name= ³GE´
birthdate= 21 oct 1983
u
name
name
birthdate
m For example, a person u a company.
m The links of an association connect objects from
the same classes.
m An association describes a set of potential links in
the same way that a class describes a set of
potential objects.
m The UML notation for a link is a line between
objects. If the link has a name, it is underlined.
m An association connects related classes and is
also denoted by a line.
m Show link and association names in italics.
m Multiplicity specifies the number of instances of
one class that may relate to a single instance of
an associated class.
m UML diagrams explicitly list multiplicity at the ends
of association lines.
m The UML specifies multiplicity with an interval
such as
m 1 (exactly one)
m 1..* (one or more) or 3..5 (three to five)
m * (many, zero or more).
1 1
name name
name=³India´ name=³Delhi´
à 1
name name
Rà 6[
name=³Ram´ name=³ANSIC´
à
6
name=³Syam´ name=³OODA´
à
name=³Laxman´ name=³CN´
name name
name=³John´ name=³GE´
name=³Mary´ name=³LG´
6
name=³Alice´
m For each association there is at most one link
between a given pair of objects.
6
66 aB:B
m If you want two links between the same objects,
you must have two associations.
6
66