ant elder wrote:
On 9/29/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:

<snip>

Here's sample code to illustrate that use case:
http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/sebastien/java/sca/domain-and-node/samples/
SampleTuscanyDomainImplementation.java


Why does that sample need to add and start composites with:

          // Add the Calculator deployable composite to the domain composite
          domain.addComposite(new QName("http://calc";, "Calculator"));

        // Start the Calculator composite
          domain.startComposite(new QName("http://calc";, "Calculator"));

The contribution jar is going to have the sca-contribution.xml (or the
composites in the "deployables" folder we once talked of supporting),

No, sca-contribution.xml is optional.

so
can't the simplest case just be adding the contribution and the deployable
composites get started automatically?

I don't think that having to write a sca-contribution.xml file is the simplest case.

<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0";
             targetNamespace="http://calc";
             xmlns:sample="http://calc";>
  <deployable composite="calc:Calculator"/>
</contribution>

vs

domain.addComposite(new QName("http://calc";, "Calculator"));

Placing the composite file under META-INF/deployables will appear simple to some people, but will not necessarily play well with other people using IDEs for example which often hide META-INF, or people who are not used to place their development artifacts, .wsdl, .xsd, .componentType, or .composite... under META-INF.

   ...ant


+1 to not require a call to addComposite if the contribution lists it in <deployable> in META-INF/sca-contribution.xml

+1 to not require a call to addComposite if the composible file is placed under META-INF/deployables

-1 to always require the composite to be listed in <deployable> or be placed under META-INF/deployables

So a call to addComposite() is optional but we need that method in the API. The purpose of the samples is to demonstrate the capabilities of the API, that's why the call was there :). I added comments to the samples to indicate that this call is optional.

--
Jean-Sebastien


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

Reply via email to