assign() method
with a wafer object.
The database is run with the
The class jCorbaDatabase is the application
class and is invoked via the run script.
The implementation of the actual database
table class relies on the Java Hashtable.
The methods involve the get() and put()
methods and the containsKey(), etc. for that class.
As usual in CORBA, we are uninterested in these details from the
persecpctive of remote services. The implementation is encapsulated
and we only see the IDL-specified methods.
Implementing this class which holds the objects
is trickier in Java than it might be due
to the lack of multiple inheritance.
We would like to inherit the methods for a basic
database as well as the skeleton for the CORBA
utilities.
The simplest approach in this case is to
have all the methods locally and extend the CORBA skeleton
SServices._WaferDatabaseImplBase generated by compiling
the IDL.
Using helpers and holders allows us to extend once class and
accessing the CORBA skeleton to provide the marshalling across remote invocation.
To compile both Java and C++ bindings for this IDL module, given the command
This is contained in the file JavaDatabase/database.idl of the distribution.
module SServices {
typedef sequence<string> StringSequence;
interface ObjectDatabase {
// store the object obj using the specified name.
boolean assign(in any obj, in string name);
// query whether there is an entry in the table
// with the given name.
boolean exists(in string name);
// retrieve the object stored under the specified name
any get(in string name);
// return a sequence/array of all the names used in the
// table to index the objects.
StringSequence objects();
// remove the entry from the table for the specified name.
boolean remove(in string name);
// remove all the entries in one step.
boolean clear();
};
};
Compiling this file using OmniBroker generates
several files listed below.
These will be created in the SServices subdirectory
of the directory in which the .idl file
is located.
objects()keys()
method of the included Hashtable
to an array of String objects.
Again, this is much of what happens in CORBA - convert data from one
format to an acceptable format for the client/target object.
assign()
The object being stored in the database is presented from a client
invoking the assign() method. Thus the data for the object
lies outside of the database and the latter just has a reference to
the object. This can be overcome by serializing the object
or cloning it locally in the database, if supported.
Different cloning mechanisms are available - the low-level CORBA clone
or a WaferDatabase specific method to copy the fields of the
Wafer object (identifiable from the Wafer
IDL description).
get()CORBA.Any.
Since the hashtable stores Java Objects and is a simple generic
container,
there is no additional processing to convert the resulting object to
a known type. The client performs this action when it receives the
object.
The return value is simply a reference to a remote object
since the object does not reside in the database in the current
implementation. See assign() for more details
on this.
exists()containsKey() method of java.util.Hashtable.
remove()clear()We extend the ObjectDatabase class in IDL to produce a WaferDatabase class. This provides additional methods to get access to components and computations of a specific wafer identified by its name used in the database. The IDL is below and illustrates the idea of inheritance. (The name of the module (SServices) is coincidentally the same as that for the container of the ObjectDatabase interface above. This is neither necessary or probably desireable as there are now two packages with the same name in Java, leading to potential confusion.)
module Sequences {
typedef sequence DoubleSequence;
typedef sequence StringSequence;
typedef sequence LongSequence;
};
The WaferDatabase class is defined as follows:
// include the ObjectDatabase module
#include "database.idl"
// include a local Sequences definition which we use temporarily
// until we have definitions of Generic Data Types for statistical
// computing.
#include "Sequences.idl"
module SServices {
interface WaferDatabase : SServices::ObjectDatabase {
// Compute the yield for a given lot returning
// the frequencies/counts of the different failure
// types/modes.
Sequences::DoubleSequence yield(in string wafer_name);
// The following are utility methods to allow a client
// retrieve attributes of a wafer by identifying
// the object by name rather than a two step
// approach of retrieving the object (and narrowing it)
// and then retrieving the data slot from the Wafer object.
// At present these are used to avoid having to deal with the
// Wafer object. This is not very difficult but more than we wanted
// to do.
void assignWafer(in string name,
in Sequences::LongSequence x,
in Sequences::LongSequence y,
in Sequences::StringSequence values,
in Sequences::StringSequence modes);
Sequences::StringSequence getValues(in string wafer_name);
Sequences::LongSequence getX(in string wafer_name);
Sequences::LongSequence getY(in string wafer_name);
Sequences::StringSequence getModes(in string wafer_name);
};
};
yield()doubles indicating the yield
for each wafer in the lot. The length of the sequence
is the number of wafers in the lot.
This allows the computations to be done locally in the database
where the data resides rather than moving the data to a client and then
performing the computations. In this sense it is an efficiency
specialization that illustrates the power of the Object Oriented
Remote Server approach.
The implementation of this method of course relies on the
representation of the wafer object. In order to do this,
we define yield() as a method in the IDL class
defining a Wafer.
Again, the encapsulation allows the database to know very little about
the structure or contents of the objects it stores.
assignWafer