Java Weekly 50/15: Jigsaw, CDI and EJB alignment, RAML

Datetime:2016-08-23 01:57:30          Topic: EJB           Share

This post originally appeared on Thorben Janssen’s Java EE blog, where Java news is published weekly:  thoughts-on-java.org .

The feature complete milestone for JDK9 was scheduled for 10 December and Project Jigsaw is the most important feature of it. But the JSR 376 expert group has not published their Early Draft Review Specification yet and Jigsaw is not ready. Therefore Mark Reinhold suggested a six-month extension of the JDK9 schedule so that the feature complete milestone would be moved to 25 May 2016: Proposed schedule change for JDK 9 .

Neil Bartlett wrote a nice comment on the proposed delay of JDK9 and suggests to release Jigsaw as it is now. He thinks that it already provides lots of benefits and that the EG should not try to replicate features which are already specified and implemented by OSGi: Jigsaw is a Shibboleth .

What do you think about it?

Java EE

EJB and CDI are two fundamental Java EE technologies and many developers wonder which one they should use for a specific task. Both technologies seem to be similar to each other and there are lots of use cases which can be easily implemented with both of them. But there are also several differences between them. Linda De Michiel gave an interesting talk at the JavaDay Tokyo 2015 discussing the advantages and disadvantages of both technologies, their alignment and the strategy for the future: EJB and CDI – Alignment and Strategy .

Romain Manni-Bucau shows in his recent post how to create a bean mapper as a CDI extension. Based on this small extension with only 3 annotations and 3 classes, you can define the mapping between two beans with just a few annotations at an interface method: Write your own CDI extension for bean mapping .

Vlad Mihalcea was looking for a way to bootstrap Hibernate without providing a persistence.xml and all the boilerplate code required by the JPA standard API. This can be quite useful, if you want to setup isolated test cases like he did for his book and can be easily done with Hibernate’s proprietary API: How to bootstrap Hibernate without the persistence.xml file .

This and that

There are lots of different ways to document RESTful APIs and RAML is one of them. I haven’t used it myself but the features and syntax described in this tutorial looks quite promising: Introduction to RAML – The RESTful API Modelling Language .

I might give it a try in one of my following projects. Have you used it for one of your projects?

Finding the optimal size of a connection pool is not an easy task. Brett Wooldridge wrote a very interesting post in which he explains why it is most often way smaller than you expect and why it depends on the resources available to the database, and not on the number of parallel users of your application: About Pool Sizing .





About List