The Java Trove: Part II

Published October 10th 2016.

In the first part of this series, we learned how to build a simple JavaFX application that’s able to query a REST-based API and display the results. To summarize, we used Retrofit to define a Java-based wrapper on top of GitHub’s REST API. The data coming from the server was transformed from JSON into Java beans using Jackson. The source code of the Java beans was kept to a minimum with Lombok, a bytecode generation tool. JDeferred was used to invoke the network call outside of the UI thread, leveraging the concept of promises and callbacks. Any errors during processing were sent as events through a lightweight event bus provider, MBassador, ensuring low coupling between components as a result. Finally, all components were glued together using Google Guice, the reference implementation of JSR 330, the dependency injection JSR for Java SE.

Now it’s the time to figure out how these components can be tested. Remember that the full source code is also available under the GPL3 license at javatrove/github-api-01.

Continue reading the rest of the article at the OTN Java Community space.

ˆ Back To Top