Hi folks,
one of the lesser elegant things to do when migrating existing Turbine
services to Fulcrum components is the fact that you have to know where
you get the service from - we are actually violating the service
location transparency which is not utterly unimportant.
I'm currently working my way through the latest SVN version of Turbine
and I think the following things could work
1) TurbineServiceProvider approach
============================================================
*) changing org.apache.turbine.services.ServiceBroker to return Object
instead of Service
*) define a generic TurbineServiceProvider interfaces exposing methods
to lookup and release services
*) change the existing Turbine service lookup to delegate service
lookups (regarding unknown services) to Turbine services implementing
TurbineServiceProvider interface
+) this would allow transparent service lookup for many IOC containers
to come .... ;-)
+) this approach actually works with Turbine since callers of Turbine
services are usually not casting to Service
+) it is backward compatible for clients casting to the desired service
interface
+) it is rather straightforward to implement
-) it changes the existing ServiceBroker interface and is highly visible
2) Dynamic Proxy approach
============================================================
It is possible to wrap the interfaces of an arbitrary object into an
dynamic proxy which could also expose the existing Service interface
+) would not change the current interfaces
-) tricky, overengineered and a little bit fragile (btw, we call that
"edelhack" ... awesome but futile in the long run)
-) in the general case the is no meaningful implementation for many of
the Service methods.
IMHO 1) would be the way to go but before I invest too much time I would
like to ask for some opinions out there ... any PMCs alive and kicking
are especially welcome ... :-)
Thanks in advance
Siegfried Goeschl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]