Guice vs PicoContainer

195 views
Skip to first unread message

rinswind

unread,
Jul 10, 2007, 1:28:57 PM7/10/07
to google-guice
Has anyone used the PicoContainer before Guice?
I believe it was the first light-weight dependency injection framework
ever. Because of that it lacks the nice Java 5 annotations approach
but it is still very nice and clean. It would be educational to
compare Guice with PicoContainer in terms of design to see what is it
that Guice does better and perhaps vice versa.

Cheers,
Todor

Dhanji R. Prasanna

unread,
Jul 10, 2007, 6:38:08 PM7/10/07
to google...@googlegroups.com
Pico is more of a DI engine than a complete DI container/framework. You require some meta-layer to configure pico (hence the existence of nanocontainer). Off the top of my head pico does the following that guice does NOT:

- multicast
- lifecycle
- container chaining
- visitation (though arguably aop is this)
- container extensibility (dynamic rebinding among other things made possible)

guice does the following better (or more complete) compare with pico:

- aop
- scopes
- method/field injection
- module/configuration
- providers
- static injection

These are incomplete lists of course. Comparing pico and guice is unfair as Ive already stated guice is a full-fledged DI framework but pico is more of an internals "engine." One could conceivably use pico to build a DI container to guice's contract.

Feature-wise it looks as though pico tips the scales, but I think you'll find guice is more straightforward and better suited to client applications (pico better for embedding under the covers). Also hopefully, guice1.1 will catch up some of those feature gaps =)

Dhanji.
Reply all
Reply to author
Forward
0 new messages