airlift/airline — pull request #33 by staenker (2014-09-13 07:39:59+00:00)
Title: di-support

I extracted ParserUtil.createInstance into a Factory interface. This is configurable using the builder. The default Implementation is using the logic from the old createInstance method in ParserUtil. This way, the change is fully backwards compatible but allows users to implement and provide their own factory implementation. This enables them to use Guice or Spring DI containers to instatiate their commands. In Short: I added dependency injection support. The next step would be to provide The Factory Implementations for the various di frameworks but that would mean adding dependencies to those frameworks which will be inherited by any projects using this library. A better approach would be to convert this project to a maven multi module project and add one module for each Factory. Third option would be to update the documentation and leave the Factory implementation up to the user. Which is your preferred option?