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

Re: List of all the objects stored.

On Tue, 18 Apr 2000, Mahesh Halyal wrote:
> How do I get the names of all the objects stored
> in a database ?

Basically ozone provides transactions and persistency over the ordinary Java
object model. Personally I see the object names as a practical solution
rather than an 'regular' extension to the object model. Two reasons for that:

1. methods like getAllNamedObjects() would let you use named object as a
collection which is not intended and could lead to buggy programs. You are not
guaranteed to be the only user of the db that create named objects!

2. if we introduce one method or API to access meta info, there is no reason
why we don't support others (objectsOfClass(), ...WithField(),...) but this is
definitely not the way to program an OODBMS.

So, if you don't want to develop an admin tool for ozone or something similar,
then for your example it is maybe better to add a 'name' member to your class
and hold all objects of the class in a collection. This collections should be a
member of a actually named object root object.

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