ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: [myrmidon] add TaskContext.getService()
Date Thu, 31 Jan 2002 08:22:52 GMT
On Thu, 31 Jan 2002 16:48, Adam Murdoch wrote:
> > -----Original Message-----
> > From: Peter Donald [mailto:peter@apache.org]
> > Sent: Wednesday, 30 January 2002 6:29 PM
> > To: Ant Developers List
> > Subject: Re: [myrmidon] add TaskContext.getService()
> >
> >
> > Hi,
> >
> > On Sat, 26 Jan 2002 17:14, Adam Murdoch wrote:
> > > > I tend to think of services as different from types. Services
> > > > persist over
> > > > the length of the ant "execution" or at least the "workspace
> > > > execution" or
> > > > whatever term we were using for this. Types are created by tasks
> > > > while serviuces never can be etc.
> > >
> > > Exactly.  And that's why they would use different roles, to distinguish
> > > between what they are and how they should be used.  But that
> >
> > doesn't mean
> >
> > > the same infrastructure shouldn't be available to both services and
> > > data-types.
> >
> > I think we mean different things when we are talking about
> > services vs types.
> > When I think of services I tend to think that the services are a
> > semi-singleton available throughout the execution of all tasks.
> > Where types
> > are created and used as needed.
>
> No, we're talking about the same thing.  I just wasn't being terribly
> clear.

Im still not so sure - maybe I wasn't being so clear ;)

> What I meant was that we should try to use a single general-purpose
> mechanism for creating instances of services and data-types (and all the
> other things that come from typelibs - tasks, project builders, converters,
> whatever).  Exactly when instances can be created, and how they are used,
> is going to be different for each role.

okay.

> We can make TypeManager responsible for the instantiation of everything
> that comes from a typelib (and it more-or-less is - it just doesn't do
> services yet).  Then, we add to TypeManager the things we might need for
> services, such as the ability to *optionally* provide a factory, the
> ability to *optionally* specify a default implementation for a role, that
> kind of thing.

Can you see a need for types to have default implementations? The design of 
myrmidon was initially based on Cocoon which does have the notion of default 
types for a role but I could not think of any legitimate reason to include 
this information in Ant. Can you give a use case?

> Again, it would be handy to have a role hierarchy.  Thinking about it, 2
> levels would be enough.  At the top level would be the generic roles, such
> as DataType, Task, Converter, Service, ProjectBuilder, that kind of stuff. 
> Underneath each of those would be the custom roles, such as Mapper or
> Condition under DataType, or JavaCompiler under Service.

Heres where we differ. The way I conceive it JavaCompiler is NOT a service. 
It is a type used by the JavaExecManager service. JavaExecManager exists 
through out the duration of the ant execution while the instances of 
JavaCompiler are created each time there is a request to the service (ie by 
<javac/> and friends). So in effect there could be one instance of the 
JavaCompiler role per task but one instance of JavaExecManager for all tasks. 
In fact the task never even has to know of the existence of JavaCompiler type.

-- 
Cheers,

Pete

--------------------------------------------------
 Where ignorance is bliss, 'tis folly to be wise.
--------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message