You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Peter Donald <do...@apache.org> on 2000/12/12 14:57:30 UTC

Automagic handling of DataType References

Hi,

I was thinking it may be a good idea to have some special case code to
handle references. In virtually all cases any datatype
(patternset/fileset/filterset) can be referenced by something-like

<mydatatype refid="myid" />

I was thinking that we could formalize it so that it was instead

<mydatatype-ref refid="myid"/>

When we see the -ref extention we know that it is a reference. In which
case we look up refid attribute. So we look up object referred to by
"myid". We then try to add it via the standard method "void addMydatatype(
final SomeType value );" minus the -ref extention. This would mean that
effectively any sub-element could be replaced by reference without
complicating either enduser or tasklet developers job.

What do you think ?




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               |
*-----------------------------------------------------*


Re: Automagic handling of DataType References

Posted by Stefan Bodewig <bo...@apache.org>.
Peter Donald <do...@apache.org> wrote:

> Hi,
> 
> I was thinking it may be a good idea to have some special case code
> to handle references. In virtually all cases any datatype
> (patternset/fileset/filterset) can be referenced by something-like
> 
> <mydatatype refid="myid" />
> 
> I was thinking that we could formalize it so that it was instead
> 
> <mydatatype-ref refid="myid"/>
> 

This is what we had in the first place <classpathref> - just without
the added magic you describe - not adding ref seemed sooo much more
convenient 8-)

> When we see the -ref extention we know that it is a reference. In
> which case we look up refid attribute. So we look up object referred
> to by "myid". We then try to add it via the standard method "void
> addMydatatype( final SomeType value );" minus the -ref
> extention. This would mean that effectively any sub-element could be
> replaced by reference without complicating either enduser or tasklet
> developers job.

No, it doesn't.

(1) Neither the enduser nor the task developer needs to care when it
comes to data types right now anyway - as the data types handle
references themselves.

(2) What you describe only works in the addXXX case, not createXXX.

Stefan

Re: Automagic handling of DataType References

Posted by Barrie Treloar <Ba...@camtech.com.au>.
On Wed, 13 Dec 2000, Peter Donald wrote:

> Hi,
> 
> I was thinking it may be a good idea to have some special case code to
> handle references. In virtually all cases any datatype
> (patternset/fileset/filterset) can be referenced by something-like
> 
> <mydatatype refid="myid" />
> 
> I was thinking that we could formalize it so that it was instead
> 
> <mydatatype-ref refid="myid"/>
> 
> When we see the -ref extention we know that it is a reference. In which
> case we look up refid attribute. So we look up object referred to by
> "myid". We then try to add it via the standard method "void addMydatatype(
> final SomeType value );" minus the -ref extention. This would mean that
> effectively any sub-element could be replaced by reference without
> complicating either enduser or tasklet developers job.
> 
> What do you think ?

The problem with all this is that we are heading towards a programming
language that has value and references.

Which for datatype I think every agrees we need to be able to do.

I know I asked why add the -ref extension when the attribute
speciallizes the tag to provide the same semantics.  All it does is
add another tag that needs to be remembered.  If you want to refer to
an existing named datatype then the refid attribute is good enough.  

Barrie
--
Barrie Treloar
____________________________________________________________________

  Barrie Treloar                      Phone: +61 8 8303 3300
  Senior Analyst/Programmer           Fax:   +61 8 8303 4403 
  Electronic Commerce Division        Email: barrie@camtech.com.au
  Camtech (SA) Pty Ltd                http://www.camtech.com.au
 --- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---
____________________________________________________________________