Hi,

The following snippet doesn't not change the reference multiplicity to be 0..n.

<component name="StoreMarketCatalog">
...
<reference name="GoodsCatalog" multiplicity="0..n"
target="StoreMarketFruitsCatalog01 VegetablesCatalogWebService01"/>
...
</component>

<reference name="GoodsCatalog" multiplicity="0..n" ..> further configures the reference GoodsCatalog from the componentType (introspected from java impl class). But it has to be compatible. For example, you can change the multiplicity from 0..n (defined in componentTpype) to 1..n, 0..1 or 1..1, but you cannot change it from 1..1 to 0..1, 0..n, or 1..n.

What matters is in the componentType. For example, if you have a java impl:

public class StoreMarketCatalogImpl ... {

   @Reference(name="GoodsCatalog", required=false)
protected Catalog[] goodsCatalog; // or protected Collection<Catalog> goodsCatalog;
}

required=false and Catalog[] (or Collection<Catalog>) makes the multiplicity of GoodsCatalog reference "0..n".

Thanks,
Raymond

--------------------------------------------------
From: "Antollini, Mario" <[EMAIL PROTECTED]>
Sent: Thursday, April 03, 2008 3:38 AM
To: <tuscany-dev@ws.apache.org>
Subject: RE: Tutorial: Adding a Markeplace Scenario

Hello,

I have modified the composite for the store-market module. I had never
worked with multiplicity before. Thus, I need to some help to check if
this code is OK.

What I did was to modify the StoreMarketCatalog component from

<component name="StoreMarketCatalog">
...
<reference name="fruitsCatalog"
target="StoreSupplierFruitsCatalog"/> <reference
name="vegetablesCatalog" target="VegetablesCatalogWebService">
<binding.ws/>
</reference>
...
</component>

To

<component name="StoreMarketCatalog">
...
<reference name="GoodsCatalog" multiplicity="0..n"
target="StoreMarketFruitsCatalog01 VegetablesCatalogWebService01"/>
...
</component>

So, the relevant parts of the composite look like this now:

...
<component name="StoreMarketCatalog">
<implementation.java class="services.market.MarketCatalogImpl"/>

<property name="currencyCode">USD</property>
<service name="Catalog">
<t:binding.jsonrpc/>
  </service>
<reference name="GoodsCatalog" multiplicity="0..n"
target="StoreMarketFruitsCatalog01 VegetablesCatalogWebService01"/>
<reference name="currencyConverter"
target="StoreMarketCurrencyConverter"/>
</component>

<component name="StoreMarketFruitsCatalog01">
<implementation.java class="services.FruitsCatalogImpl"/>
<property name="currencyCode">USD</property>
<reference name="currencyConverter"
target="StoreMarketCurrencyConverter"/>
</component>

<component name="VegetablesCatalogWebService01">
<binding.ws/>
</component>
...


Jean-Sebastien mentioned that the approach of hard-coding the components
in the composite would not be needed when using multiplicity. However,
the way I used multiplicity here still requires new stores to be added
to the composite whenever the store wants to add its catalog to the
marketplace.

Jean-Sebastien, is this what you had in mind when you mentioned
multiplicity or am I doing something wrong?

Regards,
Mario


-----Original Message-----
From: Antollini, Mario [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2008 6:28 PM
To: tuscany-dev@ws.apache.org
Subject: RE: Tutorial: Adding a Markeplace Scenario

Hello,

I have created the new module and called it "store-market" (I uploaded
it to JIRA: https://issues.apache.org/jira/browse/TUSCANY-2163)

As Jean-Sebastien suggested I took "store-merger" and modified it.

I now need to start working on the multiplicity 0..n instead of the
currently hardcoded references to two catalogs.

Regards,
Mario


-----Original Message-----
From: Jean-Sebastien Delfino [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2008 3:51 PM
To: tuscany-dev@ws.apache.org
Subject: Re: Tutorial: Adding a Markeplace Scenario

Antollini, Mario wrote:
Hello jean-Sebastien,



I was thinking about adding a Marketplace scenario to the Tutorial we
will be presenting at JavaOne. By Marketplace I mean doing something
similar to what Amazon does: offering third party retailers' products
via Amazon's site.



I think we can do that by offering multiple catalogs via a proxy
catalog
which consolidates all of them (i.e. data federation).



What do you think? I will be looking the tutorial in detail in order
to
see how I can implement it.



Regards,

Mario



Good idea!

This could be a new module addition under java/sca/tutorial.

You could wire a list of catalogs to a catalog aggregator service
component for example, similar to what the current store-merger module
does but with a reference with multiplicity 0..n instead of the
currently hardcoded references to two catalogs.

The easiest is probably to copy one of the modules (store-merger for
example) into a new store-market or something like that as a starting
point, adjust the POM etc, submit that in a JIRA and then start making
the changes to turn it into a marketplace store.

Let us know if have any questions, issues, or need any help when you do
that.

Thanks!
--
Jean-Sebastien

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


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


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



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

Reply via email to