Chapter-5 OOo Analysis
Chapter-5 OOo Analysis
Chapter-5 OOo Analysis
1
Outline
• Introduction
• An overview of Analysis
• Analysis concepts and activities
• Entity, boundary and Control objects
• Association Multiplicity, Qualified Associations,
Generalization.
• Identifying Entity objects, Boundary objects, Control
objects
• Modeling interaction between objects
• Identifying Associations and Attributes
2
Introduction
• In object-oriented analysis, developers build a model describing
the application domain.
3
An Overview of Analysis
• Analysis focuses on producing a model of the system, called the
analysis model, which is correct, complete, and consistent.
5
Analysis Concepts
• In this section, we describe the main analysis concepts used in this
chapter. In particular, we describe:-
• Association
• Multiplicity
Have already been discussed in
• Qualified Associations
modelling with UML.
• Generalization.
6
Entity, Boundary, and Control Objects
• The analysis object model - consists of entity, boundary, and
control objects.
• Entity objects -represent the persistent information tracked by the
system.
• Boundary objects -represent the interactions between the actors
and the system.
• Control objects -represent the tasks that are performed by the user
and supported by the system.
• Example 1:If you take watch:-
- Year, Month, Day are entity objects;
- Button and LCDDisplay are boundary objects;
- ChangeDate is a control object that represents the activity
of changing the date by pressing combinations of buttons.
7
8
Analysis Activities: From Use Cases to
Objects
➢In this section, we describe the activities that transform the use cases
and scenarios produced during requirements elicitation into an
analysis model.
➢Analysis activities include:-
- identifying entity objects
- identifying boundary objects
- identifying control objects
- mapping use cases to objects
- identifying associations among objects
- identifying object attributes
- modelling objects’s behavior with state charts
- modelling generalization relationships
- reviewing the analysis model
• We illustrate each activity by focusing on the ReportEmergency use
case of FRIEND described in Requirements Elicitation.
9
Identifying Entity Objects
• Participating objects form the basis of the analysis model.
➢ identifying objects,
➢ attributes,
➢and associations from a system specification.
12
13
➢Heuristics for identifying initial analysis objects
14
➢Some of the entity objects for ReportEmergeny use case are:-
15
➢Identifying Boundary Objects
• Boundary objects represent the system interface with the actors.
• The boundary object collects the information from the actor and
translates it into an interface that can be used by the entity objects
and also by the control objects.
• Identify forms and windows the users needs to enter data into the
system (e.g.,EmergencyReportForm, ReportEmergencyButtonForm).
• Identify notices and messages the system uses to respond to the user
(e.g., AcknowledgmentNotice).
16
• These are some of boundary objects by examining the
ReportEmergency use case:-
17
➢Identifying Control Objects
• Control objects are responsible for coordinating boundary and
entity objects.
• It is responsible for collecting information from the boundary objects
and dispatching it to entity objects.
• For example, control objects describe the behaviour associated with:-
1-the sequencing of forms
2-undo and history queues, and
3- dispatching information in a distributed system.
• Identify one control object per use case more if the use case is
complex and if it can be divided into shorter flows of events.
18
• Here is the model for the control flow of the ReportEmergency use
case with a control object for each actor;
➢Sequence Diagrams
• The leftmost column is the actor who initiates the use case.
21
Sequence diagram for the ReportEmergency use case (initiation from the
FieldOfficerStation side).
22
Sequence diagram for the ReportEmergency use case (DispatcherStation).
23
Sequence diagram for the ReportEmergency use case (acknowledgment on
the FieldOfficerStation).
24
25
➢Heuristics for drawing sequence diagrams:-
26
27
28
➢By constructing sequence diagrams:-
29
➢Identifying Associations
30
➢Associations have several properties:-
• A name, to describe the association between the two classes (e.g.,
Writes)
• A role at each end, identifying the function of each class with respect to
the associations (e.g., author is the role played by FieldOfficer in the
Writes association).
• A multiplicity at each end, identifying the possible number of instances
e.g.,
- * indicates a FieldOfficer may write zero or more EmergencyReports.
- 1 indicates that each EmergencyReport has exactly one FieldOfficer
as author.
31
➢Identifying Attributes
• Attributes are properties of individual objects.
• When identifying properties of objects, only the attributes relevant to
the system should be considered.
• (For example, each FieldOfficer has a social security number, Instead,
FieldOfficers are identified by badge number, represented by the
badgeNumber property.
32
➢Attributes have:-
• A brief description.
• A type describing the legal values it can take.
→ the description attribute of an EmergencyReport is a
string.
33
Modelling the Behaviour of Individual
Objects
➢Sequence diagrams are used to distribute behaviour
across objects and to identify operations.
➢Sequence diagrams represent the behaviour of the
system from the perspective of a single use case.
➢Statechart diagrams represent behaviour from the
perspective of a single object.
• Viewing behaviour from the perspective of each object
enables the developer:-
- To identify missing use cases.
- To build a more-formal description of the behavior of
the object.
34
• The following Figure displays a statechart for the Incident
class.
35
Modeling Generalization Relationships
Between Objects
• Generalization is used to eliminate redundancy from the
analysis model.
• If two or more classes share attributes or behavior, the
similarities are consolidated into a superclass.
• For example, Dispatchers and FieldOfficers both have a
badgeNumber attribute that serves to identify them within a
city.
• FieldOfficers and Dispatchers are both PoliceOfficers who
are assigned different functions.
• To model explicitly this similarity, we introduce an abstract
PoliceOfficer class from which the FieldOfficer and
Dispatcher classes inherit.
36
fig: An example of inheritance relationship (UML class diagram).
37
Reviewing the Analysis Model
• The analysis model is built incrementally and iteratively.
• Once the analysis model becomes stable
• The analysis model is reviewed:
- first by the developers (i.e., internal reviews),
- then jointly by the developers and the client.
38
correctness:
➢The following questions should be asked to ensure that the model is
correct:
• Is the glossary of entity objects understandable by the user?
• Do abstract classes correspond to user-level concepts?
• Are all descriptions in accordance with the users’ definitions?
• Do all entity and boundary objects have meaningful noun phrases
as names?
• Do all use cases and control objects have meaningful verb phrases
as names?
• Are all error cases described and handled?
• Are the start-up and the shut-down phases of the system
described?
• Are the administration functions of the system described?
39
Completeness
• The following questions should be asked to ensure that the
model is complete:
• For each object: Is it needed by any use case? In which use
case is it created? modified? destroyed? Can it be accessed
from a boundary object?
• For each attribute: When is it set? What is its type? Should
it be a qualifier?
• For each association: When is it traversed? Why was the
specific multiplicity chosen? Can associations with one-to-
many and many-to-many multiplicities be qualified?
• For each control object: Does it have the necessary
associations to access the objects participating in its
corresponding use case?
40
Consistency
41
Realistic
➢The following questions should be asked to ensure that
the system described by the analysis model is realistic:
42
Analysis Summary
43
Analysis activities (UML activities diagram).
44