You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by "Shackelford, John-Mason" <Sh...@ncs.com> on 2002/09/10 20:14:23 UTC

handling external resources

I am working on a series of ant tasks each of which requires a significant
amount of external configuration via XML files. Since parsing an XML file is
somewhat expensive I thought that perhaps I should keep the java rendering
of that XML configuration around so that when the task is run again the XML
doesn't need to be reparsed. Naturally I thought of creating a singleton
repository for the configuration info, but since Singletons have the
reputation for being evil I am wondering if there is a sanctioned Ant way of
holding on to external resources which may be reused and are expensive to
acquire.


John-Mason Shackelford

Software Developer
NCS Pearson - Measurement Services
2510 North Dodge St.
Iowa City, IA 52245
319-354-9200x6214
shacjo@ncs.com


**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: handling external resources

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
The word "reuse" triggers one thought: datatypes.

Would that work in your situation?

	Erik


Shackelford, John-Mason wrote:
> I am working on a series of ant tasks each of which requires a significant
> amount of external configuration via XML files. Since parsing an XML file is
> somewhat expensive I thought that perhaps I should keep the java rendering
> of that XML configuration around so that when the task is run again the XML
> doesn't need to be reparsed. Naturally I thought of creating a singleton
> repository for the configuration info, but since Singletons have the
> reputation for being evil I am wondering if there is a sanctioned Ant way of
> holding on to external resources which may be reused and are expensive to
> acquire.
> 
> 
> John-Mason Shackelford
> 
> Software Developer
> NCS Pearson - Measurement Services
> 2510 North Dodge St.
> Iowa City, IA 52245
> 319-354-9200x6214
> shacjo@ncs.com
> 
> 
> **************************************************************************** 
> This email may contain confidential material. 
> If you were not an intended recipient, 
> Please notify the sender and delete all copies. 
> We may monitor email to and from our network. 
> ****************************************************************************
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: handling external resources

Posted by Craeg K Strong <cs...@arielpartners.com>.
Hello:

Sorry, not offering a solution, rather echoing the query.

I have had nearly the same question; mine was with respect to performing
multiple XSLT transformations on an XML document.  Right now, everything is
file based, so if I read in an XML file, validate it, then pass it through
n transformations to yield the final result, I will be reading and writing
the XML to disk many times.

It would be great if there could be some new Ant resource of some kind --
perhaps a new datatype -- that represented a chunk of parsed XML.
Perhaps a DOM object or something.  That way you could pass that
around from task to task efficiently, only writing out to
disk when you really want to.

This kind of thing is even more interesting when you are executing Ant
tasks from a servlet.  I have often thought about using Ant as a task
engine for a website with XML-based content, sort of a poor man's Apache
Cocoon.

Thoughts?

--Craeg

Shackelford, John-Mason wrote:
> I am working on a series of ant tasks each of which requires a significant
> amount of external configuration via XML files. Since parsing an XML file is
> somewhat expensive I thought that perhaps I should keep the java rendering
> of that XML configuration around so that when the task is run again the XML
> doesn't need to be reparsed. Naturally I thought of creating a singleton
> repository for the configuration info, but since Singletons have the
> reputation for being evil I am wondering if there is a sanctioned Ant way of
> holding on to external resources which may be reused and are expensive to
> acquire.
> 
> 
> John-Mason Shackelford


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>