At 11:53 PM 6/3/01 +1000, Conor MacNeill wrote: >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 .../> > </fubar> > >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.
I actually see 2+3 as being same class while 1 is a separate case. Mainly as top-level tasks have attributes that I don't believe all datatypes should have (ie name or ant:id) and they also have a whole host of baggage that comes along with it (ie why does a FileSet need an execute() method). With some tricky manipulation of TaskModel we can make this task relatively easy to do. >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. I am not sure there needs to be any special treatment of "datatypes" in the way you mention. The only special treatment I can see is for next point... >I'm also not sure why we need a DataType registry. Isn't the associated top >level task sufficient? So people can implement a generic task like <set name="foo"> <fileset ... /> </set> Having each DataType have a separate task to assign it can be tedious when you have a high number of datatypes - one of my usecases contains about 17+ datatypes and I don't want to create 17+ tasks to wrap them ;) Cheers, Pete *-----------------------------------------------------* | "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 | *-----------------------------------------------------*
