GuiceCon 2011 - Sisu

1,918 views
1,851 views

Published on

Overview of the Sisu container, which builds on Guice 3, and possible future ideas / features.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,918
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • GuiceCon 2011 - Sisu

    1. 1. Sisuhttps://github.com/sonatype/sisu
    2. 2. Sisu Finnish for Perseverance JSR 330+ Plugins Shims Wouldn’t It Be Nice If...
    3. 3. sisu-inject-bean <dependency> <groupId>org.sonatype.sisu</groupId> <artifactId>sisu-inject-bean</artifactId> <version>2.2.0</version> </dependency> Guice Extension Compatible with Guice 3 OSGi Bundle Only 235k :)
    4. 4. JSR 330+ @Named( "hint" ) @EagerSingleton class SomeComponent { @Named } @Typed( SomeType.class ) class AnotherComponent { }@InjectList<Component> componentList; @Inject Map<String, Component> componentMap; @Inject @Named( "${dbdriver}://${dbhost}:${dbport:-5432}/${dbname}" ) URL databaseURL;
    5. 5. PluginsInjector per-pluginBean Locator Aggregates injectors Sorts bindings by rankNon-local dependencies bound via Locator
    6. 6. maven-core (Plexus) BeanLocatormaven-compiler-plugin maven-jar-plugin maven-install-plugin
    7. 7. Wire Module Leans heavily on Guice SPI Finds and Binds missing dependencies new WireModule( new SpaceModule... ) Can be re-used! Extend + Override wiring method
    8. 8. Space Module Based on Class Space abstraction Scans classes for @Named components Supports caching and indexing Can be re-used! Extend + Override visitor method
    9. 9. Ranked Bindings Sorts using Rank + UID Supports concurrent iteration+mutation Re-positions iterator as necessary Sources of bindings are also ranked Lazy lookup, unrolling as necessary
    10. 10. Shims Maven3 + Plexus Both <XML/> and @Component Nexus Plugins Hudson + SezPoz ... Mix and Match!
    11. 11. Basic Shim Approach Map bindings to canonical form (Guice) Cache additional metadata Use Type Listeners: Custom injection Custom Lifecycle (be careful of dependency cycles!)
    12. 12. Wouldn’t It Be Nice If ... Lifecycle Support IDE Support Component Catalogue ...?

    ×