ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject Re: AntBean feedback
Date Sat, 02 Mar 2002 11:39:50 GMT
From: "Conor MacNeill" <>

> 1. Why is AntBean a task? I don't really see the benefit. It just seems 
> to be a complication.
> 2. The AntBean should not touch System.out, System.err nor setup a 
> SecurityManager. These are the responsibility of the container to setup. 
> I wouldn't want a bean to be mucking around with System.out.
> 3. Similarly a bean should have no concept of a logger. In Main, a 
> logger is the listener which has the reponsibility to write to to 
> System.out. That is a concept of the container, not the bean.
> 4. The bean should not be creating listeners or loggers. Again, this is 
> the responsibility of the container. If the container is a GUI, for 
> example, the Ant core may not be capable of instantiating the listener. 
> The bean should just have addListener, removeListener methods.

To me the AntBean task should do no more than:

    1) Create a Project instance (i.e., new Project() ).
    Project p = createProject(); p.init();
    this way someone can subclass AntBean and use its own subclass of Project.

    2) Create an instance of the Ant task on that Project:
        Ant task = (Ant) p.createTask("ant");
        or maybe do it directly to not play the casting game:
        Ant task = new Ant(); task.setProject(p); ...

    3) Let the container set listeners and the rest on the project instance.

    4) Let the container set the arguments for the Ant task (target, buildfile, properties,

    5) Execute the <ant> task.

    That's it.

    For this to work, the only thing that is needed is to add one method to Project:

        public Project createSubProject();

    which subclasses of Project can override to return instances of its own subclass and
    make <ant> use this method instead of creating the subProject directly.

<ant> should be good enough to work the hole thing out.

Did I mention that this is exactly what the <antlib> proposal already does (i.e., createSubProject)

> 8. You probably want to change the implementation of this method
>      public void setCoreLoader( ClassLoader coreLoader ) {
>          coreLoader=coreLoader;
>      }

yeap, I had to do it too. This part of the code is not properly manage today.

Jose Alberto

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message