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

Re: Why *Impl_Proxy generated from *Impl?



Hi there,

Thanks for the answer . . .

> > So ... why is the proxy class generated from the implementation?
>
> An *Impl class can implement several remote interfaces (OzoneRemote
> interfaces).

Ah, I see. And you're right. And, in fact, with CORBA and RMI, given --

  interface PersistentObject {}
  interface Employee {}

if you want to expose to the client that a single object implements both 
interfaces, you have to come up with a third interface --

  interface PersistentEmployee 
    extends Employee, PersistentObject 
  {}

and then build your proxies from PersistentEmployee. It sometimes feels a 
little tedious.

Another case where the "proxies from interfaces" approach can seem tedious is 
that you then cannot have constructors in the proxies. It forces you to come 
up with "factory" interfaces --

  interface PersistentEmployeeFactory {
    PersistentEmployee create(String name, int salary);
    PersistentEmployee create(String name);
    PersistentEmployee create();
  }

and then bind instances of these to some well-known location (like a 
persistent named root). This can seem counterintuitive and messy. In the 
current Ozone approach, the client is aware of the actual implementation 
class (say, 'BusImpl'), and so can create instances of it directly  --

  Bus bus = (Bus)db.createObject( BusImpl.class.getName() );

     *  *  *  *  *

It seems I've spent the whole email arguing in favor of the Ozone approach. 
:) And maybe that's how it should be.... Apart from the fact that I'm just 
used to RMI/CORBA, I think the "proxies from interfaces" approach is in some 
way more "minimalistic" -- which may be good or bad, I don't know.

Thank you again and peace,

Ihab Awad

-- 
Ihab A Awad <ihab@ahc.umn.edu>
Center for Computational Genomics and Bioinformatics,
University of Minnesota. http://www.cbc.umn.edu/~ihab/
----------------------------------------------------------------------
Post a message:         mailto:ozone-users@ozone-db.org
Unsubscribe:            mailto:ozone-users-request@ozone-db.org?body=unsubscribe
Contact administrator:  mailto:ozone-users-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/
----------------------------------------------------------------------