Guice Stories ( Part 2)

Guice Stories ( Part 2)

For those of you who missed out, Part 1 of our Guice Stories series focused on Bootique and Guice’s importance to it, especially for dependency injection. Let’s continue on the journey with more Google Guice stories.

Story 3: Filling Maps and Collections

Previously, we saw the examples of adding objects to MapBinder. Let’s dwell on this for a moment. Here, I will use Multibinder for a change (remember, it produces an injectable Set<SomeType>), but the discussion applies to MapBinder just as well. What can we put in these DI-managed collections? If the objects in the Set are trivial to create and do not rely on any dependencies, we can add them as instances:


via Feed

May 23, 2017 at 05:27PM


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s