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

Re: Some small Q's



On Thu, 23 Mar 2000, you wrote:
> After some classpath obstacles i finally managed to create a database
> storing  Person objects. Hurray!
> Some questions did come up on the way:
> 
> 1: This is maybe an easy one, and i'm sure i'm overlooking something - of
> course :), but when PersonImpl.class.getName() is called i cant find any
> static class-variable called class. I assume this is a variable of Class
> type....where is it
> located?
'TypeName.class'  is the standard Java way of getting a Class object out of
the literal type. This isn't ozone specific.

> 
> 2: About unique keys.
> When i create an object on the server using createObject i find three
> different overloaded methods called createObject(...), one of them defines
> the className, access and the name of the object. But when I use the the
> first alternative, which just pass the className of the remoteObject to the
> server, noone asks for a unique key/name. What kind of unique key is
> assigned to that object?
> Is there any automatic generation of unique keys (like autoincrement)? (I
> see its possibly to get all objects of a class using objectsOfClass(..),
> maybe i'll find it there when i get it working :))
The server is responsible for providing each objects with an unique object ID
(unique key). This ID is not accessible (or should not) by the client. You
don't not need to deal with them. There is no API that uses OIDs. 

Besides the automaticly assigned OID you may assign a name to an object.
(completely independent) Such an object is often called a 'root object' because
it's the starting point of traversing the object graph (objectForName()).

BTW: objectsOfClass() has been lying around since the beginning. It seemed to
be a good idea to have such a method but I didn't need it all the time. It
would let you use classes as collections. But this exactly is not the way
classes should be used in ozone. To make a long story short: it's not
implemented ;)


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