Newbie question about on WOInject (so for Henrique)
Newbie question about on WOInject (so for Henrique)
- Subject: Newbie question about on WOInject (so for Henrique)
- From: Philippe Rabier <email@hidden>
- Date: Mon, 02 Apr 2012 11:25:09 +0200
Hi Henrique,
I prepare my brain to use WOInject. I have a specific case where I need your help.
We have 2 frameworks:
- web services
- foundation
which have no dependency with WO, EOF, … ("pure" java I could say).
Foundation provides factories used by web services but they return objects implementing java interfaces. This factory have a static method to set the class to instantiate like this:
NFNotificationFetcherFactory.setCreateNotificationFetcherClass2Instantiate(MyClass.class);
We have also a Business framework which relies on EOF and the framework principal initializes the factories with the concrete classes. (so calling the method above).
So as you may imagine, I thought at first replacing this mechanism with WOInject.
I like the fact that our business framework initializes the factories. We have now 5 different apps using our business framework but they don't care what class must be instantiated. Using WOInject/Guice, I have the impression that the modules must be declared at a higher level aka the application. In my example above, web services knows foundation and business knows foundation but there is no dependency between web services and foundation.
So I have 2 questions:
- can a module be loaded by a framework principal in the finishInitialization method?
- is the injection mechanism efficient (in our case, a new object is created each time there is an http request)?
Best regards,
Philippe - @prabier
_______________________________________________
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