Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Øredev 2010 - Guice and @Inject
Upcoming SlideShare
Loading in …5
×

Øredev 2010 - Guice and @Inject

2,228 views

Published on

If @Inject is the new new then is Guice the new you? See how Guice makes application assembly a snap, saving you from spaghetti-hell.

This talk covers the basics of @Inject/Guice before diving into examples that use servlets, persistence, and classpath scanning. Nexus and Maven3 already run on Guice - will your code be next?

Published in: Technology
1 Comment
7 Likes
Statistics
Notes
No Downloads
Views
Total views
2,228
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
55
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide


  • hints for anyone extending or re-using class
    can still load class without annos on classpath

  • Spaghetti!
    what do I need to wire?
    XML == paper manual (which might go missing)
  • No need for paper manual
  • Provider like factory -> get() ... no context passed in!
    @Qualifier meta-annotation
    at least 5 implementations so far

  • setters can have multiple arguments



  • Lazy loading
    Multiple values
    Mixing scopes





  • eager singletons?



  • + concrete types
  • AOP alliance (like JSR330)

  • web.xml
  • web.xml
  • all servlets and filters must be @Singleton’s
    mention @RequestScoped / @SessionScoped
    sitebricks!
  • persistence.xml
  • starts / stops JPA
  • session-per-transaction
    supports rollback on exception

    MyService instance(s) must be created by Guice
  • session-per-http-request / open-session-in-view

    no need to explicitly start PersistService




  • ×