Object Oriented Persistence Middleware in Praxis - PowerPoint PPT Presentation

About This Presentation
Title:

Object Oriented Persistence Middleware in Praxis

Description:

change on DB may result in massive change on program. bound to one type of DB. 3 ... 2. Select/Insert/Update/Delete Data Row by Row. 5. Objects for DB operations ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 14
Provided by: schw75
Category:

less

Transcript and Presenter's Notes

Title: Object Oriented Persistence Middleware in Praxis


1
Object Oriented Persistence Middleware in Praxis
A Motivation B Concept C Objects for DB
operations D Mapper and Parameters E
Attribute mapping F building the SQL
Statements

2
Motivation (initial architecture)
  • low cost of implementation at first
  • change on DB may result in massive change on
    program
  • bound to one type of DB

3
Motivation (new architecture)
  • change on DB results only in change on access
    layer
  • only SQL builder is bound to type of DB
  • high cost of implementation at first

4
Concept
2-Way Concept
  • 1. Select a List of Indexes of Table
  • 2. Select/Insert/Update/Delete Data Row by Row
  • business object holds all relevant data of a table
  • navigation with First, Next, Last, Prev
  • LoadAll for loading of objects, internally only
    keys
  • when operating with object call to functions
    LoadCurrentObject, SaveCurrentObject,
    DeleteCurrentObject

5
Objects for DB operations
  • to perform BD operations with help of Mapper

6
SQL
  • z.B. SELECT
  • SELECT Table.Column AS ColumnName,
  • FROM Table,
  • WHERE Table.Column X AND
  • (ORDER BY Table.Column, )

7
Mapper and Parameters
  • to perform BD operations with help of Mapper

8
Attribute mapping
  • Table
  • Key 1 2 3
  • one attribute object represents one column
  • attributes name, columnname, tablename,
    datatype, iskeyattribute isprimarykey,
    joinattribute nullcolumn
  • all attributes to one table are stored in one list

must have unique property on single Column
9
Attribute mapping
10
building the SQL Statements
11
example code
  • procedure TIvuSelectSqlStatement.SetSqlSelect(aSql
    Objecte TObjectList)
  • var
  • i integer // interner Zähler
  • begin
  • Select Initalisieren
  • FSqlSelect ''
  • (Select-liste)
  • for i 0 to aSqlObjecte.Count - 2
  • do begin
  • if TSqlParameter(aSqlObjecte.Itemsi).Verbind
    ungsTyp svtAs
  • then begin
  • if TSqlParameter(aSqlObjecte.Itemsi).Wert.
    Count gt 0
  • then begin
  • FSqlSelect FSqlSelect
  • // Bezeichner
  • TSqlParameter(aSqlObjecte.It
    emsi).Bezeichner ' '
  • // AS
  • GetSqlStatementAs
    ' '

12
screenshots
13
screenshots
Write a Comment
User Comments (0)
About PowerShow.com