Over a million developers have joined DZone.

Building an Application with Modern Java Technologies

Check out these Game of Life application samples with modern Java technologies.

· Java Zone

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

Sometimes Java gets a bad rap from Agile software developers who suspect it to be a legacy technology on par with COBOL. I understand that being the most used language on the planet means there must be projects of all shapes and sizes out there, including lots of legacy.

That said, Java and the JVM comprise a huge and vibrant ecosystem producing value in all kind of domains from banking to Android applications and scientific software.

So I built a sample Game Of Life with what I believe are modern Java tecnologies:

  • Java 8 with lambdas support
  • Gradle for build automation and dependency resolution (substitutes include both Ant and Maven)
  • Jetty as an embedded server to respond to HTTP requests
  • Jersey for building the RESTful web services that calculate new generations of a plane, using JAX-RS
  • Freemarker templating engine to build HTML
  • Log4j 2 for logging, encapsulated behind the interface slf4j

On the testing side of things:

Here's the result:

The application is self-contained and can be compiled, tested, and run without any IDE or previous machine setup except having a JDK 8 on your machine. See the project on Github for details.

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:
java ,java 8 ,gradle ,jetty ,freemarker ,log4j2 ,junit ,mockito ,quickcheck ,selenium

Published at DZone with permission of Giorgio Sironi, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}