Working with frameworks like spring in java we take the dependency injection for granted but what if we are not using any framework and have to manage the dependency injection ourselves!.
Google Guice to the rescue!
Google Guice: https://github.com/google/guice
DI using Guice in 3 steps:
- Define binding
    @Override
    protected void configure() {
        bind(Order.class).to(OrderImpl.class);
    }
}
- User @Inject annotation on the service constructor
 @Inject
 public OrderService(Order order) {
     this.order = order;
 }
- Build object using injector
Injector injector = Guice.createInjector(new OrderModule());
OrderService orderService = injector.getInstance(OrderService.class);