You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Istvan Orban <is...@mailbox.hu> on 2004/10/18 20:08:22 UTC
BuilderFactory extension
Hi,
sorry for my ignorance, but I'm intrested if the following thing is a
good idea or not.
If you have a service (B) which can only be instanciated by an other
factory service (A). you have to write your own factory class which
implements the
ServiceImplementationFactory. I have seen some example of doing it.
I think this is a general problem that. the BuilderFactory should not
instance the class by calling it's contructor but to call an other
service's method.
would extending the BuilderFactory be a good idea on the following way.
<invoke-factory service-id="hiveMind:BuilderFactory">
<construct class="MyServiceB"
contructor-service-id="MySerciceA" constructor-method="createServiceB">
.....
<event-listener
service-id="hivemind.ShutdownCoordinator"/>
</construct>
</invoke-factory>
with these extra tags one could specify which method of the MyServiceA
returns an instance of the MyServiceB
so I can use all the power of the Configuration and Autowite provided
already by the the BuilderFactory etc.
I'm asking this because I have seen examples (providing hivernate
session and transaction stuff) where they just implemented the
'ServiceImplementationFactory' but then you have to write again all the
cool function which does the autowite and all other cool stuff for you....
or I can achive the same functionality somehow differently
Thanks!!!
ps: It's a really great tool. I'm amazed how much time it can save for
me...
Istvano
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
Re: BuilderFactory extension
Posted by Istvan Orban <is...@mailbox.hu>.
Hi,
Great. I'm happy that what I though was not totally nonsense ;)
All right, shall I put it to Jira as a feature request?
how exactly you could extend the Object Provider concept to support this?
thanks!!!
IStvano
>That's a pretty good idea; further, the factory method should be
>optional, since HiveMind will often be able to figure it out ("gee, a
>method with no parameters that returns the correct type!"). Also, the
>other "thing" might not be a service (I've been keen to leverage the
>Object Provider concept as much as possible).
>
>
>On Mon, 18 Oct 2004 20:08:22 +0200, Istvan Orban <is...@mailbox.hu> wrote:
>
>
>>Hi,
>>
>>sorry for my ignorance, but I'm intrested if the following thing is a
>>good idea or not.
>>
>>If you have a service (B) which can only be instanciated by an other
>>factory service (A). you have to write your own factory class which
>>implements the
>>ServiceImplementationFactory. I have seen some example of doing it.
>>
>>I think this is a general problem that. the BuilderFactory should not
>>instance the class by calling it's contructor but to call an other
>>service's method.
>>
>>would extending the BuilderFactory be a good idea on the following way.
>>
>> <invoke-factory service-id="hiveMind:BuilderFactory">
>>
>> <construct class="MyServiceB"
>>contructor-service-id="MySerciceA" constructor-method="createServiceB">
>> .....
>> <event-listener
>>service-id="hivemind.ShutdownCoordinator"/>
>> </construct>
>> </invoke-factory>
>>
>>with these extra tags one could specify which method of the MyServiceA
>>returns an instance of the MyServiceB
>>so I can use all the power of the Configuration and Autowite provided
>>already by the the BuilderFactory etc.
>>
>>I'm asking this because I have seen examples (providing hivernate
>>session and transaction stuff) where they just implemented the
>>'ServiceImplementationFactory' but then you have to write again all the
>>cool function which does the autowite and all other cool stuff for you....
>>
>>or I can achive the same functionality somehow differently
>>
>>Thanks!!!
>>
>>ps: It's a really great tool. I'm amazed how much time it can save for
>>me...
>>
>>Istvano
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>>
>>
>>
>>
>
>
>--
>Howard M. Lewis Ship
>Independent J2EE / Open-Source Java Consultant
>Creator, Jakarta Tapestry
>Creator, Jakarta HiveMind
>http://howardlewisship.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>
>.
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
Re: BuilderFactory extension
Posted by Howard Lewis Ship <hl...@gmail.com>.
That's a pretty good idea; further, the factory method should be
optional, since HiveMind will often be able to figure it out ("gee, a
method with no parameters that returns the correct type!"). Also, the
other "thing" might not be a service (I've been keen to leverage the
Object Provider concept as much as possible).
On Mon, 18 Oct 2004 20:08:22 +0200, Istvan Orban <is...@mailbox.hu> wrote:
> Hi,
>
> sorry for my ignorance, but I'm intrested if the following thing is a
> good idea or not.
>
> If you have a service (B) which can only be instanciated by an other
> factory service (A). you have to write your own factory class which
> implements the
> ServiceImplementationFactory. I have seen some example of doing it.
>
> I think this is a general problem that. the BuilderFactory should not
> instance the class by calling it's contructor but to call an other
> service's method.
>
> would extending the BuilderFactory be a good idea on the following way.
>
> <invoke-factory service-id="hiveMind:BuilderFactory">
>
> <construct class="MyServiceB"
> contructor-service-id="MySerciceA" constructor-method="createServiceB">
> .....
> <event-listener
> service-id="hivemind.ShutdownCoordinator"/>
> </construct>
> </invoke-factory>
>
> with these extra tags one could specify which method of the MyServiceA
> returns an instance of the MyServiceB
> so I can use all the power of the Configuration and Autowite provided
> already by the the BuilderFactory etc.
>
> I'm asking this because I have seen examples (providing hivernate
> session and transaction stuff) where they just implemented the
> 'ServiceImplementationFactory' but then you have to write again all the
> cool function which does the autowite and all other cool stuff for you....
>
> or I can achive the same functionality somehow differently
>
> Thanks!!!
>
> ps: It's a really great tool. I'm amazed how much time it can save for
> me...
>
> Istvano
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
>
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
RE: BuilderFactory extension
Posted by Jean-Francois Poilpret <jf...@hcm.vnn.vn>.
Hello Istvan,
Although not going as far as you suggested, I already did some stuff with a
custom Factory service that reuses BuilderFactory without having to rewrite
it fully. The example is attached in JIRA HIVEMIND-69.
In that example, all the "magic" was obtained by reusing the Hivemind class
BuilderFactoryLogic that actually _does_ the work (autowire...)
The major problem I encountered at that time (for which I did not find any
good solution) was that in the config description of the factory service I
had to copy/paste all the parameters-schema of BuilderFactory.
What would have been interesting is:
- giving this parameter-schema a schema-id
- having a mechanism in Hivemind that allows to define a new schema that
_extends_ an existing scheme (in my example not only did I reuse the
<construct> tag of BuilderFactory, but I also added new tags for my own
purpose)
Cheers
-----Original Message-----
From: Istvan Orban [mailto:istvano@mailbox.hu]
Sent: Tuesday, October 19, 2004 1:08 AM
To: hivemind-user@jakarta.apache.org
Subject: BuilderFactory extension
Hi,
sorry for my ignorance, but I'm intrested if the following thing is a
good idea or not.
If you have a service (B) which can only be instanciated by an other
factory service (A). you have to write your own factory class which
implements the
ServiceImplementationFactory. I have seen some example of doing it.
I think this is a general problem that. the BuilderFactory should not
instance the class by calling it's contructor but to call an other
service's method.
would extending the BuilderFactory be a good idea on the following way.
<invoke-factory service-id="hiveMind:BuilderFactory">
<construct class="MyServiceB"
contructor-service-id="MySerciceA" constructor-method="createServiceB">
.....
<event-listener
service-id="hivemind.ShutdownCoordinator"/>
</construct>
</invoke-factory>
with these extra tags one could specify which method of the MyServiceA
returns an instance of the MyServiceB
so I can use all the power of the Configuration and Autowite provided
already by the the BuilderFactory etc.
I'm asking this because I have seen examples (providing hivernate
session and transaction stuff) where they just implemented the
'ServiceImplementationFactory' but then you have to write again all the
cool function which does the autowite and all other cool stuff for you....
or I can achive the same functionality somehow differently
Thanks!!!
ps: It's a really great tool. I'm amazed how much time it can save for
me...
Istvano
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org