Raymond Feng wrote:
+1 on what Mike said.
We have been trying to avoid the implementation (physical) IC assuming
the componentType IC would be the same as the implementation IC. Taking
java component as an example, this is basically to define how a class
"implements" an interface in the SCA fashion. If we do have the need to
capture the implementation IC, then it would be the impl class with a
bunch of methods that match the interface. One example is as follows:
@Service(MyService.class)
public class MyServiceImpl {
public String getCustomerId(SDOCustomer customer) {
....
}
}
@Remotable
public interface MyService {
String getCustomerId(JAXBCustomer customer);
}
Is it valid by the SCA spec?
I'm also seeing another extreme use case that the impl class implements
a generic invocation interface such as InvocationHandler. I'm not sure
if it's valid.
Thanks,
Raymond
Raymond,
That's a good example.
Both of the interfaces you quote may well map to the same WSDL, but they are
not the same Java.
The component type should reflect the actual interface used by the implementation - if not, then
there could be a failure at runtime.
Regarding your "generic invocation interface", I think I'd need to see a concrete example to be able
to comment any further, but in the services world, I'm not sure that this is going to fly. In the
pub/sub & messaging world, things are very different and generic interfaces are acceptable.
Yours, Mike.