You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Luciano Resende <lu...@gmail.com> on 2008/03/11 08:21:37 UTC

Adding support for Properties in Implementation widget, was Re: SCA in Web 2.0 applications...

I have added support for Properties in the implementation.widget.

Declaring SCA properties using JavaScript can be done with the syntax
below. This properties will get properly introspected by the
implementation.widget and wired.

//@Property
var locale = Property("locale");

//@Property
locale = Property("locale");

For now, some type of properties (e.g isMany) is not supported yet.
Please let me know if you guys find any issues or have any questions.

On Mon, Oct 29, 2007 at 6:47 PM, Jean-Sebastien Delfino
<js...@apache.org> wrote:
> [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: tuscany-user-unsubscribe@ws.apache.org
>  For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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


Re: Adding support for Properties in Implementation widget, was Re: SCA in Web 2.0 applications...

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Luciano Resende wrote:
> For now String. this might change when I get isMany working.

OK. I think that string is fine, and 'isMany' properties can map to an 
array of strings.

-- 
Jean-Sebastien

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


Re: Adding support for Properties in Implementation widget, was Re: SCA in Web 2.0 applications...

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Luciano Resende wrote:
> For now String. this might change when I get isMany working.

OK. I think that string is fine, and 'isMany' properties can map to an 
array of strings.

-- 
Jean-Sebastien

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


Re: Adding support for Properties in Implementation widget, was Re: SCA in Web 2.0 applications...

Posted by Luciano Resende <lu...@gmail.com>.
For now String. this might change when I get isMany working.

On Tue, Mar 11, 2008 at 8:29 AM, Jean-Sebastien Delfino
<js...@apache.org> wrote:
> Luciano Resende wrote:
>  > I have added support for Properties in the implementation.widget.
>  >
>  > Declaring SCA properties using JavaScript can be done with the syntax
>  > below. This properties will get properly introspected by the
>  > implementation.widget and wired.
>  >
>  > //@Property
>  > var locale = Property("locale");
>  >
>  > //@Property
>  > locale = Property("locale");
>  >
>  > For now, some type of properties (e.g isMany) is not supported yet.
>  > Please let me know if you guys find any issues or have any questions.
>  >
>
>  Looks good to me.
>
>  Which type to you assign by default to these properties (given that
>  Javascript is not going to specify any type)? string?
>
>  --
>  Jean-Sebastien
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>  For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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


Re: Adding support for Properties in Implementation widget, was Re: SCA in Web 2.0 applications...

Posted by Luciano Resende <lu...@gmail.com>.
For now String. this might change when I get isMany working.

On Tue, Mar 11, 2008 at 8:29 AM, Jean-Sebastien Delfino
<js...@apache.org> wrote:
> Luciano Resende wrote:
>  > I have added support for Properties in the implementation.widget.
>  >
>  > Declaring SCA properties using JavaScript can be done with the syntax
>  > below. This properties will get properly introspected by the
>  > implementation.widget and wired.
>  >
>  > //@Property
>  > var locale = Property("locale");
>  >
>  > //@Property
>  > locale = Property("locale");
>  >
>  > For now, some type of properties (e.g isMany) is not supported yet.
>  > Please let me know if you guys find any issues or have any questions.
>  >
>
>  Looks good to me.
>
>  Which type to you assign by default to these properties (given that
>  Javascript is not going to specify any type)? string?
>
>  --
>  Jean-Sebastien
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>  For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>



-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

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


Re: Adding support for Properties in Implementation widget, was Re: SCA in Web 2.0 applications...

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Luciano Resende wrote:
> I have added support for Properties in the implementation.widget.
> 
> Declaring SCA properties using JavaScript can be done with the syntax
> below. This properties will get properly introspected by the
> implementation.widget and wired.
> 
> //@Property
> var locale = Property("locale");
> 
> //@Property
> locale = Property("locale");
> 
> For now, some type of properties (e.g isMany) is not supported yet.
> Please let me know if you guys find any issues or have any questions.
> 

Looks good to me.

Which type to you assign by default to these properties (given that 
Javascript is not going to specify any type)? string?

-- 
Jean-Sebastien

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


Re: Adding support for Properties in Implementation widget, was Re: SCA in Web 2.0 applications...

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Luciano Resende wrote:
> I have added support for Properties in the implementation.widget.
> 
> Declaring SCA properties using JavaScript can be done with the syntax
> below. This properties will get properly introspected by the
> implementation.widget and wired.
> 
> //@Property
> var locale = Property("locale");
> 
> //@Property
> locale = Property("locale");
> 
> For now, some type of properties (e.g isMany) is not supported yet.
> Please let me know if you guys find any issues or have any questions.
> 

Looks good to me.

Which type to you assign by default to these properties (given that 
Javascript is not going to specify any type)? string?

-- 
Jean-Sebastien

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