ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: macrodef - do attributes as properties or substitutions
Date Wed, 19 Nov 2003 14:51:35 GMT
> From: Steve Cohen [mailto:SCohen@sportvision.com]
> I have used a similar idea with a build file full of "template" targets
> that use a fileset reference.  The reference must be defined globally or
> the build will break, but only some of the users of the file of
> "templates" actually need the reference.  So, since references can be
> overridden, the solution is, similar to Stefan's,
> 
> <fileset id="globaltlds" dir=".">
>     <include name="no.real.file"/>
> </fileset>
> 
> Later, a user of this buildfile can redefine the globaltlds reference, if
> it needs to, to something real.

Yeah, this sounds a lot like the Null Object idiom you can read about in
Martin Fowler's Refactoring book. OTOH, now that there is the <isreference>
condition, a cleaner approach might be to conditionaly execute the target
only of the reference is defined at all, rather than defining a null/dummy
one. Probably not applicable all the time, but still. --DD

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


Mime
View raw message