Professional Documents
Culture Documents
CS/SWE 421
Introduction to Software Engineering
Dan Fleck
(Slides adapted from Dr. Stephen Clyde with permission)
Coming up: Introduction to
Objects
Introduction to Objects
Objects are the fundamental building blocks
of object-oriented systems
What is an object?
– It represents any “thing”
– It has a boundary in space and time
– It is an abstraction
– It encapsulates state and/or behavior
– It has identity
Course College
Class Semester Instructor
Section
Student
Class Department
Grade Major
Coming up: Three Perspectives
Three Perspectives
Objects and classes, as well as all other
modeling components in UML, can be
interpreted from different perspectives:
Three common perspectives:
– Analysis - description of the problem
domain
– Specification - logical description of
software system
– Implementation - description of software
components and their deployment
joe: Student
Is basically the
name: String = “Joe Jones”
same as ...
Course <has
Prerequisite
Relation
Aggregation
Coming up: Associations
Associations
An association is a structural relationship
that specifies that objects of class may be
connected to objects of another class
Meaning from three perspectives
– Analysis: Links between objects
– Specification: Obligation to provide a
connection between objects
– Implementation: Object pointers,
references, linking structures, etc.
g>
ri n
tak
es>
du
ld
he
is
teaches> Class
Instructor
Section
is
<works for
in
st
an
ce
of
>
sponsors>
Department Course
Coming up: Association Names
Association Names
Associations may be named
– The names should communicate the
meaning of the links
– The names are typically verb phases
– The name should include an arrow
indicating the direction in which the name
should be read
in
st
an
ce
of
>
sponsors>
Department Course
Coming up: Navigation
Generalization
Generalization is another kind of
relationship in UML – see Meta Model
From an analysis perspective, it is a pure
generalization/specialization concept, i.e.,
the specialization is a subset of the
generalization
Graduate
Person Student
Student
Student
Person
major: String
name: String GPA: Real
address: String standing: String
g>
ri n
tak
es>
du
ld
he
0..8
1..*
is
teaches> Class
Instructor
1..3 0..6 Section
1..* is
<works for
in
st
an
ce
of
1 >
1 sponsors> 1..*
Department Course
Coming up: Multiplicity Constraints
Questions
From the previous diagram
– How many classes can a student take?
– Do you have to be registered in any classes
to be a student?
– Do I need to teach this class to be an
Instructor? Do I need to teach ANY
classes?
Multiplicity Constraints
A multiplicity constraint can be
– a single number
– a “*”, meaning an arbitrarily large number or
simply “many”
– a range, denoted by “min..max”
– a sequence of single numbers and ranges
Relation
Aggregation
Coming up: Dependencies
Dependencies
A dependency is a type of relationship
It says that one modeling component “uses”
another.
If the later changes then, the former may
have to change as well
Student
Prerequisite
add(Course)
drop(Course)
Coming up: Dependencies
Dependencies
Meaning from three perspectives
– Analysis: physical or logical dependency
between the connected classes
– Specification: a “uses” relationship at an
interface level
– Implementation: a “uses” relationship at an
implementation level.
Relation
Aggregation
Coming up: Aggregation
Aggregation
Aggregation: is a special kind of association
that means “part of”
Aggregations should focus on single type of
composition (physical, organization, etc.)
Crust 1 1
1
1 1 *
Sauce Serving Pizza Order
1..3 1 1
Cheese Serving
0..9 1 4..*
Topping Serving
Slice
Coming up: Composition (very similar to aggregation)
Composition (very similar to aggregation)
Room Building