hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject RE: services...
Date Fri, 13 Jan 2006 14:39:25 GMT
Why can’t you use autowiring?



From: Norbert Sándor [] 
Sent: Friday, January 13, 2006 9:31 AM
To: Users HiveMind
Subject: services...




I have a small "framework" built on hivemind.

There are several well known internal framework services, and some other
services which may (or should) be defined by the user.


Let's suppose that there is a SessionFactory service interface, the user can
define several session factory services in the descriptors like


<service-point ...

    <invoke-factory ....



            supply some parameters to the service like database URL, user
and password


            (***) inject internal framework dependencies






I have problems at (***). Because the given SessionFactory implementation
depends on several internal framework services as well, the user must know
the IDs of these services and inject them in case of each session factory
service point, which is neither good or efficient.


Is there a way to access the registry from a service implementation to avoid
this problem? (Or any other solutions?)

In my specific case the given SessionFactory implementation would not
require the manual injection of the internal services at (***) but it would
get them directly from the registry or module! Something similar to Spring's
ApplicationContextAware would be great... I know it is not as clean as pure
injection but much simpler and safer for the user of my framework!


(I read in the docs that service deserialization uses a static registry
variable. Is there a way for services to use it?)


Of course annotations would come handy in this case, as always :)

Using annotations, I would be able to define "default" injections in my
SessionFactoryImpl service class, so the user won't need to care for them in
the descriptors!


Any thoughts welcome! (Sorry for the long post!)



View raw message