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
2Defence Overview
- What is object persistence
- What solution did I propose
- What is Jakamar
- Benefits and tradeoffs
3What is object persistence
- objects existing beyond applications lifetime
Data Store
Application
4Concerns using OOP and RDBMS
- handling changes in the data structure
- possible to reuse persistence logic
5What 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
6Architecture
Simple architecture
Using a Persistence Broker
7What is Jakamar
- a reusable component
- provides automated persistence
8Jakamar in the thesis
- architecture
- program flow
- functionality
- error handling
- security
- concurrent use
- logging
- configuration
9Benefits
- Easier maintenance
- Less program code to write access to persistence
via simple operations like - store(object)
- delete(object)
- retrieve(query criteria)
10Benefits (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)
11Tradeoffs
- decrease in functionality
- with embedded SQL,extremely complex queries
accessible as easily as simple retrieval - with Jakamar, restrictions on query complexity
12Benchmarks
- better performance on object retrieval
- worse performance on storing objects
Repeated? - whether the same operation was
repeated multiple times
13Conclusion
- 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)
15Further development
- cursors
- transactions
- Object Query Language
- distributed use
- extent classes
- graphical configuration interface
16 Database
17Object relations