Objy permits you to develop database applications written in C++.
A given application can handle only one Federation. The usual steps to
do that are the following:
-
Create your Federated Database
with the administration tool oonewfd
(see 3. Objy Adm. tools).
-
Design your data model:
Identify the objects of your application header files (.h)
that you want to be persistent and make them
inherit from the ooObj class: e.g.
if you take a look at PHENIX PdbObjyCalBank
file you find things like: class PdbObjyCalBank
:
public ooObj, public PdbCalBank { ...};
-
Rename the header files to .ddl
[the Data Definition Language
DDL
is basically C++ plus a few syntactic extensions for things like object
relationships through "to-one"/"to-many" associations ...]. Those DDL files
contain persistence-capable class declarations and associations among them.
Replace C++ pointers by DDL object references.
-
Preprocess your DDL
data model files with ooddlx. The
prepocessor ooddlx generates
i)
the
database schema (myschema.ddl) which
is also added to the system Federation file; and ii) the
headers (MyApp.h and MyApp_ref.h)
and code (MyApp.cxx) files which
make the schema (the information about an object which the database must
maintain) available to your C++ application. (From there on, your database
will "know" about the type of your objects).
-
Now you can complete the source code for your
application (one uses standard functions like e.g. ooref(myclass)
and
oohandle(myDB) to interact with
Objy persistent objects and perform database operations ...).
-
Compile your C++ application source file (e.g.
PHENIX PdbObjyApplication.hh
and PdbObjyApplication.cc)
and the data model source files (e.g. PHENIX PdbObjyCalBank).
-
Link your compiled application code and compiled
data model code with Objy runtime libraries.
To know more precisely how to add your own classes to an Objy database
take a look at 5. Adding your own classes to the PHENIX Federation.
Previous:
1.
Objectivity/DB basic objects and definitions | 2. Developping
with Objy (overview) |
Next: 3. Objy Administration
Tools.
enterria@in2p3.fr,
denterri@bnl.gov
Last
modified: Tue Nov 8 19:50:16 EDT 2000