Introduction to OOA/D

advertisement
1. Introduction
Object-oriented analysis & design
Objectives
• Compare analysis versus design
• Define object-oriented analysis & design
• Illustrate with a brief example
2
Applying UML & Patterns in OOA/D
An object system design is good when it:
• Each object’s function is clear
• Object interactions are clear
• Functions correctly
• Is easy to modify (simple as possible?)
• Performs well.
3
Applying UML & Patterns in OOA/D
• UML stands for Unified Modeling Language.
• UML is only a notation used to:
– Explore an object design space
– Express/communicate a design
4
Applying UML & Patterns in OOA/D
• Assigning responsibilities to objects is fundamental
to design.
• Such assignments benefit from principles &
heuristics.
• The principles & heuristics depend on the object
domain.
– Do the principles of assigning responsibilities to software
objects apply to meatware objects?
– Should you use these principles to assign responsibilities
to team members?
5
What Is Analysis & Design
Analysis
A resolution of anything, whether an object of the senses or of the
intellect, into its constituent or original elements;
an examination of the component parts of a subject, each
separately, as the words which compose a sentence, the tones
of a tune, or the simple propositions which enter into an
argument.
Synthesis
Composition, or the putting of 2 or more things together, as in
compounding medicines.
6
What Is Analysis & Design
Design
•
To draw preliminary outline or main features of; to sketch for a
pattern or model; to delineate; to trace out; to draw.
•
To create or produce, as a work of art; to form a plan or
scheme of; to form in idea; to invent; to project; to lay out in the
mind; as, a man designs an essay, a poem, a statue, or a
cathedral.
7
What is Object-Oriented Analysis
OOA
A resolution of a system into its constituent objects
or concepts.
OOD
To invent a model delineating the key objects of a
system that satisfies a set of requirements.
8
What is Object-Oriented Analysis
A key object or concept has representations
• Domain concept
• Visualization of concept
• Programming language representation
Book
title
public class book
{
private String
title;
public Chapter
getChapter();
9
}
What is Object-Oriented Analysis
Object/concept representations
• Domain concept
• Visualization of concept
Book
title
• Programming language
representation
public class book
{
private String title;
public Chapter getChapter();
}
10
An Example
Mandelbrot Set Visualizer
Define use cases
1. Visualize Mandelbrot Set:
User selects a region to visualize.
User sets visualization parameters.
System displays selected region accordingly.
11
An Example
Define a domain model
MandelbrotSet
region
notifies
Visualizer
sets Region,
parameters
Controller
Domain model indicates key concepts, associations, & attributes.
12
An Example
Define Interaction Diagrams
:Controller
MandelbrotSet
Visualizer
setRegion()
setRegion( Region)
notify()
13
An Example
Define Class Diagrams
MandelbrotSet
region: Region
viewer: Viewer
Visualizer
set: MandelBrotSet
notify()
setRegion()
setIterationLimit()
Controller
set: MandelBrotSet
setRegion()
14
Download