Академический Документы
Профессиональный Документы
Культура Документы
Information Systems
Analysis and Design
Week 7/Session 11
Class and Method Design
Learning Outcomes
• LO 4: Model the requirements design
References
• ALAN DENNIS, BARBARA HALEY WIXOM,
DAVID TEGARDEN. (2015). SYSTEM ANALYSIS
AND DESIGN: An Object-Oriented Approach
with UML. 5th Edition. Wiley. ISBN:
9781118804674.
– Chapter 8
Sub Topics
• Review of the Basic Characteristics of Object
Orientation
• Design Criteria
• Object Design Activities
• Constraints and Contracts
• Method Specification
• Verifying and Validating Class and Method
Design
REVIEW OF THE BASIC
CHARACTERISTICS OF OBJECT
ORIENTATION
Classes, Objects,
Methods, and Messages
Classes Templates that we use to define both the data
●
Encapsu ●
… is the mechanism that
combines the processes and
lation data into a single object.
Dynamic ●
… refers to the ability of object-
oriented system to defer the data
Building typing of objects to run time.
Inheritance
ance
●
Subclasses inherit the attributes and
methods from the superclasses above them.
DESIGN CRITERIA
Coupling
• Coupling refers to how interdependent or interrelated the
modules (classes, objects, and methods) are in a system.
– The higher the interdependency, the more likely changes in part
of a design can cause changes to be required in other parts of
the design.
• Two types of coupling:
– Interaction
• Deals with the coupling among methods and objects through message
passing.
– Inheritance
• Deals with how tightly coupled the classes are in an inheritance
hierarchy.
Types of Interaction
Coupling
Source:
Dennis, 2015, pg. 290
Types of Class Cohesion
Defi
ne
any
con
stra
ints
(pre
con
diti
ons,
pos
tco
ndi
tion
s,
inva
rian
ts)
that
mus
t be
pre
serv
ed
by
the
obj
ects
.
Identifying Opportunities
for Reuse
… is composed of a set of implemented classes
●
Normalization?
Inheritance Relationship?
Optimizing the Design
Review the access paths between objects.
Preconditions
●
… is a constraint that must be met for a method to execute.
Postconditions
●
… is a constraint that must be met after the method executes, or the effect of the method execution must be undone.
Invariants
●
… model constrains that must be always be true for all instances of a class.
Contracts
• … formalizes the interactions between the client
and server objects, where a client (consumer)
objects is an instance of a class that sends a
message to a server (supplier) object that
executes one of its methods in response to the
request.
Source:
Dennis, 2015, pg. 309
METHOD SPECIFICATION
Method Specification
Form
Source:
Dennis, 2015, pg. 315
VERIFYING AND VALIDATING CLASS
AND METHOD DESIGN
Verifying and Validating
Class and Method Design
Recommend that a walkthrough of all of the evolved problem domain representations be performed.