Hi,

I'd like to extract a TaskContainer interface from Project. It would look pretty much the same as ConfigurationContainer. Some reasons why:

- To move some of the noise on Project to other interfaces
- To make the APIs for collections of tasks, configurations, repositories (and source dirs, test suites, etc) more consistent. - To share more of the container-of-domain-objects code that is currently scattered in various places, as, say, an abstract super class. This makes it easy to add new capabilities to all collections, and to add new types of collections.

The following task-related methods would be removed from Project, and replaced them with equivalents on TaskContainer:
- findTask(name)
- task(name)
- task(name, closure)
- getAllTasks(recursive)
- getTasksByName(name, recursive)
- getTasks()
- addTaskLifecycleListener()
- whenTaskAdded()

I'd leave the following methods:
- createTask(...)

Also, the current dynamic behaviour of Project would remain, ie
- can access a task a as property of Project
- can configure a task using task name + closure

TaskContainer (and ConfigurationContainer, and RepositoryContainer) would allow tasks to be accessed as properties, and would also allow indexing, eg

tasks.someTask.srcDir = ...
tasks['someTask'].srcDir = ...


Adam


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to