Académique Documents
Professionnel Documents
Culture Documents
Identify
Design
Analysis Classes
Mechanisms
Design Model
Design Model
2
Identify Design Mechanisms: Steps
Categorize clients of analysis mechanisms
Document architectural mechanisms
3
What Is A Design Pattern?
A design pattern provides a scheme for
refining the subsystems or components
of a software system, or the relationships
between them. It describes a commonly-
recurring structure of communicating
components that solves a general design
problem within a particular context.
- Erich Gamma, Richard Helm, Ralph Johnson and
John Vlissides 1994. Design PatternsElements
of Reusable Object-Oriented Software
4
Categorize Analysis Mechanisms
Purpose
To refine the information gathered on the analysis
mechanisms
Steps
Identify the clients of each analysis mechanism
Identify characteristic profiles for each analysis
mechanism
Group clients according to their use of characteristic
profiles
Proceed bottom-up and make an inventory of the
implementation mechanisms that you have at your
disposal
5
Design and Implementation
Mechanisms
Analysis Design Implementation
Mechanism Mechanism Mechanism
(Conceptual) (Concrete) (Actual)
Legacy Data
New Data
Pattern Name
8
Design Mechanisms: Persistency:
RDBMS: JDBC
Persistence characteristics
Granularity
Volume
Duration
Access mechanism
Access frequency
(creation/deletion, update, read)
Reliability
Note: JDBC is the standard Java API for talking to a SQL database.
9
Example: Persistency: RDBMS: JDBC
<<role>>
PersistencyClient
Roles to be filled by the <<role>>
(from SamplePersistency Client) designer applying the PersistentClassList
(from SamplePersistentClass)
mechanism
new()
add(c: PersistentClass)
<<role>>
DBClass 1
0..*
create() : PersistentClass
<<role>>
read(searchCriteria : string) : PersistentClassList
PersistentClass
update(c : PersistentClass) (from SamplePersistentClass)
delete(c : PersistentClass)
1 getData()
setData()
command()
new()
DriverManager
(from java.sql)
Statement
ResultSet (from java.sql)
Connection
(from java.sql)
(from java.sql)
10
Example: Persistency: RDBMS:
JDBC: Initialize
: DBClass : DriverManager
11
Example: Persistency: RDBMS:
JDBC: Create
: PersistencyClient : DBClass : PersistentClass : Connection : Statement
1. create( )
1.1. New()
1.2. getData( )
1.3. createStatement( )
1.4. executeUpdate(String)
12
Example: Persistency: RDBMS:
: PersistencyClient
JDBC: Read
: DBClass : Connection : Statement : ResultSet : PersistentClassList : PersistentClass
1.4. new()
Repeat these
operations for each 1.5. getString( )
called for each
element returned from
attribute in the
the executeQuery() 1.6. setData( ) class
command.
The
PersistentClassList is 1.7. add(PersistentClass)
loaded with the data
retrieved from the
database. Add the retrieved course offering
to the list to be returned
13
Example: Persistency: RDBMS:
JDBC: Update
: PersistencyClient : DBClass : PersistentClass : Connection : Statement
1. update(PersistentClass)
1.1. getData( )
1.2. createStatement( )
execute SQL
statement
1.3. executeUpdate(string)
14
Example: Persistency: RDBMS:
JDBC: Delete
: PersistencyClient : DBClass : Connection : Statement
1. delete(PersistentClass)
1.1. createStatement( )
execute SQL
statement
1.2. executeUpdate(string)
15
Example: Incorporating JDBC
Sample
Persistency
Client Package
java.sql
DriverManager Connection
(from java.sql) (from java.sql)
Statement ResultSet
(from java.sql) (from java.sql)
16