You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2006/08/01 19:08:00 UTC

Introspection of JavaScript components

I've had a go at adding support for introspection of JavaScript components
and wondered if anyone had any comments.

As JavaScript is untyped and doesn't have the concept of annotations its not
possible to have this work as well as with Java components. How I've done it
is to have the script define a object named SCA which defines the component
configuration.

There's a sample introspectable script at:
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/function/IntrospectableHelloWorld.js

There'd be nested objects defining any references and properties, and WSDL
interfaces could be described something like:

SCA = {
   'wsdlServiceName' : 'myservice'
   'wsdlPortName' : 'myPort'
}

Comments? I think this makes script components simpler than using the
.componentType side file, but what do others think?

   ...ant

Re: Introspection of JavaScript components

Posted by Jeremy Boynes <jb...@apache.org>.
This looks cool.

Graham Charters has been looking at similar things for a PHP  
programming model - if you haven't had chance yet you should sync up  
with him.
--
Jeremy

On Aug 1, 2006, at 10:08 AM, ant elder wrote:

> I've had a go at adding support for introspection of JavaScript  
> components
> and wondered if anyone had any comments.
>
> As JavaScript is untyped and doesn't have the concept of  
> annotations its not
> possible to have this work as well as with Java components. How  
> I've done it
> is to have the script define a object named SCA which defines the  
> component
> configuration.
>
> There's a sample introspectable script at:
> http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/ 
> containers/container.javascript/src/test/resources/org/apache/ 
> tuscany/container/javascript/function/IntrospectableHelloWorld.js
>
> There'd be nested objects defining any references and properties,  
> and WSDL
> interfaces could be described something like:
>
> SCA = {
>   'wsdlServiceName' : 'myservice'
>   'wsdlPortName' : 'myPort'
> }
>
> Comments? I think this makes script components simpler than using the
> .componentType side file, but what do others think?
>
>   ...ant


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


Re: Introspection of JavaScript components

Posted by Jim Marino <jm...@myromatours.com>.
Yea this is definitely simpler than a side file.  I came across this  
but never tried it out a few years back:

http://dotnetjunkies.com/WebLog/anoras/archive/2004/08/09/21502.aspx

Apparently it provides a way to "introspect" the script to retrieve  
Javadoc style annotations but the way you have may be better and  
simpler.

Jim



On Aug 1, 2006, at 10:08 AM, ant elder wrote:

> I've had a go at adding support for introspection of JavaScript  
> components
> and wondered if anyone had any comments.
>
> As JavaScript is untyped and doesn't have the concept of  
> annotations its not
> possible to have this work as well as with Java components. How  
> I've done it
> is to have the script define a object named SCA which defines the  
> component
> configuration.
>
> There's a sample introspectable script at:
> http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/ 
> containers/container.javascript/src/test/resources/org/apache/ 
> tuscany/container/javascript/function/IntrospectableHelloWorld.js
>
> There'd be nested objects defining any references and properties,  
> and WSDL
> interfaces could be described something like:
>
> SCA = {
>   'wsdlServiceName' : 'myservice'
>   'wsdlPortName' : 'myPort'
> }
>
> Comments? I think this makes script components simpler than using the
> .componentType side file, but what do others think?
>
>   ...ant


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