ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simeon H.K. Fitch" <sim...@fitch.net>
Subject Re: Proposed API Refactoring
Date Mon, 04 Dec 2000 15:58:11 GMT
On Mon, Dec 04, 2000 at 08:02:52PM +1100, Peter Donald wrote:
> At 09:51  4/12/00 +0100, you wrote:
> >Jose Alberto Fernandez <JFernandez@viquity.com> wrote:
> >
> >> a) Being able to construct a Project from other
> >> than a file. In particular, one should be able to
> >> provide our own SAX event stream to be used to
> >> build the project.
> >
> >Agreed. Maybe even a DOM tree as well, but I'm not sure.
> 
> Theres quite a few DOM->SAX filters around so it would be better if we just
> nabbed them ;)

Something I'm confused about, so be patient with me: If the goal is to
generate the Ant data model from some other info source than an XML
file (say, a GUI constructed tree structure), why would one want to go
through the SAX interface to communicate with Ant? Maybe I'm being too
simplistic about it, but why don't we just design the data model such
that you can instantiate the various data models and insert them as
child nodes to the appropriate parent? And then just call
Project.execute() when the model is constructed? For example (in
pseudo code):

	Project p = new Project("fred");
	Target t1 = new Target("first");
	Target t2 = new Target("second");
	Target t3 = new Target("third");
	t3.addDependency(t1);
	t3.addDependency(t2;
	p.execute(t3);


Jose has brought up the concept of a SAX event stream approach several
times, and I want to make sure I understand that what he is suggesting
is that you fire off SAX events to construct the data model rather
than doing something similar to the above code.

Can you explain the SAX event approach in more detail?

thx,

sim

sim

Mime
View raw message