Re: WebObjects and dependency injection (DI)
Re: WebObjects and dependency injection (DI)
- Subject: Re: WebObjects and dependency injection (DI)
- From: Andrus Adamchik <email@hidden>
- Date: Tue, 22 Sep 2009 12:20:25 +0300
On Sep 22, 2009, at 11:31 AM, Andrus Adamchik wrote:
We normally use Class.forName().newInstance() in some way or other
to handle that. So can DI help me there? If yes, how?
Also there's a number of standard scenarios, where you can swap the
actual service implementation behind the immutable injected interface
proxy for a short period of time (e.g. within a request thread). A
backend service may have request object injected in it, and when a
service method is called within the request scope, the right request
object is dynamically bound to the interface proxy. (Of course
WORequest is not an interface, so it will require more indirection in
WO).
In the same way you can bind your own request-scoped implementations
of your custom services somewhere in the beginning of the request. And
this transparently sets the execution context for all you other
services and components.
Andrus
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden