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