RE: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-02 Thread Howard M. Lewis Ship
] On Behalf Of Knut Wannheden Sent: Wednesday, October 01, 2003 4:57 PM To: [EMAIL PROTECTED] Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods I have written a service implementing this strategy, with a minor difference: I didn't add a nested

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-02 Thread Harish Krishnaswamy
Sent: Wednesday, October 01, 2003 4:57 PM To: [EMAIL PROTECTED] Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods 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

RE: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-02 Thread Howard M. Lewis Ship
: Thursday, October 02, 2003 10:04 AM To: Jakarta Commons Developers List Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods Howard M. Lewis Ship wrote: This looks pretty darn good. Just a few thoughts/observations: 1) Could we just merge ConstructorFactory

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-02 Thread Harish Krishnaswamy
, October 02, 2003 10:04 AM To: Jakarta Commons Developers List Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods Howard M. Lewis Ship wrote: This looks pretty darn good. Just a few thoughts/observations: 1) Could we just merge ConstructorFactory into BuilderFactory

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-02 Thread Knut Wannheden
1) Could we just merge ConstructorFactory into BuilderFactory, to provide both sets of options (using constructors, then optionally setting properties). Certainly. I made some sacrifices to make this eventual step as painless as possible. 2) Could we use

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-02 Thread Knut Wannheden
Sent: Wednesday, October 01, 2003 6:56 PM To: [EMAIL PROTECTED] Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods Howard, I found it was easiest to develop the service as part of the HiveMind project itself. That way I have all the classpaths set up

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-02 Thread Knut Wannheden
Same patch with a quite obvious small tweak (how could I miss that?), which should also make it more readable... --knut Knut Wannheden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Here's a patch adressing all your points, except 4 ;-). Also there is more testing required. I'll try

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Christian Essl
That's certainly a good idea. On Wed, 1 Oct 2003 07:50:42 +0200, Knut Wannheden [EMAIL PROTECTED] wrote: Hi, I was wondering whether it would make sense to extend the BuildFactory service (or maybe add a new wervice) to also be able to construct objects by returning the value of a classes

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Knut Wannheden
I have created a copy of the hivemind.BuilderFactory service which allows me to write: invoke-factory service-id=my.BuilderFactory construct class=foo.Bar static-field=foo.Bar.INSTANCE/ /invoke-factory given that I have something like: package foo; public interface Bar { static final INSTANCE

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Christian Essl
That's very good (and fast implemented). But do you realy have to do the double-check on the class. I mean the user sees anyway what class it is from the JavaDoc and HiveMind will always check that it fits the Service interface. Sure if the static field changes this ensures consistency, but on

RE: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Howard M. Lewis Ship
Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Knut Wannheden Sent: Wednesday, October 01, 2003 1:51 AM To: [EMAIL PROTECTED] Subject: [HiveMind] extend BuildFactory to use static fields/methods Hi, I was wondering whether it would make sense to extend the BuildFactory

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Knut Wannheden
Christian, That's very good (and fast implemented). But do you realy have to do the double-check on the class. I mean the user sees anyway what class it is from the JavaDoc and HiveMind will always check that it fits the Service interface. Sure if the static field changes this ensures

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Johan Lindquist
I may have misunderstood this - but doesn't hivemind always return the same instance when you ask for a service once it has created one (unless it is a threaded service model, when you are worried about state anyway and probably want different instances)? If so, what is the need to have a

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Knut Wannheden
: [HiveMind] extend BuildFactory to use static fields/methods Hi, I was wondering whether it would make sense to extend the BuildFactory service (or maybe add a new wervice) to also be able to construct objects by returning the value of a classes static field or by calling a static method on a class

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Knut Wannheden
In my case I was simply trying to wrap a hivemind service around an existing service (which is generated code), where accessing a static member is required. But I can of course also write a new interface and class to wrap this. --knut Johan Lindquist [EMAIL PROTECTED] wrote in message

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Johan Lindquist
I see - fair point ... Trying to keep a (user defined) interface in synch with generated code is a usually a nightmare ... Johan On Wed, 1 Oct 2003 14:44:01 +0200, Knut Wannheden [EMAIL PROTECTED] wrote: In my case I was simply trying to wrap a hivemind service around an existing service

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Christian Essl
You are right HiveMind always returns the same instance, but I mean there can be services which have no state or the state of which is just defined at construction time and for these it makes in my opinion sense to declare them as (default-variant) static fields. Further for those Services the

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Johan Lindquist
Wouldn't the configuration passed to the factory will make sure the service is returned in a 'usable' state? The user doesn't do any configuration at that level? And the service interface shouldn't really allow configuration changes or? And I am all for the pattern to ensure consistency in

RE: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Howard M. Lewis Ship
Developers List Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods Wouldn't the configuration passed to the factory will make sure the service is returned in a 'usable' state? The user doesn't do any configuration at that level? And the service interface shouldn't

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Johan Lindquist
Ok, I may have not tested this fully ... [Note to self: must make time to test more configuration options] But if the service specified in the builder factory setting and a valid service doesn't exists for that particular setter, won't the builder factory complain? Johan On Wed, 01 Oct 2003

RE: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Howard M. Lewis Ship
BuildFactory to use static fields/methods Ok, I may have not tested this fully ... [Note to self: must make time to test more configuration options] But if the service specified in the builder factory setting and a valid service doesn't exists for that particular setter, won't the builder

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Knut Wannheden
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 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Outside of Kurt's use case ... wrapping around machine-generated code, I

RE: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Howard M. Lewis Ship
://javatapestry.blogspot.com -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Knut Wannheden Sent: Wednesday, October 01, 2003 10:18 AM To: [EMAIL PROTECTED] Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods Then how about a new factory service

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Christian Essl
PROTECTED] 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 [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Harish Krishnaswamy
://javatapestry.blogspot.com -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Knut Wannheden Sent: Wednesday, October 01, 2003 10:18 AM To: [EMAIL PROTECTED] Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods Then how about a new factory

Re: [HiveMind] extend BuildFactory to use static fields/methods

2003-10-01 Thread Knut Wannheden
PROTECTED] Subject: Re: [HiveMind] extend BuildFactory to use static fields/methods 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