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

Re: Ozone object identity...



> > In this requirement, we only need something unique with in an instance
> > of Ozone database.
> 
> Have I completely misunderstood the Ozone architecture?
> I thought a simple Java reference to an Ozone object would be unique
> within an Ozone database...
> In my eyes, the identity object is needed only for refering from an
> external VM.
> 

The object ref accessible by the Ozone programmer are in fact proxy
itself. Just do a type dump on the object receive in your Ozone object
impl. It's actually of type OzoneProxy implementing  the your ozone
object interface.

Using object ref to a proxy has two problems.

1. The object ref is not persistent. It change from time to time.

2. The object ref value doesn't reflect the identity of the real object.
You can have two object ref point to two different proxy object which
actually point to the same ozone object. 

> > > My suggestion was to use Object as the minimal interface
> > > for the identifier, so that the API wouldn't be locked to
> > > a particular identity class for all future.
> > >
> 
> Identities of persistent objects have to be at least Serializable,
> of course.
> 

Thanks. :) 

> What about a method to convert a String representation of the identity
> to the identity (or to the object)?
> 

Hmm... That's true. I totally forget about this.

> One other argument for not using String as the identity:
> The reference could be passed from one client to another.
> On the other client, it would not be pooled with intern(),
> so the == comparison would fail.
> 

Well... The == operator only hold while use in the context of

ozOne.identity() == ozTwo.identity()

A client receive a String named identity doesn't automatically make the
string a identity. 

> Remember that the identity can not be GEU in all cases, e.g.
> when using a local database or a RemoteDatabase in an intranet.
> The identity can store as many informations as possible about the
> object location, but global uniqueness is not ensured.

Depending on how we name the object, it would be globally unique. Using
fully qualified hostname is a good beginning to ensurce such. Very few
companies would duplicate the hostname with in their domain. (those who
do should fire their MIS). This is how DNS get globally unique hostname
out of distributed administrated hosts table.



David Li
DigitalSesame