users@glassfish.java.net

Re: _at_Local extends _at_Remote

From: Sahoo <Sahoo_at_Sun.COM>
Date: Mon, 04 Aug 2008 09:29:30 +0530

IMO, it's a bad design, because typically the semantics of remote
methods differ from that of local methods. e.g., remote methods use
pass-by-value, where as local ones use pass-by-reference. There are
restrictions of what exceptions can appear in method signatures as well.
Both your approaches suffer from this.

See section #3.2 of EJB 3.0 Simplified spec, where it says the following:

/The same business interface cannot be both a local and a remote
business interface of the bean. [4]/

Thanks,
Sahoo
glassfish_at_javadesktop.org wrote:
> Hi,
> I am designing a new application using EJB3.
> I was just wonderning if its leagal and won't have any drawback.
>
> @Remote
> public interface OrderManagerRemote
> {
> public void addOrder(OrderTO orderData);
> public List<OrderTO> getOrders();
> }
>
> @Local
> public interface OrderManagerLocal extends OrderManagerRemote
> {
> //Only available in local interface.
> public List<OrderTO> deleteOrders(List<OrderTO> orders);
> }
>
> I have tried this in Glassfish and it's working fine but I don't know what's going inside the system.
>
> I could try other approach i.e.
>
> public interface OrderMethods
> {
> public void addOrder();
> }
>
> @Remote
> public interface OrderManagerRemote extends OrderMethods
> {
> }
>
> @Local
> public interface OrderManagerLocal extends OrderMethods
> {
> }
> ...but I just want to reduce the number of classes I'm creating.
>
> Thanks in Advance.
> [Message sent by forum member 'jassi_saggu' (jassi_saggu)]
>
> http://forums.java.net/jive/thread.jspa?messageID=291144
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>