[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a question for Falko



On Tue, 03 Jul 2001, yduchesne wrote:
> I Falko,
> 
> I am wondering why the fetch() method in ExternalDatabase as been 
> implemented as returning null, and why it used in the generated proxy 
> classes at all. Do you have future plans concerning that method? Or is 
> there something I miss (maybe another implementation of OzoneInterface that 
> is used inside the Ozone server...)? I am asking this because I'm in the 
> dev doc right now...

Yes, exactly - org.ozoneDB.Database (which implements OzoneInterface for in-VM
calls) returns non-null.

We started out with proxies that always send method id and params to the
invoke() methods of the different flavours of OzoneInterface, namly
ExternalDatabase for calls from a different VM and Database for in-VM calls.
Later we found that searching a java.lang.reflect.Method from the method name
is time consuming so we added a cache for already used Methods. Again later we
found that for in-VM calls we can avoid the entire reflection stuff by just
producing proxies that have the actual method invocation compiled right in! The
fetch() of Database (in-VM calls) returns the actual database object on which
the method will be called. If fetch() does return null (external calls) the
proxy uses the ordinary way and send method id and params to the invoke method.
Check the code of a proxy class, this probably clarifies this a bit more.

So, to make a long story short: it's performance optimization.


Falko
-- 
______________________________________________________________________
Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com


----------------------------------------------------------------------
Post a message:         mailto:ozone-dev@ozone-db.org
Unsubscribe:            mailto:ozone-dev-request@ozone-db.org?body=unsubscribe
Contact adminstrator:   mailto:ozone-dev-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/
----------------------------------------------------------------------