Jim Marino wrote:
I generally tend to prefer the last option as well. The second is kind of bad in my opinion as it ties an application to the internal implementation of the runtime. The first requires the runtime to have knowledge for every type. As an alternative, what if we supported @Resource from Java commons annotations for this type of stuff?

Jim


On Apr 10, 2006, at 3:26 PM, Jeremy Boynes wrote:

The SDO spec provides the Helper.INSTANCE mechanism that we all know and
love ;-)

I'd like to explore alternatives for how a SCA component can perform SDO
operations without needing to use these static variables.

One option is that the component can declare an @Property with the
requested SDO helper e.g.

   @Property
   public DataFactory sdoDataFactory;

and that we enhance container.java to automatically recognise these
property type and have it inject a reference to the appropriate SDO helper.

An alternative is that we handle this with a custom PropertyFactory
requiring the user to specify the factory="..." attribute when
configuring the property. The SCDL would be something like:

   <component name="...">
     <properties>
       <v:sdoDataFactory factory="o.a.t...SDOHelperFactory"/>

Or, we can add a new annotation that can be used to denote where a
helper should be injected e.g.

   @o.a.t...SDOHelper
   public DataFactory sdoDataFactory;

and presumably the equivalent extension to the componentType sidefile.


My preference is for the last option as it does not tie this behaviour
to just container.java and doesn't require any special setup by the
assembler.

Any other thoughts or preferences?
--
Jeremy



I prefer the last one as well. I'm thinking that the annotation itself should be part of the SDO project, how about @org.apache.tuscany.sdo.SDOHelper?

--
Jean-Sebastien

Reply via email to