Vous êtes sur la page 1sur 16

Session - 9

IDENTIFY DESIGN MECHANISMS


Identify Design Mechanisms Overview

Design Software Architecture


Supplementary Guidelines Document
Specifications

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

Persistency RDBMS JDBC

New Data

Persistency OODBMS ObjectStore

Distribution Remote Method Java 1.2 from Sun


Invocation (RMI)

Analysis Design Implementation


6
Review: Documenting Architectural
Mechanisms
Architectural Mechanisms can be treated as
patterns (i.e., stereotyped parameterized
collaboration) Template
Parameters

Pattern Name

Structural Aspect Behavioral Aspect

Documented in Design Guidelines


7
Review: Course Registration Analysis
Mechanisms
Persistence
Distribution
Security
Legacy Interface

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)

1 getConnection(url, user, pass) : Connection

Statement
ResultSet (from java.sql)
Connection
(from java.sql)
(from java.sql)

executeQuery(sql : String) : ResultSet


createStatement() : Statement
getString() : string executeUpdate(sql : String) : int

10
Example: Persistency: RDBMS:
JDBC: Initialize
: DBClass : DriverManager

1. getConnection(url, user, pass)

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. read(string) returns a The SQL statement


Statement built by the DBClass
1.1. createStatement( ) using the given
criteria is passed to
The criteria used to executeQuery()
access data for the 1.2. executeQuery(string)
persistent class Create a list to hold all
1.3. new( ) retrieved data

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

Vous aimerez peut-être aussi