db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: how should store get an object based on format id and collation id?
Date Mon, 16 Apr 2007 21:11:09 GMT

Daniel John Debrunner wrote:
> Mike Matrigali wrote:
>> Daniel John Debrunner wrote:
>>> Mamta Satoor wrote:
>>>> Hi Dan,
>>>> The problem we are trying to solve is provide a way to Store so that 
>>>> it can call a method (say it's called 
>>>> getInstanceGetterForFormatIDandCollationType) on DVF with format id 
>>>> & collation type and get an InstanceGetter for that combination. 
>>> Why use InstanceGetter here?
>> Current store code uses InstanceGetter's, should that not be the case?
>> As I have said the history of this predates when store knew it had
>> DVD's.  Is there no performance to be had by the current use of
>> InstanceGettor's where store makes one call get an InstanceGettor and
>> then muliple calls on it to allocate possibly many objects based off
>> of it?
> DVD's can also act as their own factory using getNewNull(), that would 
> be more efficient than InstanceGetter. As you say this change could have 
> been made once the switch to using DVDs consistently through the system 
> was done.
Ok, this answers a previous question I had posted.  Store currently uses
the following to get new "empty" instances of classes which will
subsequently be initiated by calls to readExternal():
dvd = dvd.getClass().newInstance()

It sounds like this should be replaced by:
dvd = dvd.getNewNull()

I thought there might be some waisted state setting done by getNewNull()
that might be saved by creating a new interface like dvd.getNewEmpty().

Given this we should also be able to eliminate store's direct use
of InstanceGetter, and change it to use a saved empty dvd to
be the factory.  This factory still needs to produce dvd's that
will support the same collation as the producing factory dvd, which
in the current proposal would have been originally created with
something like:

One time:
dvd =
DataValueFactory.getNewInstance(format id, collation id)

possibly MANY times to get objects that will be initialized by readExternal:
dvd = dvd.getNewNull()

As long as getNewNull() does the right thing, I think the only new interface
  store needs is the new DataValueFactory.getNewInstance(format id , 
collate id) interface.

> Dan.

View raw message