Tallinna Tehnika - PowerPoint PPT Presentation

About This Presentation
Title:

Tallinna Tehnika

Description:

enables full separation of business and persistence logic ... cursors. transactions. Object Query Language. distributed use. extent classes ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 18
Provided by: lap65
Category:

less

Transcript and Presenter's Notes

Title: Tallinna Tehnika


1
  • Tallinna Tehnikaülikool
  • Informaatikainstituut
  • Javal baseeruv objektide püsivuse kiht Jakamar
  • Bakalaureusetöö
  • Ãœliõpilane Erki Suurjaak
  • Matrikli nr 970772
  • Juhendaja Tarmo Veskioja

2
Defence Overview
  • What is object persistence
  • What solution did I propose
  • What is Jakamar
  • Benefits and tradeoffs

3
What is object persistence
  • objects existing beyond applications lifetime

Data Store
Application
4
Concerns using OOP and RDBMS
  • handling changes in the data structure
  • possible to reuse persistence logic

5
What solution did I propose
  • Persistence Broker design pattern
  • enables full separation of business and
    persistence logic
  • easily customizable for different applications
  • offers useful functionality, like object caching

6
Architecture
Simple architecture
Using a Persistence Broker
7
What is Jakamar
  • a reusable component
  • provides automated persistence

8
Jakamar in the thesis
  • architecture
  • program flow
  • functionality
  • error handling
  • security
  • concurrent use
  • logging
  • configuration

9
Benefits
  • Easier maintenance
  • Less program code to write access to persistence
    via simple operations like
  • store(object)
  • delete(object)
  • retrieve(query criteria)

10
Benefits (2)
Using Jakamar
Accessing the database directly
Connection connection DriverManager.getConnectio
n("jdbcodbcemt") Statement stmt
connection.createStatement() ResultSet rs
stmt.executeQuery("SELECT FROM PERSON WHERE
location 'Jõhvi'") Collection results new
ArrayList() while (rs.next()) Person person
new Person() person.id
rs.getInt("id") person.firstName
rs.getString("firstName") person.lastName
rs.getString("lastName") person.location
rs.getString("location") results.add(person)
Statement stmtSub connection.createStatement()
ResultSet rsSub stmtSub.executeQuery(
"SELECT FROM PHONE WHERE personId "
person.id) while (rsSub.next()) Phone
phone new Phone() phone.id
rsSub.getInt("id") phone.personId
rsSub.getInt("personId") phone.phone
rsSub.getString("phone") person.phones.add(ph
one) stmtSub.close() stmt.close() conne
ction.close()
PersistenceBroker broker PersistenceBrokerFact
ory.create("conf.xml") Person param new
Person() param.location "Jõhvi" Query query
broker.createQuery(param, new
String"location", null) Collection results
broker.retrieveCollection(query)
11
Tradeoffs
  • decrease in functionality
  • with embedded SQL,extremely complex queries
    accessible as easily as simple retrieval
  • with Jakamar, restrictions on query complexity

12
Benchmarks
  • better performance on object retrieval
  • worse performance on storing objects

Repeated? - whether the same operation was
repeated multiple times
13
Conclusion
  • the Persistence Broker pattern is a good approach
  • Jakamar is a viable component
  • faster development
  • better modularized application structure
  • possibly better performance on retrieval

14
(No Transcript)
15
Further development
  • cursors
  • transactions
  • Object Query Language
  • distributed use
  • extent classes
  • graphical configuration interface

16
Database
17
Object relations
Write a Comment
User Comments (0)
About PowerShow.com