a Delphi Framework - PowerPoint PPT Presentation

About This Presentation
Title:

a Delphi Framework

Description:

Each Value Object (encapsulating a table/View) has its own BLO. ... Receives client's requests and maps them to the proper BLO's method. Data mapping: ... – PowerPoint PPT presentation

Number of Views:123
Avg rating:3.0/5.0
Slides: 21
Provided by: richp3
Category:
Tags: blo | delphi | framework

less

Transcript and Presenter's Notes

Title: a Delphi Framework


1
a Delphi Framework
  • Isaac Prado

2
About me
  • Software Architect at Chase Cooper LTD.
  • Background in Java/J2EE
  • New to the Delphi world
  • RemObjects, IntraWeb, DbGo.

3
About the presentation
  • Share our Experience.
  • DF Background.
  • The DF
  • Business Logic as Modular Components
  • Service components.
  • The source builder.
  • Samples
  • Simple table management (Add/Amend/Delete).
  • Advanced sample Check Out Shopping Cart.

4
Background problem 1
DB Svr
App. Server
Web Server
DSPRV BLO DB Access
CDS
IWForm
DSPRV BLO DB Access
CDS
IWForm
DSPRV BLO DB Access
CDS
IWForm
DSPRV BLO DB Access
CDS
IWForm
  • Not modular/reusable Business Logic.
  • Client connection, Logic and DB access in the
    same unit.
  • Client/DB dependency.

5
Background problem 2
  • No service components.
  • No base components to provide with non functional
    services
  • Security.
  • State Management.
  • DB connectivity
  • Scalability
  • No clear distinction between code implementing
    functional and non-functional requirements.

6
BackGround
  • Consequences
  • time on developing BL is not very optimized.
  • Developers cant reuse functionality.
  • Too much time on technical issues.
  • After several months of development
  • Spaghetti code.
  • Duplicated code (duplicated bugs).
  • Expensive to maintain.
  • New requirements expensive to achieve
  • For example Different DB vendor.

7
Delphi Framework
  • Main Goal
  • Allow developers to concentrate in business logic
    development.
  • Build robust, scalable and maintainable Delphi
    applications.
  • Service Level Components
  • Persistence Engine, transaction, security,
    session management, shopping cart management
    etc. Developers can use these services directly.
  • Develop BL as modular components
  • Guidelines for implementing business logic as
    modular and reusable components.

8
Service Level Components (I)
Web Server
App. Server
Application Business Logic
Application - GUI
Context (Service API)
Session (Service API)
Cache
Cache
Log
Persistence engine
Trn Man.
Navigator
Server connectivity
Authentication
Authorisation
eMail
User State Man. (Shopping Cart)
DB connection
9
Service Level Components (II)
  • Context
  • One instance per each thread (user request).
  • Provides access to service components.
  • Keeps connection to DB and Transactional Status.
  • Persistence Engine
  • DAO implementation.
  • Generates and executes SQL statements.
  • Current implementations for SQLServer2000 and
    Oracle 9i.
  • Trn. Manager.
  • Coordinates execution of commands on Service
    components with DB transaction status.

10
Developing BL as Modular Components (I)
  • Old Approach

DB Svr
App. Server
Web Server
DSPRV BLO DB Access
CDS
IWForm
  • New Approach

DB Svr
App. Server
Web Server
DSPRV
CDS
IWForm
BLO
ADO
11
Developing BL as Modular Comps (II)
  • DAO
  • Interface to the Persistence Engine.
  • Responsible for accessing to the DB.
  • Generates and executes SQL statements.
  • Performs basic SQL operations as insert, delete,
    amend and select.
  • Provides with DB Independency.
  • Uses Value Objects
  • A V.O. encapsulates a table or view of the DB.

12
Developing BL as Modular Comps (III)
  • Business Logic Object
  • Implement the business rules of the system
  • Accesses DAOs to perform operations on the DB and
    other BLOs to reuse their functionality.
  • Must be reusable
  • Paramenters/return values must be
    client-independent.
  • Note mdf uses internal data type wrappers
  • Each Value Object (encapsulating a table/View)
    has its own BLO.
  • Each BLO contains the basic operations Insert,
    Update, Delete and Select.

13
Developing BL as Modular Comps (IV)
  • Business Logic Object
  • BLO_Order
  • Insert
  • Delete
  • Amend
  • Select

VO_Order
DAO
14
Developing BL as Modular Comps (IV)
  • Business Logic Object
  • BLO_Order
  • Insert
  • Delete
  • Amend
  • Select

VO_Order
DAO
  • BLO_OrderItem
  • Insert
  • Delete
  • Amend
  • Select

VO_OrderItem
15
Developing BL as Modular Comps (V)
  • Business Logic Object
  • BLO_Order
  • Insert
  • Delete
  • Amend
  • Select

VO_Order
DAO
  • FACADE_Order
  • CheckOut
  • BLO_OrderItem
  • Insert
  • Delete
  • Amend
  • Select

VO_OrderItem
16
Developing BL as Modular Comps (V)
  • Provider
  • Communication with the Web tier.
  • DataSnap (TDataSetProvider)
  • RO service if the client uses RemObjects.
  • Receives clients requests and maps them to the
    proper BLOs method.
  • Data mapping
  • Convert from Client Dependant types to DFs
    internal representation.
  • Context object Creation/Deletion.

17
The source builder Tool.
  • Extracts DB schema and generates
  • Value Objects
  • BLO
  • DataSnap components (CDS and DSPrv).
  • Client Data Set.
  • IW form.

18
Examples
  • Order System (Show prototype).
  • Simple Table management.
  • Check Out Shopping Cart

19
Samples Simple Table Management
  • Manage table ProductType.
  • Create functionality
  • Add, Amend, Delete Product Type.
  • View Code Generated.

App. Server
Web Server
BLO
DSPrv
CDS
IWForm
Value Object
Value Object
20
Samples Check Out Shopping Cart
  • Check Out Items in shopping Cart.
  • Create new entry in orders table.
  • For each Shopping cart item, create a
    OrderItems entry.
  • Send a confirmation email and delete shopping
    cart.

App. Server
BLO Orders
Insert
RO PRV
Façade User State Manager
BLO Order Items
Checkout SP
Insert
Context
Get
send message
Get Current
Shopping Cart
User State Manager
Trn Manager
Log Manager
Write a Comment
User Comments (0)
About PowerShow.com