Professional Documents
Culture Documents
Scott W. Ambler
www.ronin-intl.com/company/scottAmbler.html
Senior Consultant
Ronin International, Inc.
Scott W. Ambler
?
Consultant:
?
?
?
Author:
?
?
?
?
?
?
Agile Modeling
Software Process Mentoring
Software Development Mentoring
Agile Modeling
Agile Database Techniques
The Elements of UML Style
The Object Primer 3 rd Edition
Practical Guide to Enterprise Architecture
The Elements of Java Coding Style
Contributing Editor/Writer:
?
?
?
Software Development
Computing Canada
IBM DeveloperWorks
Copyright 2001-2004 Scott W. Ambler
Questions?
Please ask burning questions
during the talk
The only stupid question
is the one that you dont ask
Presentation Overview
?
?
?
?
?
Warning!
Important URLs
Agile Data Method
Agile Database Techniques
Conclusion
Warning!
?
?
?
?
?
?
Important URLs
?
?
?
?
?
?
?
?
www.agilealliance.org
www.agilemodeling.com
www.agiledata.org
www.extremeprogramming.com
www.xprogramming.com
www.ambysoft.com/processPatterns.html
www.modelingstyle.info
www.enterpriseunifiedprocess.info
Copyright 2001-2004 Scott W. Ambler
Philosophies of AD
1.
2.
3.
4.
5.
6.
The
Roles of
the AD
Method
Agile
DBAs
Application
Developers
Application
Design Constraints,
Application Models
Development Efforts
Data-Oriented
Change Requests,
Questions
System-Oriented
Change Requests,
Questions
Standards, Guidelines,
"Current State"
Guidance
Enterprise Models,
Vision For Future
Information Regarding
Current State,
Vision for Future
Enterprise
Administrators
Enterprise
Architects
Enterprise Models,
Vision For Future
10
11
Evolutionary Development
Model the
Object
Schema
Model the
Data
Schema
Performance
Tune
Iterative &
Incremental
Map
Objects to
Data
Refactor
Implement
12
Class Models
Data
Models
Should
Not
Drive
Object
Models
ZipCode
USAddress
- street: string
- city: string
- state: string
0..*
- zipCode: int
+ validate(int stateCode): boolean
+ asLabel(): string
- getPlusFourNumber(): int
- getPostStateNumber(): int
- getStateNumber(): int
Address
AddressId: INT24 <<PK>>
Street: VARCHAR(30)
City: VARCHAR(30)
State: VARCHAR(30)
Country: VARCHAR(30)
PostCode: VARCHAR(20)
USAddress
- street: string
- city: string
- state: string
- postCode: string
InternationalAddress
- country: string
13
Class Model
Object
Models
Should
Not
Drive
Data
Models
CreaturePOID <<PK>>
Name
FireCapacity
MaximumSpeed
WingSpan
NumberOfClaws
ScaleColors
Bird
Lizard
maximumSpeed
wingSpan
numberOfClaws
scaleColors
Bird
Dragon
BirdPOID <<PK>>
MaximumSpeed
WingSpan
DragonPOID <<PK>>
Name
FireCapacity
MaximumSpeed
WingSpan
NumberOfClaws
ScaleColors
Lizard
Dragon
name
fireCapacity
LizardPOID <<PK>>
NumberOfClaws
ScaleColors
Bird
Lizard
CreaturePOID <<PK>>
MaximumSpeed
WingSpan
CreaturePOID <<PK>>
NumberOfClaws
ScaleColors
Dragon
CreaturePOID <<PK>> <<FK>>
Name
FireCapacity
14
What is AM?
?
Your
Process
15
Agile models:
?
?
?
?
?
?
?
16
17
The Core of AM
Core Principles
? Assume Simplicity
? Embrace Change
? Enabling the Next Effort is Your
Secondary Goal
? Incremental Change
? Model With a Purpose
? Multiple Models
? Maximize Stakeholder Investment
? Quality Work
? Rapid Feedback
? Software Is Your Primary Goal
? Travel Light
Core Practices
? Active Stakeholder Participation
? Apply the Right Artifact(s)
? Collective Ownership
? Consider Testability
? Create Several Models in Parallel
? Create Simple Content
? Depict Models Simply
? Display Models Publicly
? Iterate to Another Artifact
? Model in Small Increments
? Model With Others
? Prove it With Code
? Use the Simplest Tools
18
Iterative Modeling
(www.agilemodeling.com/essays/phasesExamined.htm)
8 VDJH 0 RGHOLQJ
8VHU,QW
HUIDFH' HYHORSP HQW
( VVHQWLDO
8 VH&DVHV
) HDW
XUHV
6 \ VW
HP 8 VH&DVHV
8 VHU6 W
RULHV
8 0 / 8 VH&DVH' LDJUDP
( VVHQW
LD8OVHU,QW
HUIDFH3URW
RW
\ SH
8VHU,QW
HUIDFH) O
RZ ' LDJUDP
8VHU,QW
HUIDFH3URW
RW
\ SH
6XSSOHP HQW
DU\ 5 HTXLUHP HQW
V
0 RGHOLQJ
' HW
DLOHG6 W
UXFW
XUDO
0 RGHO
LQJ
%XVLQHVV5 XO
HV
&RQVW
U
DLQW
V
* ORVVDU\
7HFKQLFDO
5 HTXLUHP HQW
V
3K\VLFDO
' DW
D0 RGHO 3' 0
8 0 / &O
DVV' LDJUDP
' \ QDP LF 2 EM
HFW
0 RGHO
LQJ
80/
80/
80/
80/
80/
80/
&RQFHSW
XDO
' RP DLQ0 RGHOLQJ
&RP P XQLFDW
LRQ' LDJUDP
&RP SRVLW
H6W
UXFW
XUH' LDJUDP
,QW
HUDFW
LRQ2 YHUYLHZ ' LDJUDP
6HTXHQFH' LDJUDP
6W
DW
H0 DFKLQH' LDJUDP
7LP LQJ ' LDJUDP
&O
DVV5 HVSRQVLELO
LW
\ &RO
O
DERUDW
RU & 5 & &DUGV
/ RJLFDO' DW
D0 RGHO / ' 0
2EM
HFW
5 RO
H0 RGHO 2 5 0 ' LDJUDP
5REXVW
QHVV' LDJUDP
8 0 / &O
DVV' LDJUDP
$ UFKLW
HFW
XUDO0 RGHOLQJ
3URFHVV0 RGHOLQJ
&KDQJH&DVHV
) UHH) RUP ' LDJUDP
8 0 / &RP SRQHQ'WLDJUDP
8 0 / ' HSO
R\ P HQ'WLDJUDP
8 0 / 3 DFNDJH' LDJUDP
' DW
D) O
RZ ' LDJUDP ' ) '
) ORZ &KDUW
8 0 / $FW
LYLW
\ ' LDJUDP
19
Database Refactorings
?
Examples of Database
Refactorings
?
?
?
?
?
?
?
?
?
?
?
21
22
Other
Applications
You Don't
Know About
Your
Application
Persistence
Frameworks
Your
Database
Data
Imports
Other
Databases
Data
Extracts
Data
File
Data
File
Test
Code
23
24
Encapsulation Strategies
Coupling is enemy #1
? Encapsulation is your ally
? Encapsulation strategies:
?
?
?
?
?
25
Mapping Inheritance
?
?
?
Mapping Associations
? Why Mapping Isnt Straightforward
?
26
Mapping Inheritance
Example Problem
Person
{abstract}
Person
{abstract}
name
phoneNumber
Employee
startDate
name
phoneNumber
Customer
customerID
preferences
Employee
startDate
Customer
customerID
preferences
Executive
bonus
27
Mapping Inheritance
One Table Per Hierarchy
Person
Person
OID
name
phoneNumber
customerNumber
preferences
startDate
objectType
OID
name
phoneNumber
customerNumber
preferences
startDate
bonus
objectType
28
Mapping Inheritance
One Table Per Concrete Class
Customer
OID
name
phoneNumber
customerNumber
preferences
Employee
OID
name
phoneNumber
startDate
Executive
OID
name
phoneNumber
startDate
bonus
29
Mapping Inheritance
One Table Per Class
Person
Person
OID
name
phoneNumber
objectType
OID
name
phoneNumber
objectType
is a
is a
is a
is a
Customer
Employee
OID (FK)
customerNumber
preferences
OID (FK)
startDate
Customer
Employee
OID ( FK)
customerNumber
preferences
OID (FK)
startDate
is a
Executive
OID (FK)
bonus
30
Mapping Associations
Account
Customer
1..n
-firstName : String
-lastName : String
1..n
accesses
+purchaseItems()
+complain()
Customer
customerOID
firstName: String
lastName: String
-accountNumber : Integer
-currentBalance : Currency
+deposit()
+withDraw()
+open()
+close()
Accesses
customerOID
accountNumber
Account
accountNumber
currentBalance: Float
31
1..1
-number : Number
+label() : String
+validate() : Boolean
1..1
+label() : String
Address
addressOID
street: string
city: string
zipcode: integer
state: string
country: string
Address
- OR -
addressOID
street: string
city: string
zipcode (FK)
state: string
country: string
Zip Code
zipcode
description: string
32
Caching
Concurrency control
Database architecture
Legacy data sources
Performance tuning
Persisting relationships
Referential integrity
Versioning objects
Copyright 2001-2004 Scott W. Ambler
33
Conclusion
?
?
?
?
?
34
Keep in Touch
Scott W. Ambler
www.ronin-intl.com/company/scottAmbler.html
35