java binding for oodb

13
Java Binding for OODB JDBC, SQLJ – Data-centric Java Binding for OODB Programming objects-centric ODMG 2.0 Object Model, ODL, OQL, OOPL Does not define a common OML • Mapping ODMG Object Model, Java ODL, Java OML, Java OQL POET 5.0

Upload: tess98

Post on 11-Nov-2014

1.010 views

Category:

Documents


6 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Java Binding for OODB

Java Binding for OODB

• JDBC, SQLJ– Data-centric

• Java Binding for OODB– Programming objects-centric

• ODMG 2.0– Object Model, ODL, OQL, OOPL– Does not define a common OML

• Mapping– ODMG Object Model, Java ODL, Java OML, Java OQL

• POET 5.0

Page 2: Java Binding for OODB

ODMB Java Binding

• ODMG Java Binding– As a single language

• A single unified type system• Conform to the java language syntax• Automatic memory management

– ODMG 2.0 dos now define• How a java class become a persistence-capable class

– Transparent persistence support• Postprocessor

– Java .class file (bytecode)• Preprocessor

– Modifies the Java Source

Page 3: Java Binding for OODB

Mapping of the ODMG Object Model

• ODMG Object Model– Based on OMG Object Model

• Not yet supported– Extents, Keys, Relationships, Access to meatdata

• Types– ODMG interface == Java interface– ODMG class == Java Class– ODMG is-a relationship == Java extends– Is-a relationship between classes and interface

• Java implements

Page 4: Java Binding for OODB

Mapping of the ODMG Object Model

• Objects– Java root objects

• Java ODL– Object-oriented database schema as a set of java classes– Attributes

• Field declaration– Operations

• Method declaration

• Java OML– Create, delete, reference, get/set field values– Invoke method on a persistent(database) object– Attributes

• Accessing attributes– Operations

• Mapped to method

Page 5: Java Binding for OODB

Object Life Cycle

• Begin processing– Accessing one or more of the root objects

• Persistent• Entry point to the database

• Persistence– Transient object

• Referenced by a persistent object

• Modification to persistent object– Transaction committed

• Automatically removed– Neither named nor referenced by any other

persistent object

Page 6: Java Binding for OODB

Collection Interfaces

• Java OML provides– Public interface Set extends Collection { .. }– Public interface Bag extends Collection

{ .. }– Public interface List extends Collection { .. }

• Collection interface– Page 178

Page 7: Java Binding for OODB

Transactions

• All creation, access and modification of persistent object– Within a transaction

• Implement Java OML as object– Page 178

• Thread ca be used with transaction– Exactly one thread under exactly one transaction– Multiple thread each with its own separate transaction

• Must not pass object from one thread to another– Multiple thread may share one or more transactoin

• Using Java synchronization

Page 8: Java Binding for OODB

Database Operations

• Java OML as objects of the Database class– Page 179

• No constructor provided– Open() to create and open a database– Bind()

• Manipulate ob object• Binding transient object to a name make that

object persistent

– Lookup()• Access an object by name

Page 9: Java Binding for OODB

Java OQL

• Full functionality of OQL is available• Collection interface provides

– Public Object selectElement(String predicate);– Public boolean existsElement(String predicate);– Public Enumeration select(String predicate);– Public Collection query(String predicate);

• Predicate is a string with the syntax of the WHERE

• OQLQuery class– To create a query, pass parameters, execute the q

uery, get the result– Page 180

Page 10: Java Binding for OODB

POET 5.0

• POET Java SDK– ODMG Java Binding– Preprocessor approach

• Java source to add persistence support• Create the schema and database for persistent

object

• POET database– Dictionary

• Contain information about the structure of persistence-capable classes

– Database• Persistent object stored

• Extents, Keys, and Names

Page 11: Java Binding for OODB
Page 12: Java Binding for OODB
Page 13: Java Binding for OODB