You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Antollini, Mario" <ma...@intel.com> on 2008/04/13 23:42:52 UTC

Tutorial marketplace scenario ready

Hello,

 

I have finished coding the tutorial marketplace scenario.

 

I have attached all the necessary files in
https://issues.apache.org/jira/browse/TUSCANY-2224

 

Please, follow these steps in order to add it as another module of the
tutorial:

 

market.zip -> contains the logic to obtain the MarketPlace catalog. Its
content must be placed under tutorial\assets\services

StoreMarketNode.zip -> Its content must be placed under
tutorial\domain\cloud

LaunchStoreMarketNode.zip -> Its content must be placed under
tutorial\domain\launch

store-market.zip -> this is the store-market module. This file must be
uncompressed under \tutorial

 

Besides, add the following lines:

1 - Into tutorial\assets\META-INF\sca-contribution.xml: <export.java
package="services.market"/>

2 - Into tutorial\assets\tutorial.html: <h2><a
href="http://localhost:8105/ui/store.html">Online Store -
Marketplace</a>

3 - Into tutorial\domain\cloud.composite: <include
name="ns2:StoreMarketNode" uri="http://tuscany.apache.org/cloud"
xmlns:ns2="http://tuscany.apache.org/cloud"/>

4 - Into tutorial\domain\domain.composite: <include
name="ns2:store-market" uri="store-market" xmlns:ns2="http://store"/>

4 - Into tutorial\domain\workspace.xml: <contribution
location="file:../store-market/target/tutorial-store-market.jar"
uri="store-market"/>

5 - Into tutorial\pom.xml: <module>store-market</module>

 

How to run it?

1 - Compile tutorial\domain, tutorial\store-market, tutorial\assets

2 - # cd <tuscany_home>\tutorial\domain

3 - # java -jar
<tuscany_home>\modules\tuscany-node2-launcher-1.2-incubating.jar domain

4 - Open this url in your browser: http://localhost:9990/ui/cloud/

5 - Start these Nodes in the listed order:

5.1 - CurrencyNode

5.2 - CatalogsNode

5.3 - StoreMarketNode

6 - Open <tuscany_home>\tutorial\assets\tutorial.html in your browser

7 - Click the link "Online Store - Marketplace"

8 - That is all... you should see some fruits and vegetables in the
catalog

 

If there is any problem, please let me know.

 

Thanks and regards,

Mario

 

Mario E. Antollini
Intel Software
ASDC
+54 351 526 5594
mario.antollini@intel.com <ma...@intel.com> 

 


Re: Tutorial marketplace scenario ready

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Antollini, Mario wrote:
> Comments in-line...
> 
> Mario
> 
> -----Original Message-----
> From: Jean-Sebastien Delfino [mailto:jsdelfino@apache.org] 
> Sent: Tuesday, April 15, 2008 6:17 AM
> To: tuscany-dev@ws.apache.org
> Subject: Re: Tutorial marketplace scenario ready
> 
> Antollini, Mario wrote:
>>> I have finished coding the tutorial marketplace scenario.
>>>
>>> I have attached all the necessary files in
>>> https://issues.apache.org/jira/browse/TUSCANY-2224
>>>  
>> Mario, that looks pretty good, I just got it working :)
>>
>> One minor comment:
>>
>> MarketCatalogImpl could be simplified a bit to call   each catalog
> once 
>> instead of twice.
> 
> OK, I can do it for sure. I did not focus on having an efficient
> MarketCatalog implementation. But you are right, I need to fix that.
> 
>> And some ideas:
>>
>> - We could add more catalogs to the list (a local one, the Web service
> 
>> ones, and the EJB catalog running on Geronimo) to really leverage the 
>> reference with multiplicity 0..n. We'd just need to change the
> contents 
>> of the different catalogs (for example have fruits/vegetables from 
>> different places).
>>
>> That raises an interesting question about the mix of bindings that can
> 
>> be used on a reference with multiplicity 0..n. Can different targets
> use 
>> different bindings or do they have to all use the same binding? I
> think 
>> it's worth investigating.
> 
> I am glad that you brought this up. Actually, I struggled with this many
> hours. At first, I tried to do what you suggested (having heterogeneous
> bindings for the catalog reference). I wanted the Market catalog to bind
> to the Fruit catalog locally (an internal component) and the Vegetables
> one through web services. I tried very hard, but I did not manage to get
> it working. I tried different approaches but none worked. Therefore I
> decided to use bind to both the fruits and vegetables catalog through
> web services (this worked right away).
> 
> Do you think this heterogeneous binding issue could be a Tuscany issue?

I think so. It would be worth double checking with the spec but I think 
that the following pattern:

<reference target="ServiceA ServiceB ServiceC">
   <binding.ws>
   <binding.ejb>
   <binding.x>
   <binding.y>
   ...
</reference>

should just work and for each target pick the binding that matches the 
target service binding. If it doesn't it's a bug, which can be fixed :)

