[snip]
Raymond Feng wrote:
Hi,

I think it is a nice and clean way to use SCA with Web 2.0. I have a few comments.

I like it too, with this implementation type we can model in an SCA composition client side components and their wires to server-side components.

I started to use <implementation.widget> in the store tutorial that I'm working on and found it very easy to use.


1) To reference the generated JavaScript for a given component, say foo, should we use a naming convention to avoid conflict? For example, sca/foo.js?

Initially the widget Javascript was mapped to the component URI. I ran into some minor issues with that: - different components could not reuse the same HTML (as the HTML needed to change to include the different generated script files) - the HTML had to use a convoluted path to the script if its URI was not the same as the component URI

I changed it to be <widget artifact uri>.js, i.e. for cool/ui/store.html it's cool/ui/store.js, allowing store.html to simply do <script src="store.js"/> to include the script. I'm not sure that requiring an sca/ prefix is really useful.


2) Why do I have to use the following syntax to declare the references as they are already in the composite file?
//@Reference
var catalog = new Reference("Catalog");

//@Reference
var shoppingCart = new Reference("ShoppingCart");

To tell the world that this HTML widget component requires these references. This is similar to all other component implementations (e.g. Java components with annotations, BPEL components with partnerLinkTypes etc).


With the component definition, we already know "Catalog" and "ShoppingCart" are two references. Cannot we just generate these variables in the store.js?

It's the other way around. The business logic in the widget implementation is coded to use specific references. The implementation needs to make a statement about what references it requires to work. Then an assembler comes, looks at the implementation to find what references it needs, creates a <component> from the implementation and wires the required references.

In other words, without "Reference" definitions in the implementation nobody knows what references the implementation requires, so nobody can write the correct <component> declaration :).

--
Jean-Sebastien


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

Reply via email to