Thursday Mar 26, 2015

New book: "Web Development with Java and JSF"

During JavaLand, I had the pleasure to meet Michael Müller. Michael is well known in the German Java sphere as he wrote numerous articles for various IT medias. In addition, Michael is an avid JSF user and a JSF EG member.

Michael is currently writing a book titled "Web Development with Java and JSF". Since Michael is a passionate JSF user, JSF is obviously an important topic in his book. But this is not another book about JSF only. Michael's goal is to cover Web Application development at large. That means that different but related topics are also discussed through his book. There are for examples sections on JPA, Bean Validation, Responsive Design, ... Michael also plan to touch on subject such as Web Application testing with Selenium, etc.

Michael has decided to use “a more fair” publishing approach where the book has 2 prices: a minimum and a suggested price. Based on that, the potential buyer is free to decide how much he wants to pay. This approach gives the buyer the ability to decide how much s/he think the book is really worth but this also gives the author more financial rewards as there is no intermediary between the publisher and the author.

A great deal of the book has already been written (+240 pages) but Michael is planning to add extra content.  You can read a sample here. "Web Development with Java and JSF" is available in the usual eBook formats (PDF, Mobi, ePub) and once you've bought it, you are entitled to get the updated versions for free.

Wednesday Nov 12, 2014

Java EE @ NFJS Pacific Northwest Software Symposium Seattle

As some of you may be aware I recently joined the well-respected US based No Fluff Just Stuff (NFJS) Tour. The NFJS Pacific Northwest Software Symposium was held October 17 - 19 in Seattle, Washington.

I had five talks total over two days, more or less back-to-back. I did talks on Java EE 7/Java EE 8, the Cargo Tracker Java EE Blue Prints, JavaScript + Java EE, Java EE + NoSQL as well as WebSocket. More details, including slide decks and code as well as my NFJS tour schedule, posted on my personal blog.

Monday Nov 03, 2014

Java EE @ NFJS New England Software Symposium Boston

As some of you may be aware I recently joined the well-respected US based No Fluff Just Stuff (NFJS) Tour. The NFJS New England Software Symposium was held September 19 - 21 in Boston. This is one of the larger NFJS shows and attendance at the show and my sessions was pretty good. It is always encouraging to see the same folks attend more than one talk. On my way to the show I also stopped by at the Connecticut Java User Group. The JUG is led by my friend and co-author for EJB 3 in Action Ryan Cuprak. I've spoken at the JUG a number of times over the years and it was good to be back.

I had five talks total over two days, more or less back-to-back. I did talks on Java EE 7/Java EE 8, the Cargo Tracker Java EE Blue Prints, JavaScript + Java EE, Java EE + NoSQL as well as JMS 2. More details, including slide decks and code as well as my NFJS tour schedule, posted on my personal blog.

Monday Oct 27, 2014

MyBatis-CDI: Persistence Alternative for Java EE

ORM is a by and large proven technique that has been around for a long time now (believe it or not TopLink was created in the early nineties for Smalltalk and then ported to Java). It maximizes code flexibility and database independence while minimizing boilerplate code and allowing the construction of rich domain models. Even for relatively complex domain models and queries, ORM engines tend to generate better quality SQL optimized to the underlying database than the average Java developer would with considerable time and effort. This is precisely why JPA is the persistence standard for Java EE and why a majority of modern server-side applications use ORM (indeed almost every other major development platform including .NET and Ruby on Rails positions ORM as it's default persistence solution).

That being said, there can certainly be cases where using hand-written native SQL is necessary or desirable. Most people don't seem to realize it, but JPA has always included very good support for native queries to meet these use cases (JPA 2.1 now even includes formal support for stored procedures - the ultimate form of database bound query execution). If you weren't aware of this, you should definitely read Taudo Wenzel's excellent write-up on using JPA native queries to generate reports (a common use case for native queries).

In fact you have other options for native SQL centric persistence in Java EE applications. One of the nicest ones is MyBatis-CDI. It provides a very nice CDI based abstraction for MyBatis, making it extremely easy to use in Java EE applications (in case you are wondering MyBatis is the successor to the old iBatis project). Here is how simple MyBatis CDI code can look like:

In addition to JTA transactions, MyBatis-CDI also supports local transactions. I've personally also successfully used Apache Commons DbUtils with CDI to quickly port over a legacy application with tons of hand-written SQL to Java EE/GlassFish.

Friday Aug 22, 2014

Java EE @ NFJS Central Iowa Software Symposium Des Moines

As some of you may be aware I recently joined the well-respected US based No Fluff Just Stuff (NFJS) Tour. The NFJS Central Iowa Software Symposium was held August 8 - 10 in Des Moines. The Des Moines show is one of the smaller ones but still was good overall. It is one of the few events of it's kind that take place this part the country so it is extremely important.

I had five talks total over two days, more or less back-to-back. I had decent attendance for all my sessions and had many of the same folks staying for multiple sessions which is always a very good sign. I did talks on Java EE 7/Java EE 8, WebSocket, the Cargo Tracker Java EE Blue Prints, JavaScript + Java EE and NoSQL + Java EE. More details, including slide decks and code as well as my NFJS tour schedule, posted on my personal blog.

Friday Aug 15, 2014

Java EE@Java Day Taipei 2014

Java Day Taipei 2014 was held at the Taipei International Convention Center on August 1st. Organized by Oracle University, it is one of the largest Java developer events in Taiwan. This was another successful year for Java Day Taipei with a fully sold out venue. In addition to Oracle speakers like me, Steve Chin and Naveen Asrani, the event also featured a bevy of local speakers including Taipei Java community leaders. Topics included Java SE, Java EE, JavaFX and Big Data.

I delivered a keynote on Java EE 7/Java EE 8 as well as a talks on aligning the JavaScript ecosystem with Java EE 7 and using NoSQL solutions in Java EE applications. More details on the sessions and Java Days Taipei, including the slide decks and code, posted on my personal blog.

Tuesday Jun 10, 2014

Type Conversion in JPA 2.1

The Java Persistence 2.1 specification (JSR 338) adds support for various new features such as schema generation, stored procedure invocation, use of entity graphs in queries and find operations, unsynchronized persistence contexts, injection into entity listener classes, etc.

JPA 2.1 also add support for Type Conversion methods, sometime called Type Converter. This new facility let developers specify methods to convert between the entity attribute representation and the database representation for attributes of basic types.

For additional details on Type Conversion, you can check the JSR 338 Specification and its corresponding JPA 2.1 Javadocs. In addition, you can also check those 2 articles. The first article ('How to implement a Type Converter') gives a short overview on Type Conversion while the second article ('How to use a JPA Type Converter to encrypt your data') implements a simple use-case (encrypting data) to illustrate Type Conversion. Mission critical applications would probably rely on transparent database encryption facilities provided by the database but that's not the point here, this use-case is easy enough to illustrate JPA 2.1 Type Conversion.

Friday Apr 25, 2014

The JavaOne Java EE Track: Thanks, a Sneak Peek and an Invitation

As you know the JavaOne CFP is now closed. I want to take this opportunity to thank all of those that submitted their thoughtful topics and all those who considered submitting. We had the highest number of JavaOne CFP submissions in the recent few years. This is a testament to your passion for the Java community and it is a great start on the road to keeping JavaOne a true success.

In terms of the Java EE track we now have all the raw material we need to construct a strong selection. In the next few weeks we will be working hard with the review committee to carefully sort through all the submissions we have at hand. You should begin to hear back as to decisions on your submissions around early Summer.

I want to remind you now not to be discouraged if you don't get the response you are hoping for. You should remember that you are competing against some of the best and brightest of Java at a global scale - especially so in the Java EE track. As much as we would like for things to be perfect in the end all of this is also based on all too fallible human judgement applied through a fairly intricate process designed with checks, balances and fairness in mind. If your session does not get accepted this year, you should definitely consider honing your submissions and trying again next year. If you are indeed selected I hope you see it as the testament to your abilities and good fortune it truly is. Either way, I hope you will consider coming to JavaOne to experience the incredible talent, energy and intellect in the air.

Invited Speakers/A Sneak Peek
One of the things we are doing differently for JavaOne this year is that we have a small number of well-deserved invited speakers. Besides helping us put together some early content this is a great way to give credit to some of the folks in the community. The following are the folks we have the honor to invite to the Java EE track this year with a bit of a sneak peak about what they will be talking about (as some of you know we have also invited a small number of folks personally to submit via the normal CFP process in addition to these super stars):

Adam Bien needs little introduction. He has been a key Java EE advocate, author, JCP expert and Java Champion for a long time. His passion for Java EE, knowledge as a consultant and skill as a presenter have few parallels. Adam will be talking about just how lightweight Java EE application design can be and other topics.

David Blevins also needs few introductions. He is an excellent speaker, a long-time JCP expert, Java EE advocate and powerhouse developer behind the highly innovative Apache OpenEJB and TomEE projects. David just recently founded Tomitribe, a company offering commercial support for TomEE. David will be talking about exactly why Java EE is a game changer developers should be enthusiastic about and other topics.

Patrycja Wegrzynowicz is the founder and CTO of her own company, a strong technical mind, a JavaOne veteran and a regular speaker at many conferences worldwide. Just some of her interests include patterns/anti-patterns, security, persistence and performance tuning. Patrycja will be sharing her insight on performance tuning techniques for complex JPA 2.1 domain models and other topics. We anticipate her talk would be interesting and valuable to many of you.

Arun Gupta is the former "GlassFish Guy", prolific Java EE advocate, author and blogger. He now enjoys a well-deserved and coveted role as the head of developer advocacy at Red Hat. A great deal of the current success of the Java EE and GlassFish communities can be attributed to Arun's tireless hard work, boundless energy and infectious enthusiasm. We are very honored to have Arun talk about some lessons learned from real world Java EE 7 deployments and other topics.

Anatole Tresch is a key engineer at Credit Suisse and one of the few brave souls with enough initiative to lead JCP JSRs despite not working for a major technology vendor. We are very proud to invite Anatole to talk about the Java EE configuration effort that he is currently helping launch. He definitely deserves the support of the Java EE community and has much to offer in terms of insight on Java EE and the JCP. We look forward to seeing him at JavaOne.

Keep in mind that JavaOne is now already open for registration. There are definitely some advantages to registering early. JavaOne Content Chair Stephen Chin outlines the reasons in an excellent recent blog post.

I hope to see you all at JavaOne. In the meanwhile as always if you have any questions never hesitate to reach out.

Tuesday Apr 08, 2014

New book: EJB 3 in Action, Second Edition

'EJB3 in Action' is one of the reference books when it comes to this important area of Java EE. The second edition covering EJB 3.2 has just been published.

Over the years, the EJB specification has come a long way and has been greatly simplified but nevertheless EJB is still a large specification to grasp. This book is a great (and up-to-date!) introduction to the EJB Component Model. The book goes beyond just introducing EJBs in details as it also explains technologies related to EJB such as CDI and JPA (the older amongst us will remember that EJB, back in the days, used to also handle persistence). The book has also a full chapter devoted to WebSocket, a new important Java EE 7 technology. The final chapter of the book is devoted to a critical, some time over looked, topics: testing.

This is not a pure theoretical book as it really gives 2 views, it first introduce and explains EJBs but also JPA, CDI, etc. The book then explain how to use EJBs and the other technologies, how to put them in action! All in all, a great book to add to any Java EE 7 bookshelf!

Disclaimer: 'EJB 3 in Action' was co-authored by our own Reza Rahman. But to be honest, I was already praising the first edition of the book when Reza wasn't yet working for Oracle.

Friday Mar 21, 2014

Code PaLOUsa 2014 Trip Report

Code PaLOUsa 2014 took place 24-26 February in Louisville, Kentucky. Code PaLOUsa is a fairly unassuming conference with great quality farther away from the beaten paths. Topics covered included Java, .NET, JavaScript, mobile, methodology and Big Data/NoSQL. On my way to Kentucky, I was able to stop by at the Montgomery County (Maryland) JUG for a Java EE 7 session.

At Code PaLOUsa I delivered a talk on aligning Java EE with NoSQL as well as a talk on the Cargo Tracker Java EE/Domain-Driven Design Blue Prints project (this talk was recorded by InfoQ). More details, including slide decks and code, posted on my personal blog.

Thursday Feb 13, 2014

CodeMash 2014 Trip Report

CodeMash 2014 took place 7-10 January in Sandusky, Ohio. With another sold-out year, CodeMash is quickly becoming one of the largest developer conferences state-side. This year it attracted a decent section of the Java crowd including me (Java EE) and my fellow Oracle colleagues Jim Weaver (JavaFX) and Scott Seighman (Java SE 8). I also stopped by at the nascent Penn State University/Happy Valley JUG in State College, PA - kicking off a highly successful and well-attended very first meetup consisting of a whole day Java EE 7 hand-on workshop!

At CodeMash I delivered talks on Java EE 7 and using NoSQL with Java EE, both of which went well. More details, including the slide deck and code, posted on my personal blog.

Monday Dec 16, 2013

Java EE@Pune JUG

Pune JUG organized a meetup at the Symbiosis Institute of Computer Studies and Research (SICRSR) college campus on December 14th. Led by Harshad Oak (Java Champion and organizer of the IndicThreads conference), Pune JUG is the oldest JUG in India and boasts a vibrant developer community. This month's meetup was focused on the Java EE 7 platform and the ecosystem that is building up around it. The meeting was led by Oracle India's own Vijay Nair. Vijay is a good friend and a lead developer with Oracle's FLEXCUBE development group in India. Among many other things like evangelizing Java EE at local Java user groups and conferences, Vijay contributes heavily to the Cargo Tracker Java EE Blue Prints project in his spare time.

 The event saw an attendance of close to around 100 people with a lot of demos/code and high quality interactions with the audience. Vijay presented no less than three sessions at the meetup:

  • JavaEE.Next(): Java EE 7, 8, and Beyond - This is basically our flagship talk at the moment. The talk briefly covers the evolution of the platform, details the changes in Java EE 7 and invites developers to help shape Java EE 8. The materials for the talk is posted here.
  • Android and iOS Development with Java EE 7 - This was a fairly popular technical session at JavaOne San Francisco 2013 led by me, Ryan Cuprak and Bala Muthuvarathan. The session demonstrates how Java EE 7 acts as an excellent platform for building "headless" back-ends for native mobile applications with REST and WebSocket as the client communication protocols. The materials for the talk is posted here. The code is posted on GitHub.
  • Using NoSQL with JPA, EclipseLink and Java EE - This session explores the current state of the NoSQL landscape and how Java EE can be utilized to access NoSQL solutions such as Oracle NoSQL, MongoDB, Cassandra, etc utilizing JPA style facades or plain CDI. The materials for the talk is posted here. The code is posted on GitHub.

Overall, this was a very positive experience with developers giving two thumbs way up to the Java EE 7 platform!

Tuesday Nov 12, 2013

Java Developer Days India Trip Report

October 21st through October 25th I spoke at Java Developer Days India. This was three separate but identical one-day events in the cities of Pune (October 21st), Chennai (October 24th) and Bangalore (October 25th). For those with some familiarity with India, other than Hyderabad these cities are India's IT powerhouses.

The events were focused on Java EE. I delivered five sessions on Java EE 7, WebSocket, JAX-RS 2, JMS 2 and EclipeLink/NoSQL. The events went extremely well and was packed in all three cities. More details on the sessions and Java Developer Days India, including the slide decks, posted on my personal blog.

Wednesday Oct 09, 2013

Using NoSQL with EclipseLink and JPA?

NoSQL is obviously a hot topic in the enterprise these days, at least at the water cooler if not in the production data center. The momentum is such that despite being seen as a stalwart of relational databases, Oracle too has entered the NoSQL ecosystem with Oracle NoSQL. Naturally, the question of how to use NoSQL databases in Java EE applications (specifically existing Java EE 5 and Java EE 6 applications) comes up all too often. As it so turns out there are a number of very interesting initiatives out there to radically simplify the usage of NoSQL databases in Java EE applications by creating JPA based facades over them (strictly speaking, JPA as it stands today is not intended to support NoSQL from a purely standards standpoint). Such efforts include one from non other than the team behind the Oracle JPA reference implementation EclipseLink. In a code driven blog post, Huseyin Akdogan demonstrates how to use MongoDB using EclipseLink NoSQL. You are also welcome to check out my own slide deck covering using NoSQL databases in Java EE with or without a JPA flavored API (using just plain CDI):

Interestingly, NoSQL support featured quite prominently in the results of a survey around JCP standards put together by the London Java Community (LJC). It would be interesting to hear your thoughts as well.

Robert Greene, John Bracken and Shaun Smith held both a technical session titled "Building Oracle NoSQL Database Applications with EclipseLink" and a BOF titled "Java Persistence for NoSQL" at JavaOne 2013 on this topic. Stay tuned to Parleys.com for the video recordings of the sessions.

Friday Aug 30, 2013

JPA vs. Hibernate?

Whether to use standard vs. non-standard APIs is always a constructive ongoing tug-of-war (well, most of the time anyway). It seems that the tug-of-war is particularly fierce when it comes to anything open source. That's quite unfortunate as open source and open standards should be ideological brothers-in-arms - but then we all know feuds tend to be the worst amongst blood relatives :-). One facet of this debate that seems pervasive and persistent is whether to use Hibernate's legacy non-standard APIs or standard JPA.

Key Hibernate developer Emmanuel Bernard of Red Hat offers his insights on the matter on an audio interview with TSS (TheServerSide) chief editor Cameron McKenzie (spoiler: it's not an either/or proposition :-)). If the past few years is any indicator, this won't settle the war of words, but at least it might be a good bit of input for those interested....

Enjoy!