We will now have a look at two applications with the same application logic. One is developed using direct dependency initialization and other using dependency injection with Guice. Though trivial, these applications help us better understand what we have theoretically discussed so far.
We will first try to develop the application wherein we try to initialize dependencies and assign them manually. Let's consider a fictitious application for searching flights, where we try to prepare and inject dependencies manually via a constructor. A
FlightEngine is a class, which processes the request via a value object
SearchRequest and returns the response via a value object