Java Weekly 38/15: Compose functions, J9 Modules, Monitoring
This week’s Java news sees Thorben Janssen looking at a series about implementing the observer pattern, standardised schema generation via JPA and recordings from the JavaZone 2015 conference. All this and more with this week’s hottest Java links.
This post originally appeared on Thorben Janssen’s Java EE blog, where Java news is published weekly: thoughts-on-java.org.
The Apache Tamaya project is an incubation project which tries to establish a standard configuration solution for Java applications. After nearly one year of development, the project team released the first 0.1-incubation release. Anatole Tresch wrote an interesting blog post about it, in which he describes the basic concepts of Apache Tamaya and shows how to use it to configure a simple application: Apache Tamaya – the new Configuration API.
Did you know that you can compose Java 8 Functions to create new, more powerful ones? Marius Herring shows in his recent blog post how to do it by using the methods compose and andThen of the Java 8 Functions interface: Java 8: Composing functions using compose and andThen.
It all has to do with creating small reusable functions that you can combine to compose new functions.
Mark Reinhold published an update to JEP 261: Modules System which will implement the Java Platform Module System (JSR 376) as part of Jigsaw. The description of it provides some interesting insides on the upcoming changes.
Anghel Leonard wrote a nice series of posts showing different ways to implement the observer pattern:
- He shows how to use the plain Java interfaces Observer and Observable in part one: JSF and Observer design pattern – part I (plain code)
- In part two, he explains and uses the CDI event mechanism: JSF and Observer design pattern – part II (Java EE)
- He has a detailed look at the JSF event mechanism in the third part: JSF and Observer design pattern – part III (JSF implementation)
- In the fourth and final part of the series, Anghel shows how to use the DeltaSpike event broadcasting mechanism: JSF and Observer design pattern – part IV (DeltaSpike event broadcasting)
Generating the database schema via JPA is a common approach to get a project started or to setup the environment for automated tests. Up to JPA 2.1, you had to use proprietary features of your specific persistence provider to do it. All of them offered a different way to do it. This was finally changed with JPA 2.1, which defines a standard way to generate a database schema and fill it with an initial set of data: Standardised schema generation and data loading with JPA 2.1.
This and that
Monitoring an application in production and finding the right metrics to follow is often not an easy task. In his recent blog post, Alex Zhitnitsky gives a nice overview about 7 important performance metrics for Java applications: 7 Java Performance Metrics to Watch After a Major Release.
The JCP announced their 2015 Award Nominees in the categories Member of the Year, Outstanding Spec Lead, Most Significant JSR and Outstanding Adopt-a-JSR Participant. The winners will be announced at the JCP party during JavaOne.
Congratulations to all nominees!
The JavaZone 2015 conference took place last week and the organisation team already published the recordings of their sessions: JavaZone 2015. Not all of the sessions are in English but there are some quite interesting ones, like Peter Lawrey’s session about low latency in Java 8.