commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Wannheden" <knut.wannhe...@paranor.ch>
Subject Re: [HiveMind] extend BuildFactory to use static fields/methods
Date Wed, 01 Oct 2003 20:57:26 GMT
I have written a service implementing this strategy, with a minor
difference: I didn't add a nested <properties> as you proposed, instead the
<set-...> elements are immedeate child elements. This way the service can be
used everywhere hivemind.BuilderFactory is used. E.g.

<construct class="...">
 <set-service service-id="..."/>
 <set-boolean .../>
 <int value="42"/>
 <set-int .../>
 <string value="foo"/>
</construct>

The constructor parameter elements and property elements can be mixed
freely, as long as the constructor parameter elements are given in the same
order as in the actual constructor. In this case: int, String.

The service supports the following constructor parameter elements: <string>,
<int>, <long>, <boolean>, <service>, <configuration>, and <resource>.

If anyone's interested I can supply the source. I just thought I'd write
some more unit tests first...

--knut

"Christian Essl" <christianessl@yahoo.de> wrote in message
news:oprwddvegswo6mmv@mail.yahoo.de...
> That would be realy helpful. Maybe we could add a <properties> tag which
> would include the current BuilderFactory tags and set the properties after
> the service is constructed.
>
> <contruct class="...">
>   <service service-id="..."/>
>   <configuration configuration-id="..."/>
>   <int value="..."/>
>   (etc.)
>   <properties>
> <set-boolean .../>
> (etc.)
>   </properties>
> </construct>
>
>
> On Wed, 1 Oct 2003 10:22:52 -0400, Howard M. Lewis Ship
> <hlship@comcast.net> wrote:
>
> > Maybe "ConstructorFactory"?  Something like:
> >
> > <contruct class="...">
> > <service service-id="..."/>
> > <configuration configuration-id="..."/>
> > <int value="..."/>
> > (etc.)
> > </construct>
> >
> > The elements inside the <construct> element are the parameters to the
> > constructor.
> >
> > I'll be setting up a HiveMind:Contrib subproject shortly.  We can start
> > putting stuff in there and
> > then migrate it up to library or framework if it proves to be popular
and
> > essential.
> >
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components
> > http://jakarta.apache.org/tapestry
> > http://jakarta.apache.org/commons/sandbox/hivemind/
> > http://javatapestry.blogspot.com
> >
> >> -----Original Message-----
> >> From: news [mailto:news@sea.gmane.org] On Behalf Of Knut Wannheden
> >> Sent: Wednesday, October 01, 2003 10:18 AM
> >> To: commons-dev@jakarta.apache.org
> >> Subject: Re: [HiveMind] extend BuildFactory to use static
fields/methods
> >>
> >>
> >> Then how about a new factory service which lets you specify the
> >> constructor parameters? This is also a very common IoC pattern AFAIK.
> >>
> >> --knut
> >>
> >> "Howard M. Lewis Ship" <hlship@comcast.net> wrote in message
> > news:016001c38821$2e575700$6501a8c0@ALMIGHTYBEAST...
> > Outside of Kurt's use case ... wrapping around machine-generated code, I
> > feel that this talk of
> > accessing static singletons is a step backwards.
> >
> > The point of HiveMind is to eliminate those static variables and static
> > inits, do things thread-safe
> > and just-in-time.
> >
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
> > http://jakarta.apache.org/commons/sandbox/hivemind/
> > http://javatapestry.blogspot.com
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
>
> -- 
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message