A Kinder, Gentler Java on Tap

Q&A: Oracle exec Ted Farrell talks about the industry's efforts to make writing code using Java simpler but more productive.

If there was a central theme to the 11th Annual JavaOne Conference, held last month in San Francisco, it was arguably the restoration of balance between capability and complexity in the Java enterprise platform.

Now called Java Enterprise Edition—rather than the former J2EE (Java 2 Platform, Enterprise Edition)—the newly updated Java enterprise model includes input from many companies other than Java creator and steward Sun Microsystems, with Oracle, of Redwood Shores, Calif., being one of the most prominent contributors. Java Enterprise Edition 5 became available during the conference.

Ted Farrell, Oracle vice president and chief architect for application development tools, spoke with eWeek Labs Peter Coffee about the challenge of elevating Java enterprise capabilities while lowering barriers to their use.

What were the key points that Oracle wanted to make at JavaOne this year?

On the first day of the show, May 16, we announced that wed be shipping our reference implementation of the Java persistence architecture API, JPA [Java Persistence API; more here.] This is now the Java standard for persisting Java objects to the database and retrieving them from the database.

The JPA is also the core API used by Enterprise JavaBeans 3.0 for its persistence. But the nice thing about it is that if you dont want to program using those EJB 3.0 containers, you can also call the JPA libraries directly and get a lightweight version of an object-relational solution for your program.

Before this, didnt Java object persistence involve low-level operations of serializing the object and then dealing with those bits?

Depending on where you were going to [store the object], there were a variety of ways. One was to serialize the object; a lot of people would hand-code JDBC [Java Database Connectivity] calls to the database and map the results back into Java objects.

Did that create developer idiosyncrasies in the details of how that was done?

Sure. Not only that, but inefficiencies as well. A framework like our TopLink Essentials—which is the reference implementation of the JPA—is something thats been built over 10 years. It really understands object-relational mapping and optimizes the calls for you, so each individual developer doesnt have to learn that.

Does this make it easier for developers to store objects for future use without writing their own code for low-level database interactions?

Exactly. They can focus on their Java objects and the code theyre writing. The JPA and EJB 3.0 specifications are big strides for usability for Java developers. The reference implementation is now out as a Version 1.0 that developers can jump on and start using immediately.

Enterprise JavaBeans, upon their introduction, might have been a contender for the biggest single leap in complexity that developers have ever been asked to make. Does EJB 3.0 improve the balance of power versus complexity?

The early versions—the whole container transaction management that EJB brought—were very powerful, but they were, and are, incredibly complex to manage and use. Thats why were so excited about EJB 3.0, whose approach is much lighter-weight than the earlier EJBs [and] much more in line with what weve been doing with TopLink. Weve been able to contribute code and ideas from that TopLink experience.

What do you believe will be the main improvements in ease of understanding and implementation for the developer?

The biggest thing is that EJB 3.0 really simplifies the number of [elements] that you have to deal with. Before, a single logical object—a single logical representation of a database table—might have resulted in three or more Java files and an XML file. EJB 3.0 lets you have a single class that represents that thing, so you dont have to go off and manage all those moving parts. Its really a one-to-one mapping: The engine takes care of getting the data into your Java object.

Does EJB 3.0 reflect the experience of watching developers use the earlier versions in their projects, instead of just letting the technology evolve along its original lines?

Exactly. When Java Specification Requests come out, and companies with different [ideas] start hyping them, you never know whats hype and whats not. When people really look at EJB 3.0 and what its doing, I think theyll find its a huge advancement. It really advances developer productivity in writing code in Java that persists objects to the database.

Does all of what weve discussed so far deal with only the first of Oracles JavaOne announcements?

Yes, the second was a contribution to open-source development efforts. As a little bit of background, earlier this year, Oracle submitted 100 of our JavaServer Faces components to the [Apache Software Foundations] Apache MyFaces project. We called them ADF Faces, [with] ADF being our application development framework.

Next Page: Working to simplify Web 2.0 and open AJAX.