ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <>
Subject Re: DataType interface?
Date Sun, 03 Jun 2001 13:53:23 GMT
From: "Peter Donald" <>
> Hi,
> A while ago I was discussing DataTypes and how we should implement them.
> There was little support for a generic system like
> <set-property name="foo">
>   <fileset ... />
> </set-property>
> but instead it was indicated that we would instead create a separate task
> for each data-type so it works something like
> <fileset name="foo" ... />
> or using aspects
> <fileset ant:id="foo" ... />
> This task would be repeated for all diferent datatypes (ie
> fileset/patternset/file/pattern/filter/filterset/etc).
> Now because the runtime will most likely differentiate between DataTypes
> and the tasks used to set the DataTypes I was wondering whether it would
> useful to have a separate marker interface to indicate DataTypes?

I have considered there to be three components to a datatype.
1. The task level element used to create values of the datatype

  <fileset name="foo" .../>

2. The nested element used to create an instance of the datatype within the
context of another task

   <fubar ...>
       <fileset .../>

3. The type which is actually stored in the ExecutionFrame when a value of
the datatype is created (Sorry for the mutant terminology).

Now, I consider that 1 and 2 must be the same class since any way I can
configure a top level datatype value I should be able to configure that
datatype when nested in another task. One question I considered is whether
this is the class which actually gets stored in the ExecutionFrame - i.e.
is 3 the same class. I decided that I may as well use the same class for
all three situations. In other words, I'm not sure I agree with Peter's
statement that the core will need to distinguish between the data types and
the tasks used to set the DataTypes.

So, what is the requirement for the core to distinguish a datatype and the
element which is configured from the project model? How will the core
manipulate the datatype at the abstract level - i.e. can something treat
the datatype as just a datatype without knowing it is actually some
specific class. If the user of the datatype needs to know it is some
specific class, eg FileSet, then the same class can be used.

In mutant I do indeed have a DataType class, but it is just a specialized
type of Task which simply handles references and validates values when they
occur as a top level item. Other top level tasks can operate as conceptual
DataTypes without being a subclass of my DataType class - Property being
the most obvious example.

I'm also not sure why we need a DataType registry. Isn't the associated top
level task sufficient?



View raw message