OK well here is my thinking (which I am happy to discover may be flawed ;-)
BusinessObjectB does not meet the criteria for a "remotable" interface does
it ? in RMI ? in CORBA ?
So how can I return BOB from a method that may be invoked remotely ?
I'll state my need in another way
What if I wish to write an implementation object that doesn't know or care
if it is using RMI or CORBA or RMI/IIOP at runtime or not? The code need to
know about generic "remoteness" issues, but shouldn't need to know about Tie
delegates or UnicastRemoteObject etc. I'd like that to be determined at
runtime.
When it comes time to write the implementation code, it seems to me that the
way I have designed the interfaces has implications.
Here is my attempt
public interface BusinessInterfaceB
{
String getName() throws java.rmi.RemoteException;
}
public interface BusinessInterfaceA
{
String getName() throws java.rmi.RemoteException;
BusinessInterfaceB getMyOldFriendB() throws java.rmi.RemoteException;
}
public interface RemoteBusinessInterfaceB extends BusinessInterfaceB,
java.lang.Remote
{
}
public interface RemoteBusinessInterfaceA extends BusinessInterfaceA,
java.lang.Remote
{
}
public class RemoteBusinessInterfaceAImpl
implements RemoteBusinessInterfaceA
{
public String getName() { return "RemoteBusinessInterfaceA";}
public BusinessInterfaceB getMyOldFriendB()
{
// how can this be returned from a remotely invoked method ?
// what do the marshaling mechanisms for CORBA & RMI expect ?
// don't I have to declare this method to return
RemoteBusinessInterfaceB
}
}
Also there is an issue here to do with class inheritance
I don't want to have to inherit from CORBA generated classes XXXBaseImpl or
from UnicastRemoteObject since that makes me RMI/CORBA specific and also
means I can't use inheritance for other (more useful) things.
Is what I am trying to do possible. I know that RMI/IIOP somewhat makes this
moot, but that is really nascent and also potentially has limitation
(depending on the app server etc) like not offering full JTS context
propagation etc
I am not sure if I have explained my issue explicitly enough but I leave it
there for now
Cheers,
Matthew
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rickard �berg
> Sent: Friday, July 14, 2000 1:30 AM
> To: [EMAIL PROTECTED]
> Subject: Re: MI2: Strategies to reduce EJB development time?
>
>
> On Thu, 13 Jul 2000 13:03:22 -0700, J. Matthew Pryor <[EMAIL PROTECTED]>
> wrote:
>
> >OK so here is another issue I have with this "Business Interface" design
> >pattern that I can't think of a good solution for.
> >
> >Say I have 2 business interfaces : BusinessInterfaceA &
> BusinessInterfaceB
> >
> >I define my 2 "local" or BO interfaces (and sure all the methods have to
> >throw RemoteException)
> >
> >But what if I want to model an association between BusinessInterfaceA &
> >BusinessInterfaceB
> >
> >I can't write a method on BusinessInterfaceA like:
> >
> >public BusinessObjectB getAReferenceToYouWellKnownFriendMrB() throws
> >RemoteException;
> >
> >Because when I move to my "remote" version of
> BusinessInterfaceA, the return
> >type of the method would need to change to
> >
> >public RemoteBusinessObjectB
> getAReferenceToYouWellKnownFriendMrB() throws
> >RemoteException;
>
> Why? :-)
>
> RemoteBusinessObjectB extends BusinessObjectB. Thus, RBOB can be cast to
> a BOB. Hence, the method can return BOB, which could be an instance
> implementing RBOB.
>
> Explain, very explicitly, what is the problem? I don't see it.
>
> regards,
> Rickard
>
> --
> Rickard �berg
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.telkel.com
> http://www.jboss.org
> http://www.dreambean.com
>
> ==================================================================
> =========
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".