On Feb 28, 2007, at 1:21 PM, Raymond Feng wrote:
Hi,
I can see the pain. Two related questions:
1) To contribute a loader without a base class, I'll have to
implement all methods in StAXElementLoader interface, right?
You would still be able to do that. The LoaderExtension is fairly
simple (really just handling registration) so doing so would not be
too much a PITA but for others I think it would be more complex. The
idea with an loader implementation type would be to avoid writing code.
2) Can the following SCDL declaration achieve the same goal as you
proposed?
<component name="myLoader">
<implementation.java
class="org.apache.tuscany.core.loader.LoaderExtension"/> <!-- this
class serves as the id of the extension point -->
<property name="modelObject">com.example.MyModelObject</property>
</component>
This assumes the core classes are available to the extension which is
likely to be a problem.
It also requires that the init() method of LoaderExtension do all the
introspection needed to define the loader. That's going to be a PITA
to maintain. It's also going to require that every instance of
LoaderExtension wire to all of the introspection infrastructure which
will mean promoting a bunch of references out the extension's composite.
With a implementation type approach, only the builder needs to be
wired into the introspection infrastructure. It also shields the user
the actual implementation class used which means the builder might be
able to choose different implementations based on the model object
supplied (e.g it could use a simple POJO binding, or it might choose
JAXB for more complex structures).
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]