I have created a new implementation type (implementation.widget) that
starts to extend the SCA programming model to web 2.0 client
applications. This is similar to what was proposed on this thread [1],
we can now turn a html into a SCA component, declare references using
JavaScript, and get them wired using SCA.
Considering the store composite [1],
<component name="store">
<tuscany:implementation.widget location="content/store.html"/>
<service name="Widget">
<tuscany:binding.http/>
</service>
<reference name="Catalog" target="Catalog">
<tuscany:binding.jsonrpc/>
</reference>
<reference name="ShoppingCart" target="ShoppingCart">
<tuscany:binding.atom uri="/ShoppingCart"/>
</reference>
</component>
<component name="Catalog">
<implementation.java class="store.CatalogImpl"/>
<service name="Catalog">
<tuscany:binding.jsonrpc uri="/Catalog"/>
</service>
</component>
<component name="ShoppingCart">
<implementation.java class="store.ShoppingCartImpl"/>
<service name="Collection">
<tuscany:binding.atom/>
</service>
</component>
Declaring SCA references using JavaScript can be done with the syntax
below. This references will get properly introspected by the
implementation.widget and wired.
//@Reference
var catalog = new Reference("Catalog");
//@Reference
var shoppingCart = new Reference("ShoppingCart");
The client application would need to include a generated js, that has
the same name as the component being used.
<!-- one js include per sca component -->
<script type="text/javascript" src="store.js"></script>
Right now there is support for JSONRPC and Atom, and you can see all
of this in in action in sca/samples/store.
Please, provide your feedback, and let me know if you have more
scenarios that would enhance and simplify the programming model in a
web 2.0 application scenario.
[1] http://www.mail-archive.com/[EMAIL PROTECTED]/msg23094.html
[2]
https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/store/src/main/resources/store.composite
--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]