> 
>> - Use standalone <wire> elements in a different .composite file in a 
>> different contribution to wire the goodsCatalog reference to the
> catalogs.
> 
>> IMO this is a typical scenario where people want to add catalogs
> without 
>> changing the market contribution which has already been installed in
> the 
>> domain.
> 
> I tried with the <wire> element as well but it did not work either.

I think it's worth investigating. What error are you getting with wires?

> However, I did not try with different composite files. Can you give me
> more details about this, please?

The idea is that the wires can be put in any composite (you just need to 
add that composite to your domain):

- the composite containing the client component, this is very much like 
using the target attribute on its references

- the composite containing the target component, more interesting as it 
allows that new component to be wired to an existing component reference 
without touching the contribution containing that existing component.

- any other composite, even more interesting as it allows you to wire 
two components together without touching their contributions at all.

> 
>> - Another idea, add a Web Service binding to your StoreMarket catalog 
>> component, add a markup to the prices, and that makes it a broker :)
> 
> Do you mean to expose the marketplace as a service using web services?

Yes, just add a <binding.ws> to it.

> 
>> Thoughts?
>> -- 
>> Jean-Sebastien
> 
-- 
Jean-Sebastien

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


RE: Tutorial marketplace scenario ready

Posted by "Antollini, Mario" <ma...@intel.com>.
Comments in-line...

Mario

-----Original Message-----
From: Jean-Sebastien Delfino [mailto:jsdelfino@apache.org] 
Sent: Tuesday, April 15, 2008 6:17 AM
To: tuscany-dev@ws.apache.org
Subject: Re: Tutorial marketplace scenario ready

Antollini, Mario wrote:
>> I have finished coding the tutorial marketplace scenario.
>>
>> I have attached all the necessary files in
>> https://issues.apache.org/jira/browse/TUSCANY-2224
>>  
>
> Mario, that looks pretty good, I just got it working :)
>
> One minor comment:
>
> MarketCatalogImpl could be simplified a bit to call   each catalog
once 
> instead of twice.

OK, I can do it for sure. I did not focus on having an efficient
MarketCatalog implementation. But you are right, I need to fix that.

> And some ideas:
>
> - We could add more catalogs to the list (a local one, the Web service

> ones, and the EJB catalog running on Geronimo) to really leverage the 
> reference with multiplicity 0..n. We'd just need to change the
contents 
> of the different catalogs (for example have fruits/vegetables from 
> different places).
>
> That raises an interesting question about the mix of bindings that can

> be used on a reference with multiplicity 0..n. Can different targets
use 
> different bindings or do they have to all use the same binding? I
think 
> it's worth investigating.

I am glad that you brought this up. Actually, I struggled with this many
hours. At first, I tried to do what you suggested (having heterogeneous
bindings for the catalog reference). I wanted the Market catalog to bind
to the Fruit catalog locally (an internal component) and the Vegetables
one through web services. I tried very hard, but I did not manage to get
it working. I tried different approaches but none worked. Therefore I
decided to use bind to both the fruits and vegetables catalog through
web services (this worked right away).

Do you think this heterogeneous binding issue could be a Tuscany issue?


> - Use standalone <wire> elements in a different .composite file in a 
> different contribution to wire the goodsCatalog reference to the
catalogs.

> IMO this is a typical scenario where people want to add catalogs
without 
> changing the market contribution which has already been installed in
the 
> domain.

I tried with the <wire> element as well but it did not work either.
However, I did not try with different composite files. Can you give me
more details about this, please?

> - Another idea, add a Web Service binding to your StoreMarket catalog 
> component, add a markup to the prices, and that makes it a broker :)

Do you mean to expose the marketplace as a service using web services?

> Thoughts?
> -- 
> Jean-Sebastien

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Tutorial marketplace scenario ready

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Antollini, Mario wrote:
> I have finished coding the tutorial marketplace scenario.
> 
> I have attached all the necessary files in
> https://issues.apache.org/jira/browse/TUSCANY-2224
> 

Mario, that looks pretty good, I just got it working :)

One minor comment:

MarketCatalogImpl could be simplified a bit to call   each catalog once 
instead of twice.

And some ideas:

- We could add more catalogs to the list (a local one, the Web service 
ones, and the EJB catalog running on Geronimo) to really leverage the 
reference with multiplicity 0..n. We'd just need to change the contents 
of the different catalogs (for example have fruits/vegetables from 
different places).

That raises an interesting question about the mix of bindings that can 
be used on a reference with multiplicity 0..n. Can different targets use 
different bindings or do they have to all use the same binding? I think 
it's worth investigating.

- Use standalone <wire> elements in a different .composite file in a 
different contribution to wire the goodsCatalog reference to the catalogs.

IMO this is a typical scenario where people want to add catalogs without 
changing the market contribution which has already been installed in the 
domain.

- Another idea, add a Web Service binding to your StoreMarket catalog 
component, add a markup to the prices, and that makes it a broker :)

Thoughts?
-- 
Jean-Sebastien

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org