Solving the Java object storage problem - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Solving the Java object storage problem

Description:

ODMG is based on concept of database transparency ... Database db = odmg.getDatabase(null); // make persistent new object db.makePersistent(product) ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 11
Provided by: Imt80
Category:

less

Transcript and Presenter's Notes

Title: Solving the Java object storage problem


1
Solving the Java object storage problem
  • By Imtiyaz Ahmed Qureshi

2
Problem in Object storage
  • It is not possible to manipulate an individual
    object
  • Object serialization lacks fundamental database
    capabilities
  • Persistence can be defined as a network of
    persistent
  • objects whose root is serializable. Any
    object
  • that a persistent object can touch
    automatically
  • becomes persistent and thus a member of the
    network.

3
ODMG Binding
  • The ODMG binding for Java and JDBC is good
    alternative for persistent object development
    with Java.
  • The ODMG Binding for Java specification enables
    developers to simply and easily build
    cross-platform Java applications that
    automatically store Java objects in database
  • ODMG is based on concept of database transparency
  • It allows the developers to manipulate with
    Database

4
products that presently support the ODMG Java
Binding
5
Object manipulation language (OML)
  • The Java Object Manipulation Language (OML) is
    the set of classes and other constructs that are
    added to the Java environment to support the ODMG
    object model with collections, transactions, and
    databases.
  • To use the ODMG binding, the developer specifies
    persistent Java classes. The database then
    automatically stores instances of persistent
    classes

6
The Architecture of An ODMG Application
7
Costume adopter classes
8
Initializing ODMG
  • Implementation odmg OJB.getInstance()
    Database db odmg.newDatabase()
    db.open("default", Database.OPEN_READ_WRITE) /
    ... use the database ... / db.close()

9
Persistant new objects
  • public static void storeNewProduct(Product
    product)
  • // get the used Implementation instance
  • Implementation odmg ...
  • Transaction tx odmg.newTransaction()
  • tx.begin() // get current used Database instance
  • Database db odmg.getDatabase(null) // make
    persistent new object db.makePersistent(product)
  • tx.commit()

10
  • Thank you
Write a Comment
User Comments (0)
About PowerShow.com