Java Annotated Monthly – November 2014

Posted on by

It continually astonishes me how quickly the Java landscape changes. A year ago, reactive programming was over thirty years old. Five years ago, clouds were a weather pattern. Where will our industry be in the next five years? What obstacles lie ahead? How can the software we build today help us solve the challenges we face tomorrow? Let us know what you think.

Java

Java ME 8.1 Developer Preview – Java ME runs on billions of mobile and embedded devices, thanks to its tiny footprint and minimal hardware requirements. The latest developer preview includes support for ARM Cortex M3/M4 chipsets, Freescale FRDM-K64, new security APIs, updated mobile connectivity, tooling support and lots more. Get started with Java ME today!

OAuth 2.0 clients in Java programming – The OAuth 2.0 Authorization Framework is an alternative protocol to OpenID that allows applications to access protected resources on a remote server with a user’s permission, without directly handling the user’s access credentials. In this series, you will learn how to implement an OAuth 2.0 client from scratch in Java.

Java 8 for Financial Services – As we have seen in JSR-354, expected to be released in 2016, Java’s adoption in the financial services industry has grown rapidly and requires new tools to help ensure safe and precise financial transactions. John Davies introduces some key concepts in Java 8 using currency, and tools you can use to help benchmark the results.

JVM

JVM Internals – If you have ever wondered how the JVM works so well, the answer is lots and lots of research. This article is an excellent resource for learning about the JVM and jumping-off point for further exploration. James Bloom covers everything from classloaders to program counters and everything in between. To learn more, check out Java Code To Byte Code.

New features in Ceylon – Hot off the release of Ceylon 1.1, the Ceylon team has big plans ahead, including a serialization API, new language features for type inference, named constructors, inline expressions, as well as Java EE integration and a plugin for IntelliJ IDEA. If you have questions or feedback, join the mailing list or head over to #ceylonlang on FreeNode.

Let’s write a Chip8 emulator in Kotlin – Mario Zechner, creator of libGDX and author of Beginning Android Games, documents creating an emulator for the Chip-8 interpreter while learning Kotlin. In this multipart series, he goes over setting up a development environment, writing the decoder and refactoring his code. Stay tuned for part three on Mario’s blog.

Frameworks

DukeScript – DukeScript is something of a misnomer, since it really is just a web application framework in plain Java that generates HTML and Javascript. But don’t let the name fool you – with a little bit of Java and some annotation processing, you can design fully fledged, cross platform web applications without needing to learn yet another language that ends in “-script”.

Reactor 2.0.0.M1 released – Reactor is a framework for building reactive applications that can scale up to 25 million transactions per second on a single thread, thanks to early work on the LMAX Disruptor. The second major version of the Reactor is a big milestone for Spring, which is now Reactive Streams compliant. To learn more, Michael Nitschinger has the full story.

Apache Camel 2.14 released – Apache Camel is the workhorse of enterprise data routing and migration frameworks. It supports hundreds of different transport protocols, data formats and plays a heavy role in many Service Oriented Architectures (SOA). The latest version now supports a brand new REST DSL, Java 8, Spring 4, Netty 4, and much more.

Mobile

Android Lollipop – Android “L” has officially arrived, bringing many long-awaited updates to the Android operating system, including a new Java runtime, updated APIs, a new design language, high performance audio, and a whole lot more. To get started writing applications on Android Lollipop, here are three open-source applications that showcase best practices on Android L.

Twitter Fabric for Android – Fabric is new suite of mobile SDKs for crash reporting, beta testing, single sign-on, mobile analytics, ad delivery and more, brought to you by Twitter. Fabric is cross platform and comes with plugins for all major IDEs and build tools, making it easy to wire your mobile application to use Twitter’s infrastructure with just a few simple clicks.

Azure plugin for Android Developers – Microsoft offers a competing platform for delivering mobile services with additional support for push notifications, data synchronization, data storage, authorization and authentication, and more. Now, there is also a new IntelliJ IDEA plugin for simple integration with Android. Azure Mobile Services has a three-tier pricing model.

Android App Development Course – Now is a great time to start learn Android development, and there are plenty of educational resources to help you get started. In this course, compiled by Soham Mondal and Lohith Vrushabendrappa, there are over 90 hours of recorded materials from Google, Twitter, Coursera, NewCircle and others to help you learn Android programming.

ProGuard: Real World Example – ProGuard is more than just an obfuscator, it includes tools to help you compress and optimize your code through dozens of customizable options. Alexey Shmalko takes us through the packaging process for a proprietary application with ProGuard.

Performance

Large HashMap overview – Mikhail Vorontsov analyzes the runtime performance of six popular HashMap implementations using the Java Microbenchmarking Harness (JMH), in each of four object-primitive key-value combinations. One stands out among the crowd, although there is some question of stability. You can read and verify all of the results on Mikhail’s blog.

Improving regex performance on the JVM – If you’re looking for a high-performance regular expressions library for Java, re2java is a regex engine written in C++ with a Java wrapper. In this blog post, Ugo Scaiella describes the implementation and performance of writing a fork of the re2 library for Java, with some examples to help you get started.

The Mythical Modulo Mask – Nitsan Wakarat does battle with the Java compiler, benchmarking the performance of a bit manipulation hack and chasing down assembly in order to discover which modulo method is the fastest, and draws a number of interesting conclusions about JIT optimizations, arrays and other data structures. Here be dragons.

Community

A Large Scale Study of Programming Languages and Code Quality in Github – This study conducted by Baishakhi Ray and colleagues at UC Davis is part of the emerging discipline of empirical software engineering, which seeks to apply the scientific method to software, through observational studies and statistical methods. See here for an in-depth discussion on /r/haskell.

Getting Started with Java Development on Docker – This tutorial from Matthias Lübken goes over launching a Java web application powered by Spark from a Docker image in a few easy steps. You can download a copy of the source code from the GiantSwarm repository.

Java bean mapping with Orika – Orika is a Java bean mapping framework that uses runtime bytecode generation to create fast mappers with a low overhead. Javier Beneito has plenty of examples for using orika with Spring integration. For more information, see orika-mappers.