[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Operation Overloading and multiple @Remotable interfaces on one Component - presuming this is allowed.
Hi, I have a question about operation overloading when a
Component implements multiple @Remotable interfaces. I know that on a single @Remotable interface, I cannot use
operation overloading. The Assembly specification disallows this: 2264
The style of remotable interfaces is
typically coarse grained
and intended for loosely coupled 2265
interactions. Remotable service Interfaces
MUST NOT make use of method
or operation 2266
overloading. As a result, I cannot do the following: @Remotable public interface TimeService
{ Date
getCurrentTime(); Date
getCurrentTime(String timeZone); } However, is it valid for a Component to implement multiple @Remotable
interfaces that have operations with the same name but different parameters? Each
@Remotable interface does not have operation overloading but the resulting
Component does. I’ll give you a Java example. I have two @Remotable services as defined by the following Java
interfaces: @Remotable public interface LocalTimeService
{ Date
getCurrentTime(); } @Remotable public interface WorldTimeService
{ Date
getCurrentTime(String timeZone); } I have a single Java Component that implements both of these
@Remotable Interfaces: @Service(interfaces = {LocalTimeService.class,
WorldTimeService.class}) public void class
TimeServiceImpl implements LocalTimeService, WorldTimeService { public Date
getCurrentTime() {
// Code not shown } public Date
getCurrentTime(String timeZone) {
// Code not shown } } It can be seen that the Java Implementation of the Component does have
operation overloading but I am presuming that this is allowed since each @Remotable
interface exposed by the Component does not use operation overloading. Thanks, Mark |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]