ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant
Date Sat, 20 Jan 2001 11:59:38 GMT
At 11:10  20/1/01 -0000, wrote:
>conor       01/01/20 03:10:26
>  Modified:    src/main/org/apache/tools/ant
>  Log:
>  Change to IntrospectionHelper to support creation of nested elements
>  through a createElement(String elementName) factory method. This has two
>  applications.

I am not sure I completely like this.
>  It allows a task to define what nested elements are supported
>  dynamically, perhaps through a configuration file. This is useful
>  for tasks that support a plug-in architecture, as I am trying to
>  achieve with <ejbjar>

I don't think I see this as a desirable quality (at least in the normal
case). If the tasks are free to optionally support things then it can allow
the task writer to get away with things that are plain wrong and painful
for the user. Can you give an example of when it would *good* to allow
tasks to do this ? The one special case that I can think of is if someone
wanted to write an if/then/else task but I am not sure this is the way I
would do it anyways.

>  As a byproduct, it also allows a task to support nested elements which
>  cannot be mapped to valid Java method names, such as <support-classes>. The
>  use of hyphenated compound names is relatively common style in XML DTDs

I don't see this as an advantage. This can be done safer other ways and it
seems it is only being done because it can. For instance I don't think
there is many (any???) illegal xml names that are not java names except for 
1. xml names that start with a numeric
2. xml names that embedd '-'

1 is not an issue as we prefix set to it. 2 can be got around other ways.
For instance in myrmidon I would translate support-classes into the method

setSupportClasses() which is a much better way IMHO.



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message