Re: objectsOfClass-Method vs. Class-Extents?

"Leo Mekenkamp" <[email protected]> Wed, 21 Dec 2005 17:26:54 +0100 (CET)
Newsgroups gmane.comp.java.ozone.user
Message-ID <[email protected]>
>> > Don't getting all objects of a type is no good, though:-(
>>
>> And what equivalent would you use to retrieve all instances of a class
> in
>> a standard jvm without a database? IMHO an ideal database is just a
>> logical extention of the jvm; one should be able to use just pure java
> to
>> find objects.
>
> Thanks for your answer, Leo.
> Since I'm no Java-expert (yet), please say if I write something stupid:=
-)

Oh believe me, I will! ;-)

> I believe there is no native feature in Java to get all instances of a
> type. But I could add all instances to a collection managed by my own.
> Probably this collection could be a static attribute of the class, I ne=
ed
> an extent for. But this could be a problem, since static attributes wil=
l
> not be serialized which means they will not be persisted in Ozone, I
> suppose.

Yup. But you can always put (references to) objects into an
(Ozone)collection, and make that collection a named object.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick