With Real World Java EE Night Hacks, Adam Bien follows on from his previous book Rethinking Best Practices, this time providing more practical examples. Covering CDI, Rest, JPA2, JMX and much more, this is an essential book for Java EE developers. I spoke with Adam about his book and the future of JavaEE.
DZone: Could you introduce yourself to the readers please?
Adam Bien: My name is Adam Bien, pronounced like (Enterprise Java) Bean. I’m using Java since JDK 1.0. I’m working in Java EE 6 projects as independent (coding) consultant / architect and really enjoying it.
I especially appreciate the unbelievable productivity of Java EE 6.
DZone: How does "Real World Java EE Night Hacks" follow on from your first book, "Real World Java EE Patterns"?
Adam Bien: The purpose of the “Rethinking Best Practices” book is eradication of all superfluous J2EE Patterns and strange practices. I also introduce some lean Java EE architectural principles and new patterns. The new patterns, however, will be a lot harder to eliminate with upcoming Java EE versions :-)). The“Rethinking Best Practices” book is a Java EE pattern catalog. I had to justify my “alien” architecture over and over again in my projects. Java EE Patterns explains why Java EE is so different to J2EE.
I got several hundred questions/requests regarding a holistic view of Java EE software development.
“Night Hacks” describes x-ray - a blog statistics software written with vanilla Java EE 6 (EJB 3.1, CDI 1.0, JPA 2, Maven, JAX-RS, JUnit, Maven 3, Jenkins/Hudson...) which tracks the popularity of posts in my blog. I describe everything from design over build to stress tests as concisely as only possible.
DZone: Has much changed since you wrote Real World JavaEE Patterns?
Adam Bien: Now I have two years more Java EE experience and can be even more pragmatic. My current Java EE 6 architectures are even simpler than two years ago as “Rethinking” was written. Also some interesting patterns emerged in my client projects and even x-ray. I will extend “Rethinking” in the next iteration with new ideas. The core principles will remain the same.
Obviously the book provides a great reference to those writing Java EE applications. Which do you consider to be the most important chapter/section?
The “x-ray services” chapter discusses asynchronous processing, JMX monitoring, unit- and integration-tests, events with CDI, logging, configuration, plugin implementation and even (accidental) performance improvement of factor 250. It should be the most important chapter for a Business Tier developer.
DZone: I noticed that you the foreword is written by James Gosling - is he a fan of your books?
Adam Bien: I don’t think so :-). He invented Java and I’m just using it. We both are fans of NetBeans and GlassFish. If you would just have to getting things done - the NetBeans / GlassFish is the way to go.
DZone: Have you plans for any more books?
Adam Bien: It really depends on the reader’s feedback for “Real World Java EE Night Hacks - Dissecting the Business Tier” and the amount of my dead time. Writing books is boring comparing it to writing software. I only manage to writing books when I travel, in hotels or even sometimes in not that productive meetings.
DZone: Can you give any examples of work you have done?
Adam Bien: Unfortunately not. The reason why I created x-ray and wrote “Java EE Night Hacks” are the countless NDAs I had to sign in 90% of all projects. ...and I have no idea, what the 10% of the remaining projects actually are :-). What I can tell you - J2EE dies slowly, Java EE 5 is widely used in governments, huge enterprise projects, and I get more and more requests to introduce Java EE 6 even to smaller companies and startups.
DZone: Apart from your own books, what books would you recommend to Java developers?
- Beginning Java EE 6 with GlassFish 3
- RESTful Java with Jax-RS
- Enterprise JavaBeans 3.1
- Pro JPA 2: Mastering the Java(TM) Persistence API
- JavaServer Faces 2.0, The Complete Reference
But the best of all - you don’t have to buy any. The huge advantage of Java EE 6 is the specification and JSRs in particular. You can download well-written PDF documents for free. I use them all the time in my day to day work to lookup things. Just go to jcp.org and enter: 299, 316, 317, 318, 303, 311 or 330 and you will get PDFs with explanations, descriptions and samples ...for free. The Java EE 6 tutorial is also a good starting point.
DZone: What is your opinion on Spring, especially Spring Roo and the Play framework?
Adam Bien: Play, Vaddin, Wicket, Hibernate, EclipseLink, Seam, Spring, qi4j, PicoContainer, Guice, Grails, Rails, Lift or thousands others are interesting alternatives, implementations and innovative ideas. Without them Java EE would be not viable. IMHO Java EE should look at working, mature and popular solutions and abstract the good parts. As as consequence it will lag a bit behind the implementations. So JPA 2.X will always be a bit less capable than hibernate or JSR-330 less capable than DI in Spring.
However, I always start with a standard like Java SE, then Java EE and in case it is not sufficient, I expand it capabilities with the alternatives. But only then. The more vendors are implementing an API, the better for my clients.
DZone: What is the future of JavaEE?
Adam Bien: The future of Java EE is bright. Java EE 6 is more and more popular (all sessions / workshops are sold out), gets more momentum (many projects are starting right now), and even more interesting servers are on horizon (e.g. JBoss 7, TomEE, Resin, or Siwpas).
Java EE 7+ should be further simplified first. All superfluous APIs and parts of the APIs should be pruned, deprecated and removed. Java EE 8+ should leverage the Java SE 8 features like Jigsaw or fork-join.