ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Proposed API Refactoring
Date Tue, 05 Dec 2000 01:24:20 GMT
At 09:58  4/12/00 -0600, Simeon H.K. Fitch wrote:
>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?

well any number of reasons. If the data model is too different from DOM
(Which I think it is) then it makes little sense to go through DOM. But if
we have DOM sources then we must allow them to be used to generate the
model. Remember DOM is just an input and not the final model.

> 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):

essentially we could. Have a look at my proposal as that enables such an
approach. It more looks like

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

ProjectEngine engine = ...;

engine.execute( p, "first" );

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

I am not sure if that is what he is saying exactly. I *think* he is not
denying the possibility of doing the above but in some cases you need to
build a project from some input source. Instead of having N project
builders it would be better to have N SAX producers and one SAX Project
Builder. The reason for this is that there are already many SAX converters
out there and it means that the project builder can be easily maintained
and there is less chance different input sources causing projects to be
built inconsistently.



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

View raw message