ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: ScriptDef
Date Fri, 15 Feb 2002 07:41:08 GMT
On Fri, 15 Feb 2002 18:06, Jose Alberto Fernandez wrote:
> > The way I did it was
> >
> > <scriptdef ... >
> >   <!-- for concrete implementations -->
> >   <element name="x" type="o.a.ant.FileSet"/>
> >   <!-- for stuff sucked out of registry -->
> >   <element name="x" role="o.a.ant.Condition"/>
> > </scriptdef>
> >
> > The same thing was repeated with the template task and a few other tasks
> > that defined task-like facades.
>
> Sorry Peter but :-p
>
> It is very very bad syntax. Imagine that all ANT syntax where like that,
> would you still use it? Having to learn and name all the Java classes all
> over the code?

I like it :) but it was written more than a year ago. If I was to clean 
it up and commit it I would probably look more like

<scriptdef ... >
  <!-- for concrete implementations -->
  <element name="x" type="fileSet"/>
  <!-- for concrete implementation not in datatype role -->
  <element name="x" type="merge" role="mapper" />
  <!-- for stuff sucked out of registry -->
  <element name="x" role="condition"/>
</scriptdef>

> BTW, in both implementations, can you please make certain that script
> writers cannot get access to the internals of ANT by using this tasks? They
> should have just the same amount of power or less than the one we expect
> other Java code to have. Unfortunatelly, since they use reflection to find
> their way, it is very easy for them to cross interface boundaries and get
> hold to any public method of an object.

Both proposals have identical boundaries. The script writers can still get 
access to the "privlidged" services that are needed to write some of the 
special tasks but they definetly wont get more permission than normal tasks.

-- 
Cheers,

Pete

--------------------------------------------------
"An intellectual is someone who has been educated 
beyond their intelligence."
--------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message