comments inline

Venkata Krishnan wrote:
Hi,

I am trying to bring the SPI model and the Loaders in sync with the current
level of the specs as available on OSOA site.  I am currently looking at
'references' - as and how they are defined in ComponentType,
ComponentDefinition and Composite and have the following questions:  -

With respect to references defined in ComponentDefitions and the 'target'
attribute therein
- the specs says that whatever is mentioned in the target overrides that
which is mentioned in the implementation. Now, my understanding is that a
target is used to wire a reference to another Component's service.  Given
this, I thought defining a target makes sense only within a composite. So what does it mean by an implementation specifying a target for a reference?


The idea is to allow a component implementation developed with a particular composition in mind to specify a target right in the implementation. This makes the SCA programming model more compact as you may not even have to write SCDL then. SCA for PHP for example leverages this capability, here's a sample from http://us2.php.net/manual/en/ref.SCA.php:
<?php
  /**
    * The currency exchange rate service to use.
    *
    * @reference
    * @binding.php ../ExchangeRate/ExchangeRate.php
    */
  public $exchange_rate;
?>

The componentType/reference/target attribute allows you to express the same thing in a .componentType SCDL file.

Then later if you want to reuse your component implementation in other compositions you can rewire the reference using a component/reference/target attribute in the particular component declaration, without changing your implementation.

More generally, I've started to look more closely at the model spi as well as I'm trying to see how to reuse it as an individual module, and I'm not sure that the current ReferenceDefinition and ReferenceTarget classes correctly represent references as defined in the SCA assembly spec.

The assembly spec defines the following:
- abstract reference definitions in constraining types
- reference definitions in component types
- component references
- composite references

I'll try to come up with some ideas for an accurate representation of references at these 4 levels.

- next, the 'target' attribute for a reference in a component definition is 'optional'. Assuming there are no targets defined in the implementation and
no targets are defined in the component definition that uses this
implementation (as this is only optional), then what happens to these
references.  Is this something that should not be permitted unless
autowire=true for the reference defn.


You can also leave a reference unwired if it has multiplicity = 0..1 or 0..n or specifies wiredByImpl = true, indicating that the implementation code will wire the reference dynamically (by assigning an endpoint reference to the target using the particular C&I interfaces for your implementation type).

Could somebody familiar with the specs kindly help me with understand?
Thanks.

- Venkat


--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to