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

Re: Object Creation in ozone



On Fri, 11 Aug 2000, Don Berendsen wrote:
> In my application objects often initialize their state by creating other 
> objects in their constructor.
> 
> However when creating an OzoneObject ObjectOne whose constructor (see 
> example below) initiates the creation an OzoneObject ObjectTwo, calling 
> createObject(ObjectOneImpl....) returns an ObjectTwoImpl_Proxy instead of an 
> ObjectOneImpl_Proxy.
> 
> Is there a way to get the correct createObject() return value while doing 
> nested object creation such as this?
> 
> cheers,
> 
> don
> 
> 
> example ObjectOne constructor:
> 
> public ObjectOneImpl(){
>       try {
>         obj2 = (ObjectTwo) Repository.getDatabase().createObject          
> (ObjectTwoImpl.class.getName(),0, null);
>       } catch (Exception e) {
>         System.out.println(e);
>       }
>     }

Hmmm... where does the static getDatabase() of Repository get the database
object from? The implementation of such a method has to check if the class
lives in the server or the client. (there is no documented way to do so)
Setting a static member of Repository that holds the client's database object
will not work because the ctor of the database object is called on the server
side. Don, can you send the code of Repository.getDatabase()?


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