By Anatoly Ivanov, Sibers Java Team Leader
Google again and again proves its high class. It has released a wonderful creation for most projects, especially small and mid-sized.
Evaluate excellent binding api:
binder.bind(Service.class).to(ServiceImpl.class);
Looks like a natural language (in elaboration of hibernate ideas).
The new Guice can perform annotation based dependecy injection (without any xml nightmare (Spring), fast and elegant) and aop (based on aop alliance).
Nevertheless, to be suitable for large projects Guice lacks some useful Hivemind features:
- module organization (which is absent in Spring as well). Modules are very convenient to write utility libraries or to divide the project into parts, and Hivemind finds and picks up modules automatically, which is its certain advantage.
- configurations. Hivemind allows describing the configuration scheme (like xml schema or dtd) and then configurating files in the config file; no parsers, much easier than dtd.
Google doesn’t surprise with configuration through annotations as Hivemind 2 had such a feature as well. Google feature seems to work faster, but it’s not essential as main delays usually appear at the level of making the repository and are negligible compared with the Hibernate initialization.
Summing up, if you ask me, both GWT and Guice cater for novice developers and not very difficult tasks. The tasks are not necessarily simple, but Guice doesn’t seem to be good for writing big repositiries (with more than 100 servers). It is also unilikely to be wide spread in big projects, where Spring seems to prevail. Small and mid-size projects, however, can fully use its advantages as Spring’s and Hivemind’s power is not always necessary and the latter are quite difficult to master.