you can inject into transient fields but then you need to somehow magically reinject when a page is deserialized so you need some writereplace magic for serialization that reinjects when deserialized
you can use bytecode to instrument the getters or maybe even the fields themselves to use some lazy lookup + transient techinique, but then that is not quote true end quote ioc either and you have to intercept every new invocation which might slow things down
there is more info on the spring page in the wiki
-Igor
On 6/7/06, Igor Vaynberg <[EMAIL PROTECTED]
> wrote:
what prevents quote true end quote dependency injection is that wicket components are not beans. they make full use of the properties of java constructor semantics and are unmanaged ( you invoke new operator not a container ). because of the usage of constructor the dependency have to somehow be injected before the constructor executes because they are used inside, the only way to do this without some fancy ioc is to use a base class' constructor. setter methods are simply too late in the game to be of any use.
this has been discussed many many many times on this list so if you are interested search the archives.
furthermore, it is not just a service locator, with annotations it is hybrid, eg @SpringBean private MyService service; <== no call to a locator from your end, done for you via a generated proxy.
you should be able to create a wicket-spring like IFieldValueFactory that would use osgi environment to look up the service.
i need to move the base (non-spring) proxy stuff directly into wicket codebase, at least for 2.0
-IgorOn 6/6/06, Ben Fortuna < [EMAIL PROTECTED]> wrote:Hi all,
I've been investigating the possibilities of integrating Wicket and
OSGi with favourable results. However, one major hurdle, which I think
a couple of others have also pointed out here, is that there is as yet
no solution providing "true" dependency injection for Wicket.
I've looked at the wicket-spring examples, and to me this seems to be
using the Service Locator pattern rather than Dependency Injection.
That is fine as a solution, but consider the following example: I want
to be able to register my Wicket pages as services (concept should be
similar regardless of IoC container) and have other
services/components that are (optionally!) able to "inject" additional
components into these pages.
With my basic knowledge of Wicket, this example would seem impossible
as there must be a "placeholder" in the page's HTML that will
correspond to each of the components in the page's component tree. So
ultimately it seems the page component count cannot be altered at
runtime.
Is there something I am missing here? I'm hoping there is some way to
be able to alter the component count at runtime, or perhaps even
specify "optional" components in the page HTML that may or may not be
present in the component tree (still not real dependency injection,
but a compromise I'd be willing to make).
TIA.
regards,
ben
--
http://blogs.modularity.net.au/thenextbigthing
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
