gaojunda / simple-spring-memcached

Automatically exported from code.google.com/p/simple-spring-memcached
MIT License
0 stars 0 forks source link

Guice support #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be beneficial if SSM supported Guice as an alternative to Spring. The 
dependency injector library should be an add-on.

The primary challenge appears to be the use of AspectJ advices instead of 
AOPAlliance's method interceptors. There is probably an adapter scheme, as 
Spring supports both, so that Guice's AOPAlliance support can be leveraged. I 
haven't figured out that detail, though.

Original issue reported on code.google.com by Ben.Manes@gmail.com on 29 Jun 2013 at 7:34

GoogleCodeExporter commented 8 years ago
Replacing Spring with Guice is harder than it may seem. Some core SSM classes 
are Spring beans that implement Spring specific interfaces used to hook in 
correct life-cycle phase. 
Does Guice support similar lifecycle like Spring? Is it possible to hook in 
shutdown/destroy phase? I remember that it was a problem in previous Guice 
versions.

Are you interested in contributing to the SSM project to add Guice support?

Original comment by ragno...@gmail.com on 1 Jul 2013 at 6:58

GoogleCodeExporter commented 8 years ago

Original comment by ragno...@gmail.com on 1 Jul 2013 at 6:58

GoogleCodeExporter commented 8 years ago
No, Guice does not provide life cycle management out of the box. This can be 
added with extensions, but its preferred to view Guice as a factory. Its been a 
long time since I've used Spring, but I think typical usages can be mapped to 
Guice scopes (e.g. request & session scopes for http).

I may or may not contribute Guice support as I'm still figuring out how I want 
to introduce memcached. In the pre-1.0 days of SSM I chatted with Nelz on his 
design, offering tips from my experience of writing a similar library. At the 
time I had to support mapping multiple keys to a single value (see his note in 
your FAQ). I put the metadata on the model, e.g. JPA-style, instead of on the 
service's CRUD operations. That approach provides more flexibility, but putting 
the metadata on the domain model isn't always feasible (e.g. if code 
generated). I'm not sure what my needs will be this time around and I had hoped 
prototyping with SSM would be easy to get up and running.

Original comment by Ben.Manes@gmail.com on 1 Jul 2013 at 7:31

GoogleCodeExporter commented 8 years ago
This issue has been moved to github: 
https://github.com/ragnor/simple-spring-memcached/issues/19

Original comment by ragno...@gmail.com on 24 Feb 2014 at 5:50