Tải bản đầy đủ (.ppt) (23 trang)

Tài liệu Less05- Identify Design Mechanisms doc

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (201.27 KB, 23 trang )

1
Rational
Proprietary and
Confidential
Object Oriented Analysis and Design
Using the UML
Module 5: Identify Design Mechanisms
Module 5: Identify Design Mechanisms
2
Rational
Proprietary and
Confidential
Objectives: Identify Design Mechanisms

Understand the purpose of the Identify Design
Understand the purpose of the Identify Design
Mechanisms activity and understand when in the
Mechanisms activity and understand when in the
lifecycle it is performed
lifecycle it is performed

Explain what Design and Implementation Mechanisms
Explain what Design and Implementation Mechanisms
are and how they map from Analysis Mechanisms
are and how they map from Analysis Mechanisms

Understand some key mechanisms that will be utilized in
Understand some key mechanisms that will be utilized in
the case study
the case study
3


Rational
Proprietary and
Confidential
Identify Design Mechanisms in Context
Architect
Identify
Design
Mechanism
s
4
Rational
Proprietary and
Confidential
Supplementary
Specifications
Software Architecture
Document
Design Model
Design Model
Design
Guidelines
Analysis Classes
Identify Design Mechanisms Overview
Identify Design
Mechanisms
5
Rational
Proprietary and
Confidential
Identify Design Mechanisms: Steps


Categorize clients of analysis mechanisms
Categorize clients of analysis mechanisms

Document architectural mechanisms
Document architectural mechanisms
6
Rational
Proprietary and
Confidential
Identify Design Mechanisms: Steps

Categorize clients of analysis mechanisms
Categorize clients of analysis mechanisms

Document architectural mechanisms
Document architectural mechanisms
7
Rational
Proprietary and
Confidential
Identify Design Mechanisms: Steps

Pattern
Pattern

A common solution to a common problem in a context

Analysis/Design Pattern
Analysis/Design Pattern


A solution to a narrowly-scope technical problem

A fragment of a solution, or a piece of the puzzle

Framework
Framework

Defines the general approach to solving the problem

Skeletal solution, whose details may be analysis/design patterns
8
Rational
Proprietary and
Confidential
What Is A Design Pattern
A design pattern provides a scheme for refining the subsystems
A design pattern provides a scheme for refining the subsystems
or components of a software system, or the relationships
or components of a software system, or the relationships
between them. It describes a commonly-recurring structure
between them. It describes a commonly-recurring structure
of communicating components that solves a general design
of communicating components that solves a general design
problem with a particular context.
problem with a particular context.
-
-
Erich Gamma, Richard Helm, Ralph Johnson and John
Erich Gamma, Richard Helm, Ralph Johnson and John





Vlissides 1994.“Design Patterns – Elements of Reusable Object-Oriented
Vlissides 1994.“Design Patterns – Elements of Reusable Object-Oriented
Software”
Software”
9
Rational
Proprietary and
Confidential
Review: Why Use Analysis Mechanisms?
Oh no! I found a group of classes that has
persistent data. How am I supposes to
design these things if I don’t even know
what database we are going to be using?
That is why we have a persistence analysis
mechanism. We don’t know enough yet,
so we can bookmark it and come back to it
later
Analysis mechanisms are used during analysis to reduce the complexity of
analysis, and to improve its consistency by providing designers with a
short-hand representation for complex behavior.
10
Rational
Proprietary and
Confidential
Categorize Analysis Mechanisms


Purpose
Purpose

To refine the information gathered on the analysis mechanisms

Steps
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
11
Rational
Proprietary and
Confidential
Identify Design Mechanisms: Steps

Categorize clients of analysis mechanisms
Categorize clients of analysis mechanisms

Documentation architectural mechanisms
Documentation architectural mechanisms
12
Rational
Proprietary and

Confidential
Design and Implementation Mechanisms
Analysis Design Implementation
Remote Method
Invocation (RMI)
Persistency
Analysis
Mechanism
(Conceptual)
Design
Mechanism
(Concrete)
Implementation
Mechanism
(Actual)
OODBMS
RDBMS JDBC
ObjectStore
Java 1.2 from Sun
Legacy Data
New Data
Distribution
Persistency
13
Rational
Proprietary and
Confidential

