week05a
week05a
Use Case
Class Diagrams
Not what we have so far.
These are Design Classes. More later
Review: Use-Case Realization
Remember: a use-case realization describes
how a particular use case is realized within the
Design Model, in terms of collaborating objects.
A use-case realization is one possible realization of
a use case.
A use-case realization in the Design Model can be
traced to a use case in the Use-Case Model.
A realization relationship is drawn from the use-case
realization to the use case it realizes.
A use-case realization can be represented using
set of diagrams (the number and type may vary)
Review: Use-Case Realization
The diagrams that may be used to realize a use
case realization may include:
Interaction Diagrams (sequence and/or
collaboration diagrams) can be used to describe
how the use case is realized in terms of collaborating
objects.
These diagrams model the detailed collaborations
of the use-case realization.
Class Diagrams can be used to describe the classes
that participate in the realization of the use case, as
well as their supporting relationships.
These diagrams model the context of the use-case
realization.
Review: Use-Case Realization
In our Use Case Analysis step, the use-case
realizations' diagrams are outlined.
Exactly what this entails will be discussed ahead and
form part of the fourth deliverable.
In subsequent design activities (Use-Case Design)
these class diagrams will be considerably refined
and updated according to more formal class
interface definitions.
A designer: responsible for the integrity of the
use-case realization.
Must coordinate with the designers responsible
for the classes and relationships employed in the
use-case realization.
The use-case realization can be used by class
designers to understand the class’s role in the
use case and how the class interacts with other
classes.
This implies that a team will/may distribute
responsibilities for each class to developers.
This information can be used to determine/refine
the class responsibilities and interfaces.
Let’s find the classes from different behaviors the
classes must provide…
Identifying Candidate Classes from Behavior
Will use three perspectives of the system to identify
these classes.
The ‘boundary’ between the system and its actors
The information’ the system uses
The ‘control logic’ of the system
Will use stereotypes to represent these perspectives
(boundary, control, entity)
These are conveniences used during analysis that will
disappear or be transitioned into different design elements
during the design process.
Will result in a more robust model because these are the
three things that are most likely to change in system and
so we isolate them so that we can treat them separately.
That is, the interface/boundary, the control, and the key
system entities.….
Find Classes From Use-Case Behavior
The complete behavior of a use case has to be
distributed to analysis classes
We must ‘identify’ these classes – identify, name,
and briefly describe in a few sentences.
<<boundary>>
<<control>> <<boundary>>
<<entity>>
<<entity>>
Discovering Classes
Analysis classes represent an early conceptual model for
‘things in the system which have responsibilities and
behaviors’.
System
<<entity>>
information
Analysis Classes - Early Conceptual Model
The analysis classes, taken together, represent an early
conceptual model of the system.
This conceptual model evolves quickly and remains
fluid for some time as different representations and
their implications are explored.
Analysis classes are early estimations of the composition
of the system; they rarely survive intact into
implementation.
Many of the analysis classes morph into something else
later on (subsystems, components, split classes,
combined classes).
They provide us with a way of capturing the required
behaviors in a form that we can use to explore the
behavior and composition of the system.
Analysis classes allow us to "play" with the distribution
of responsibilities, re-allocating, as necessary.
Analysis Classes: A First Step
Towards Executables
<<boundary>>
Analysis class
stereotype
The Role of a Boundary Class
Actors can only communicate with boundary classes.
<<boundary>> Boundary classes identify the system’s boundaries.
<<control>>
<<boundary>>
Customer
External
<<boundary>> Database??
<<entity>> <<entity>>
A boundary class is a class used to model interaction between the system’s surroundings
and its inner workings; Involves transforming and
Boundary Classes model parts of the system that depend on its surroundings. Entity
and control classes model parts that are independent of the system’s surroundings.
Examples of boundary classes: Classes that handle GUI or communications protocols.
Boundary Classes - more
Identify boundary classes for things mentioned in
the flow of events of the use-case realization.
Consider the source for all external events and
make sure there is a way for the system to
detect these events. (user inputs/responses?
Connection to existing external data…)
One recommendation: for the initial identification
of boundary classes is one boundary class per
actor/use-case pair.
This class can be viewed as having responsibility for
coordinating the interaction with the actor.
This may be refined as a more detailed analysis is
performed.
This is particularly true for window-based GUI
applications, where there is typically one boundary
class for each window, or one for each dialog.
Example: Finding Boundary Classes
One boundary class per actor/use case pair:
<<boundary>> <<boundary>>
RegisterForCoursesForm CourseCatalogSystem
Analysis class
stereotype
<<entity>>
Sources for entity Glossary
Classes:
Glossary
Use-Case Flow of Use Case Entity classes show the
Events logical data structure,
Business domain which will help us
model understand what the
system is supposed to
Business-Domain Model
offer to its users.
Architectural Analysis
Abstractions
Environment Independent
Entity Classes
Entity classes represent stores of information in the
system
They are typically used to represent the key items the
system manages.
Entity objects (instances of entity classes) are used to
hold and update information about some phenomenon,
such as an event, a person, or some real-life object.
(advisor, teacher, university, student etc.)
They are usually persistent, having attributes and
relationships needed for a long period, sometimes for the
life of the system.
The main responsibilities of entity classes are to
store and manage information in the system.
The Role of an Entity Class
Entity objects can have complicated behavior;
however, unlike other objects, this behavior
<<boundary>>
is strongly related to the phenomenon the entity
object represents.
<<control>>
<<boundary>>
Customer
<<boundary>>
<<entity>> <<entity>>
Student
CourseOffering