You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pmularien <pe...@mularien.com> on 2007/11/09 18:03:39 UTC
Question about Guice integration with Wicket 1.3 beta 4
Hi Wicket folks,
I've just spent some time converting a Wicket 1.2.6 / Spring 2.0 / Hibernate
3 project that we did to Wicket 1.3 beta 4 / Warp (bleeding edge ;) / Guice
1.0.
I am happy to report it went very smoothly. I actually had a question on the
class hierarchy for wicket-ioc and how it relates (or doesn't) to
wicket-guice.
Was there a conscious design decision to not use the
org.apache.wicket.injection.web.InjectorHolder class (and, by association,
have the wicket-guice stuff inherit from ConfigurableInjector)? It would be
pretty convenient if the GuiceComponentInjector worked similarly to the
SpringComponentInjector and stuffed away a reference to the Guice injector -
for easy access throughout the application, and also for easier mock
testing.
Just curious - thanks for all the hard work :)
Peter Mularien
--
View this message in context: http://www.nabble.com/Question-about-Guice-integration-with-Wicket-1.3-beta-4-tf4778901.html#a13671046
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Question about Guice integration with Wicket 1.3 beta 4
Posted by pmularien <pe...@mularien.com>.
James,
The _official_ project itself wasn't migrated - that remains on Wicket 1.2 /
Spring 2 / Hibernate.
The migration was simply for my own purposes of hands-on learning. I wanted
to see whether a working, relatively simple database-driven application
using the aforementioned stack could be moved from one stack to the other
(Wicket / Warp-persist / Guice). For me, it's more helpful to work with a
real application for these kinds of things than to try to concoct an
artificial example.
There's starting to be enough interest in how/where Guice fits into the web
stack (and we're in the business of knowing the answers) that I felt like
the time invested to try it out would be worthwhile.
Peter
msc65jap wrote:
>
> Hello Peter,
>
> Out of interest why did you migrate from a Spring/Hibernate design to
> Guice?
>
> Cheers,
> James.
>
--
View this message in context: http://www.nabble.com/Question-about-Guice-integration-with-Wicket-1.3-beta-4-tf4778901.html#a13671501
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Question about Guice integration with Wicket 1.3 beta 4
Posted by James Perry <ja...@gmail.com>.
Hello Peter,
Out of interest why did you migrate from a Spring/Hibernate design to Guice?
Cheers,
James.
On Nov 9, 2007 5:03 PM, pmularien <pe...@mularien.com> wrote:
>
> Hi Wicket folks,
>
> I've just spent some time converting a Wicket 1.2.6 / Spring 2.0 / Hibernate
> 3 project that we did to Wicket 1.3 beta 4 / Warp (bleeding edge ;) / Guice
> 1.0.
>
> I am happy to report it went very smoothly. I actually had a question on the
> class hierarchy for wicket-ioc and how it relates (or doesn't) to
> wicket-guice.
>
> Was there a conscious design decision to not use the
> org.apache.wicket.injection.web.InjectorHolder class (and, by association,
> have the wicket-guice stuff inherit from ConfigurableInjector)? It would be
> pretty convenient if the GuiceComponentInjector worked similarly to the
> SpringComponentInjector and stuffed away a reference to the Guice injector -
> for easy access throughout the application, and also for easier mock
> testing.
>
> Just curious - thanks for all the hard work :)
>
> Peter Mularien
> --
> View this message in context: http://www.nabble.com/Question-about-Guice-integration-with-Wicket-1.3-beta-4-tf4778901.html#a13671046
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Question about Guice integration with Wicket 1.3 beta 4
Posted by pmularien <pe...@mularien.com>.
Al Maw wrote:
>
> Yeah. I think maybe:
>
> public static ConfigurableInjector getInjector() {
> return getInjectors(null);
> }
>
> public static ConfigurableInjector getInjector() {
> if (type == null && injectors.size() > 1) {
> throw new IllegalArgumentException(
> "Have more than one Injector available"
> );
> }
> }
>
> ...sort of thing, would make some sense. That way we won't break
> existing people's code. I'll have a look into this ahead of the RC2
> release.
>
> Could you create a JIRA issue for it please?
>
> Regards,
>
> Al
>
Looks good to me, I've filed a JIRA pointing back to this discussion. Thanks
for listening!
JIRA:
https://issues.apache.org/jira/browse/WICKET-1143
Peter
--
View this message in context: http://www.nabble.com/Question-about-Guice-integration-with-Wicket-1.3-beta-4-tf4778901.html#a13673514
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Question about Guice integration with Wicket 1.3 beta 4
Posted by Al Maw <wi...@almaw.com>.
pmularien wrote:
>
> Al Maw wrote:
>> Yes, there was, and this issue hasn't been resolved for 1.3 yet.
>>
>> I did it like this because some people will want to use both Guice and
>> Spring in their apps at the same time, especially if they're
>> mid-migration.
>>
>> We should come up with a decent way to make this still possible.
>> Suggestions/patches are welcome.
>>
> Suggestions (not really thought through well, so apologies if they seem
> silly):
> - InjectorHolder.getInjectors() returns any/all injector references
> - InjectorHolder.getInjector(_some enum / constant)
>
> If you're planning supporting multiple ConfigurableInjectors within the same
> wicket app simultaneously, changing InjectorHolder to a multi-valued object
> would make the most sense. Although I agree this gets a bit away from the
> simplicity of the existing model.
Yeah. I think maybe:
public static ConfigurableInjector getInjector() {
return getInjectors(null);
}
public static ConfigurableInjector getInjector() {
if (type == null && injectors.size() > 1) {
throw new IllegalArgumentException(
"Have more than one Injector available"
);
}
}
...sort of thing, would make some sense. That way we won't break
existing people's code. I'll have a look into this ahead of the RC2 release.
Could you create a JIRA issue for it please?
Regards,
Al
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Question about Guice integration with Wicket 1.3 beta 4
Posted by pmularien <pe...@mularien.com>.
Al Maw wrote:
>
> Yes, there was, and this issue hasn't been resolved for 1.3 yet.
>
> I did it like this because some people will want to use both Guice and
> Spring in their apps at the same time, especially if they're
> mid-migration.
>
> We should come up with a decent way to make this still possible.
> Suggestions/patches are welcome.
>
Suggestions (not really thought through well, so apologies if they seem
silly):
- InjectorHolder.getInjectors() returns any/all injector references
- InjectorHolder.getInjector(_some enum / constant)
If you're planning supporting multiple ConfigurableInjectors within the same
wicket app simultaneously, changing InjectorHolder to a multi-valued object
would make the most sense. Although I agree this gets a bit away from the
simplicity of the existing model.
Peter
--
View this message in context: http://www.nabble.com/Question-about-Guice-integration-with-Wicket-1.3-beta-4-tf4778901.html#a13671825
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Question about Guice integration with Wicket 1.3 beta 4
Posted by Al Maw <wi...@almaw.com>.
pmularien wrote:
> Was there a conscious design decision to not use the
> org.apache.wicket.injection.web.InjectorHolder class (and, by association,
> have the wicket-guice stuff inherit from ConfigurableInjector)? It would be
> pretty convenient if the GuiceComponentInjector worked similarly to the
> SpringComponentInjector and stuffed away a reference to the Guice injector -
> for easy access throughout the application, and also for easier mock
> testing.
Yes, there was, and this issue hasn't been resolved for 1.3 yet.
I did it like this because some people will want to use both Guice and
Spring in their apps at the same time, especially if they're mid-migration.
We should come up with a decent way to make this still possible.
Suggestions/patches are welcome.
Regards,
Al
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org