Architectural Mechanisms can be treated as patterns (i.e.,
Architectural Mechanisms can be treated as patterns (i.e.,

stereotyped parameterized collaboration)
stereotyped parameterized collaboration)
Review: Documenting Architectural Mechanisms
Structural Aspect
Behavioral Aspect
Pattern Name
Template
Parameters
Documented in Design Guidelines
14
Rational
Proprietary and
Confidential
Review: Course Registration Analysis Mechanisms

Persistence
Persistence

Distribution
Distribution

Security
Security

Legacy Interface
Legacy Interface
15
Rational
Proprietary and
Confidential

Design Mechanisms: Persistency: RDBMS: JDBC

Persistence characteristics
Persistence characteristics

Granularity

Volume

Duration

Access mechanism

Access frequency (creation/deletion, update, read)

Reliability
Note: JDBC is the standard Java API for taking to a SQL database
16
Rational
Proprietary and
Confidential

ResultSet
getString() : string
(from java.sql)
Connection
createStatement() : Statement
(from java.sql)
Statement
executeQuery(sql : String) : ResultSet

executeUpdate(sql : String) : int
(from java.sql)
DriverManager
getConnection(url, user, pass) : Connection
(from java.sql)
DBClass
create() : PersistentClass
read(searchCriteria : string) : PersistentClassList
update(c : PersistentClass)
delete(c : PersistentClass)
<<role>>
1
1
PersistencyClient
(from SamplePersistency Client)
<<role>>
PersistentClass
getData()
setData()
command()
new()
(from SamplePersistentClass)
<<role>>
PersistentClassList
new()
add(c: PersistentClass)
(from SamplePersistentClass)
<<role>>
0 *
1

0 *
1
Roles to be filled by the
designer applying the
mechanism
Example: Persistency: RDBMS: JDBC
17
Rational
Proprietary and
Confidential
Example: Persistency: RDBMS: JDBC: Initialize
: DBClass :
DriverManager
1. getConnection(url, user, pass)
18
Rational
Proprietary and
Confidential
Example: Persistency: RDBMS: JDBC: Create
: Connection : Statement :
PersistencyClient
: DBClass :
PersistentClass
1. create( )
1.1. New()
1.3. createStatement( )
1.4. executeUpdate(String)
1.2. getData( )
19
Rational

Proprietary and
Confidential
Example: Persistency: RDBMS: JDBC: Read
: Connection : Statement : ResultSet :
PersistencyClient
: DBClass :
PersistentClass
:
PersistentClassList
1. read(string)
1.1. createStatement( )
1.2. executeQuery(string)
1.4. new()
1.5. getString( )
1.6. setData( )
called for each
attribute in the
class
returns a
Statement
1.3. new( )
Create a list to hold all
retrieved data
1.7. add(PersistentClass)
Add the retrieved course offering
to the list to be returned
Repeat these operations for
each element returned from
the executeQuery()
command.

The PersistentClassList is
loaded with the data retrieved
from the database.
The SQL statement
built by the DBClass
using the given
criteria is passed to
executeQuery()
The criteria used to
access data for the
persistent class
20
Rational
Proprietary and
Confidential
Example: Persistency: RDBMS: JDBC: Update
: DBClass :
PersistencyClient
:
PersistentClass
: Connection : Statement
1. update(PersistentClass)
1.2. createStatement( )
1.1. getData( )
1.3. executeUpdate(string)
execute SQL
statement
21
Rational
Proprietary and

Confidential

:
PersistencyClient
: DBClass : Connection : Statement
1. delete(PersistentClass)
1.1. createStatement( )
1.2. executeUpdate(string)
execute SQL
statement
Example: Persistency: RDBMS: JDBC: Delete
22
Rational
Proprietary and
Confidential
Deferred
Incorporating JDBC: Steps

Provide access to the class libraries needed to implement JDBC
Provide access to the class libraries needed to implement JDBC

Provide java.sql package

Create the necessary DBClasses
Create the necessary DBClasses

One DBClass per persistent class

Incorporate DBClasses into the design
Incorporate DBClasses into the design


Allocate to package/layer

Add relationships from persistency clients

Create/Update interaction diagrams that describe:
Create/Update interaction diagrams that describe:

Database initialization

Persistent class access: Create, Read, Update, Delete
23
Rational
Proprietary and
Confidential
java.sql
ResultSet
(from java.sql)
Connection
(from java.sql)
Statement
(from java.sql)
DriverManager
(from java.sql)
Sample
Persistency
Client
Package
Example: Incorporating JDBC

×