Jim Marino wrote:
Option 2:
- You don't want to write an SCDL componentType file
- In your JavaScript object constructor you do the following:
function Calculator() {
 scaproperty(this.precision)
 scareference(this.divideService)
}
- This tells the Tuscany runtime what properties and references to consider, the runtime initializes them on return from the constructor.
Couldn't the same thing be done by declaring properties/references as constructor parameters, which would be consistent with SCA assembly's use of dependency injection?

Jim,

Both field setting/use of setter methods and constructor based injection are consistent with the SCA spec. I am thinking about starting with the field/setter based approach first as I'm not sure yet how to map (untyped) constructor parameters to references and properties.

I think it would also be interesting to support metadata annotations through JavaScript comments (similar to XDoclet) by writing a script parser using regex (or something similar) as in:

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


What I'm proposing here is a simple alternative to annotations for now. I did a lot of Javascript development in the past and I personally prefer a simple script function to an annotation that does not directly translate to executable code, but I'll welcome any annotation support as well if people like it, want to volunteer and contribute it. The article you pointed to is from 2004, do you know if the approach described in this article became widely used?

Jim


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



--
Jean-Sebastien


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

Reply via email to