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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to