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

Re: db.createObject(...) and constructor with parameters?

On Wed, 26 Jan 2000, Lars Bergmann wrote:
> aClass anObject = new aClass(param1, param2, param3);
> How do you create objects with parameters in their constructor?
Currently there is now way.

The original ozone architecture assumes that obect do not leave the database
(server). So they also have to be created inside the server. The only way doing
this is Class.newInstance() which does not invoke the constructor. So there is
also no way to pass parameters to the ctor.

In ODMG objects are created by just calling "new ...". There is no
special API for creating database objects. Therefore we plan to let the proxy
constructor create an instance of the (database) object and file this instance
to the database. The proxies are generated code and so they do not need
newInstance() to create an object. 

Falko Braeutigam                         mailto:falko@softwarebuero.de
softwarebuero m&b (SMB)                    http://www.softwarebuero.de