close

Вход

Забыли?

вход по аккаунту

?

COMP 6471 Software Design Methodologies

код для вставкиСкачать
SOEN 343
Software Design
Section H Fall 2006
Dr Greg Butler
http://www.cs.concordia.ca/~gregb/home/soen343h-f06.html
Course Introduction
•
•
•
•
•
•
•
•
Course People
Course Components
What the course is
What the course is not
Enterprise Application (Assignments)
Larman’s Design Process
What is OO Analysis and Design
Design Pattern Example - Command
Course People – Section H
Instructor: Dr Greg Butler
Office Hours: Wednesdays 15:00 to 16:00
Or by appointment
But ask questions in class please
TAs: Asif Dogar & Rajiv Abraham
Course Coordinator: Dr Patrice Chalin
Course Components
Lectures: WF 13:15 to 14:30 CL-220
Tutorials: F 14:45 to 15:35
In Lab to be announced; start week 2
Assignments: 3-4, every 2 weeks, start week 8,
worth 5-15%
Midterm Exam: week 7, worth 25-35%
Quizzes: 2-3, approx. weeks 4, 10,.. worth 5-10%
Final Exam: worth 50-60%; you must pass final
Basic Questions (Let’s Discuss)
What is software design?
How is it different from software programming?
Software development?
How do we design software?
What is the role of objects, layers, architecture, ..?
What is the role of tests, responsibilities, patterns,
models, …?
How does design fit into the software lifecycle?
What is good design?
How does software design differ from … design?
Course Objectives
• “Think in Objects”
• Practice
• Analyze requirements with • Apply agile modeling
use cases
• Design object solutions
• Create domain models
– Assign responsibilities to
objects
• Apply an iterative & agile
Unified Process (UP)
• Relate analysis and
design artifacts
• Read & write highfrequency UML
– Design collaborations
– Design with patterns
– Design with architectural
layers
– Understand OOP (e.g.,
Java) mapping issues
What the course is:
A (first) look at OO design!
Design process: domain model, use cases,
design
Emphasis: models, GRASP principles,
design patterns, responsibility,
collaboration
Mentions: RDD, TDD, MDD, extensibility
Closely follows textbook!
What the course is not:
A course in UML, Java
• You should know the basics of these
• And become expert (as needed) yourself
A course in tools: Eclipse, XDE, JUnit
• You can work through tutorials yourself
A course in UI design, DB design
A course in software engineering, software
architecture, software reuse, …
Lectures
Review of Java and object-oriented programming
Responsibility Driven Design following Larman
• Each object has responsibility (ies)
• GRASP principles for distribution of responsibilities
• GoF design patterns
• Application of principles and patterns to examples/assignments
Domain Modeling
Introduction to Enterprise Applications
• Fowler’s patterns
• Application of GRASP principles in Fowler’s patterns
• Application in assignments
Transition from requirements to design following Larman
Enterprise Applications Patterns
Assignments (and some lectures) are about
building web-based systems for
enterprise applications
Involve
Presentation on the web
Business Logic and Business Objects
Data storage and access
use book of Martin Fowler, “Patterns of
Enterprise Application Architecture”
Data Source Domain Presentation
Fowler’s EA Patterns
Page Controller
Template View
Front Controller
Transform View
Transaction Script
Active Record
Domain Model
Table Module
Data Mapper
Row Data Gateway
Table Data Gateway
Larman’s Design Process
S a m p le U P A rtifa c t R e la tio n s h ip s
D o m a in M o d e l
S a le
B u s in e s s
M o d e lin g
S a le s
L in e Ite m
1 .. *
1
d a te
...
...
...
q u a n tity
U se -C a se M o d e l
P ro ce ss S a le
P ro ce ss
S a le
u se
ca se
nam es
C a sh ie r
R e q u ire m e n ts
U se C a se D ia g ra m
sta rtin g e ve n ts to
d e sig n fo r, a n d
d e ta ile d p o stco n d itio n to
sa tisfy
D e s ig n
n o n -fu n ctio n a l
re q u ire m e n ts
fu n ctio n a l
re q u ire m e n ts
th a t m u st b e
re a lize d b y
th e o b je cts
U se C a se T e xt
syste m
e ve n ts
id e a s fo r
th e p o stco n d itio n s
in sp ira tio n fo r
nam es of
so m e
so ftw a re
d o m a in
o b je cts
S u p p le m e n ta ry
S p e cifica tio n
1 . C u sto m e r
a rrive s ...
2 . ...
3 . C a sh ie r
e n te rs ite m
id e n tifie r.
d o m a in ru le s
: S yste m
G lo ssa ry
O p e ra tio n :
e n te rIte m (… )
P o st-co n d itio n s :
- ...
: C a s h ie r
syste m
o p e ra tio n s
m a ke
N e w S a le ()
e n te rIte m
(id , q u a n tity )
ite m d e ta ils,
fo rm a ts,
va lid a tio n
S yste m S e q u e n ce D ia g ra m s
O p e ra tio n C o n tra cts
D e s ig n M o d e l
: R e g iste r
: P ro d u ctC a ta lo g
e n te rIte m
(ite m ID , q u a n tity )
d = g e tP ro d u ctD e scrip tio n (ite m ID )
a d d L in e Ite m ( d , q u a n tity )
R e g iste r
P ro d u ctC a ta lo g
...
m a ke N e w S a le ()
e n te rIte m (...)
...
...
*
1
g e tP ro d u ctD e scrip tio n (...)
...
: S a le
Domain Model
Pays-for-overdue-charges пЂґ
VideoRental
CashPayment
Pays-for пЂґ
amount : Money
1
1
date
1
1
1
*
dueDate
returnDate
returnTime
1..*
*
Initiates пЂґ
1
0..1
RentalTransaction
Records-rental-of пЂ¶
1
RentsпЂґ
1..*
Customer
VideoStore
Rents-from пЂґ address
name
1
phoneNumber
address
name
phoneNumber
1
*
1
1
MaintainsпЂ¶
Has пЂ¶
Video
StocksпЂґ
*
ID
*
1
Owns-a пЂґ
1
1
*
Membership
Catalog
ID
startDate
1
Described-by пЂ¶
1
1..*
VideoDescription
LoanPolicy
1
DefinesпЂі
perDayRentalCharge
perDayLateCharge
1..*
1
1..*
1
title
subjectCategory
Determines-rental-charge пЂґ
*
Use Case Model
Partial artifacts, refined in each iteration.
Use-Case Model
:System
foo( x )
Requirements
bar( y )
text
use
cases
use
case
diagrams
system
sequence
diagrams
system
operations
system
operation
contracts
Typical Software Architecture Layers
h a n d le s p re se n ta tio n la ye r re q u e sts
w o rkflo w
se ssio n sta te
w in d o w /p a g e tra n sitio n s
co n so lid a tio n /tra n sfo rm a tio n o f d isp a ra te
d a ta fo r p re se n ta tio n
h a n d le s a p p lica tio n la ye r re q u e sts
im p le m e n ta tio n o f d o m a in ru le s
d o m a in se rvice s (P O S , In ve n to ry )
- se rvice s m a y b e u se d b y ju st o n e
a p p lica tio n , b u t th e re is a lso th e p o ssib ility
o f m u lti-a p p lica tio n se rvice s
ve ry g e n e ra l lo w -le ve l b u sin e ss se rvice s
u se d in m a n y b u sin e ss d o m a in s
C u rre n cyC o n ve rte r
(re la tive ly ) h ig h -le ve l te ch n ica l se rvice s
a n d fra m e w o rks
P e rsiste n ce , S e cu rity
lo w -le ve l te ch n ica l se rvice s , u tilitie s,
a n d fra m e w o rks
d a ta stru ctu re s , th re a d s , m a th ,
file, D B , a n d n e tw o rk I/O
UI
(A K A P re s e n ta tio n , V ie w )
m o re
app
s p e c ific
A p p lic a tio n
(A K A W o rkflo w , P ro ce ss ,
M e d ia tio n , A p p C o n tro lle r)
dependency
G U I w in d o w s
re p o rts
sp e e ch in te rfa ce
H T M L , X M L , X S L T , JS P , Ja va scrip t, ...
D o m a in
(A K A B u sin e ss ,
A p p lica tio n L o g ic , M o d e l)
B u s in e s s In fra s tru c tu re
(A K A L o w -le ve l B u sin e ss S e rvice s )
T e c h n ic a l S e rv ic e s
(A K A T e ch n ica l In fra stru ctu re ,
H ig h -le ve l T e ch n ica l S e rvice s )
F o u n d a tio n
(A K A C o re S e rvice s , B a se S e rvice s ,
L o w -le ve l T e ch n ica l S e rvice s /In fra stru ctu re )
w id th im p lie s ra n g e o f a p p lic a b ility
Typical Software Architecture Layers (Simplified)
UI
S w in g
n o t th e Ja va
S w in g lib ra rie s , b u t
o u r G U I cla sse s
b a se d o n S w in g
W eb
D o m a in
S a le s
P a ym e n ts
T a xe s
L o g g in g
R u le sE n g in e
T e ch n ica l S e rvice s
P e rsiste n ce
What is Design?
Developing a blueprint (plan) for a
mechanism that performs the required
task,
… taking into account all the constraints, &
… making trade-offs between constraints
when they are in conflict.
What is OO Analysis and Design
• Object-Oriented
Analysis
• Object-Oriented
Design
– Important domain
concepts or objects?
– Design of software
objects
– Vocabulary?
– Responsibilities
– Collaborations
– Visualized in the UP
Domain Model
– Design patterns
– Visualized in the UP
Design Model
Important Concepts
Model
• Abstraction hiding (unimportant) details
• Eg, cover of Larman’s book
GRASP Principle
• for assigning responsibility
Design pattern
• Solution to design problem in context
• Eg, Command pattern
Responsibility-Driven Design (RDD)
• Detailed object design is usually done
from the point of view of the metaphor of:
– Objects have responsibilities
– Objects collaborate
• Responsibilities are an abstraction.
– The responsibility for persistence.
• Large-grained responsibility.
– The responsibility for the sales tax calculation.
• More fine-grained responsibility.
The 9 GRASP Principles
1.
2.
3.
4.
5.
6.
7.
8.
9.
Creator
Expert
Controller
Low Coupling
High Cohesion
Polymorphism
Pure Fabrication
Indirection
Protected Variations
Overview of Patterns
•Present solutions
to common
software problems
arising within a
certain context
•Help resolve
key software
design
forces
•Capture recurring structures &
dynamics among software
participants to facilitate reuse of
successful designs
•Generally codify expert
knowledge of design strategies,
constraints & “best practices”
AbstractService
service
Client
Proxy
service
Service
1
1
service
The Proxy Pattern
•Flexibility
•Extensibility
•Dependability
•Predictability
•Scalability
•Efficiency
Command Pattern
Problem: How to allow the same command
to be invoked by
– Menu selection
– Alt-ctrl shortcut
– Commandline text entry, etc
• How to allow (unlimited) undo/redo
• How to keep a log/audit/history of
commands invoked
• How to allow “macro” commands to be
defined
Command Pattern
• You have commands that need to be
– executed,
– undone, or
– queued
• Command design pattern separates
– Receiver from Invoker from Commands
• All commands derive from Command and
implement do(), undo(), and redo()
• Also allows recording history, replay
Документ
Категория
Презентации
Просмотров
6
Размер файла
876 Кб
Теги
1/--страниц
Пожаловаться на содержимое документа