+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
--------------------------------------------------
From: "Mike Edwards" <[EMAIL PROTECTED]>
Sent: Thursday, May 08, 2008 5:09 AM
To: <[email protected]>
Subject: Re: componentType interfaces and data transforms
Scott,
The interpretation here depends on your take on componentType files.
My take has *ALWAYS* been that componentType files are meant to express
something about the implementation rather than express some "design
constraints". Indeed, the separate concept of "constraining type" was
invented for the purpose of expressing design constraints. I also believe
that componentType files are a necessary evil to be tolerated only for
cases where introspection is impossible.
Another term suggested for "componentType" has been "implementationInfo"
which makes this plain.
Viewed in this light:
a) componentType should not be necessary if an implementation can be
introspected
b) componentType can only add information derived from introspection - it
cannot override anything
since the implementation is what it is
Viewed in this light, I'd say that the example componentType you give
falls foul of these rules. The implementation clearly has an
<interface.java clas="xxxx"/>, not an <interface.wsdl.../>. I'd expect
the "componentType merge process" to either:
1) Issue a warning that the componentType file does not match the
implementation
2) Raise an exception for the same issue
Either way, its the <implementation.java.../> that should be used.
Yours, Mike.
Scott Kurz wrote:
Consider the use case where I start with a .componentType file, e.g.:
<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
<service name="HelloWorld">
<interface.wsdl interface="
http://helloworld#wsdl.interface(HelloWorld)" />
</service>
</componentType>
And I proceed to write a Java impl with @Service pointing to a Java
interface.
--------------------------
Well, this is going to cause problems today.
I'm not precisely sure where in the code... I know it has something to do
with how we build the wire source/target InterfaceContracts in
CompositeActivatorImpl... but somehow the net seems to be that we assume
that if an interface is specified in the .componentType file then
this .componentType interface will describe something physical on the
wire.
Now, one could argue that it is correct that the use case I started with
is
not supported. I think the words in the OSOA Assembly spec do more to
suggest the
current interpretation than the one I'm suggesting.
But regardless, I'm arguing that the componentType should be treated as
more
of a logical description in this case than a physical description.
So in the code I'd say we should be basing the wire source/target
interface
contract's on something which is more of a "client/impl
InterfaceContract"
than the componentType
InterfaceContract we're using today.
In particular this allows more of an ability to express top-down,
WSDL-centered, interface design via the componentType file.
Scott