Interview Series: Lightweight Java

Jim Rivera interviewed by Jon Mountjoy

Jim Rivera is a director of technology at BEA, and is responsible for driving the adoption of BEA products through technology evangelism. Jim joined BEA in 1999 and was lead Technical Product Manager for the BEA WebLogic Server 6, 7, and 8 releases. In this role, Jim was responsible for the strategy and roadmap for various components of the server including EJB, Web services, XML, and clustering. Jim also has a blog on dev2dev.

dev2dev interviewed Jim by email to get his thoughts on lightweight Java, application frameworks and persistence frameworks, and their relationship to enterprise computing on application servers.

Lightweight Java

dev2dev: How would you define "lightweight Java"?

Jim Rivera: In the context of Java application development, I believe "lightweight Java" is referring to two things: simplified programming models and more responsive containers. Lightweight Java is about removing the unnecessary complexities and constraints associated with the traditional J2EE API. It is also about reducing application deployment time, which is critical in supporting development best practices such as frequent unit testing.

dev2dev: Which of the lightweight technologies are the most important to you and how does lightweight Java help the end user?

Jim: Clearly, the Inversion of Control (IoC) pattern has made a significant impact in this area. Through the use of IoC, object dependencies are resolved without requiring developers to write complex code to perform look-ups, handle infrastructure exceptions, or manage connections. This helps to simplify code and separate business logic from infrastructure, making applications easier to maintain.

Another key characteristic of lightweight Java is that it does not force business objects to conform to platform specific interfaces. This allows the developer to implement business logic in Plain Old Java Objects (POJO), resulting in increased productivity.

When combined with the best practice of developing to interfaces, as opposed to concrete classes, these features can also make it much easier to unit test your code. Since business logic is implemented in POJOs, you no longer need to deploy your object to a heavyweight container to exercise it in unit tests. It therefore becomes trivial to host your object in a simple test environment like JUnit and "mock" external dependencies for quick iterative unit testing.

dev2dev: As a technology evangelist, you must see a lot of new and deployed technology. Do you see a trend toward lightweight technologies?

Jim: Absolutely. Among the early adopter crowd, there is definitely a trend toward frameworks like Spring, Hibernate, and Beehive. It's making a real difference in how applications are being built and is having a positive influence on the direction of future J2EE technologies. For example, EJB 3.0 is largely based on the concepts that have made lightweight Java popular.

The Heavyweights

dev2dev: When people think of application server vendors, they generally put them in the "heavyweight camp." I imagine that you are trying to change this? To put it another way, many people believe that the application vendors have paid a price for implementing the heavyweight components, such as EJB 2.0, and don't want to simply abandon this work.

Jim: First of all, I see no reason to abandon existing investment in EJB as it is still the best technically in certain scenarios, for example when you wish to expose business services remotely over RMI. And of course, the value that open standards, like EJB, provide in protecting customer investment should not be underestimated.

Having said that, I do think people often overemphasize the role EJB plays in the real value of an application server. While this may not be true for all application server vendors, BEA invests a relatively small amount of our development resources into supporting the J2EE API. Most of our effort goes into building the most reliable, scalable, fault-tolerant kernel for hosting applications. These qualities, along with services for distributed transactions, high-speed messaging, legacy integration, advanced Web services, configuration management, diagnostics and troubleshooting, and advanced security represent the real value of WebLogic Server and can have a tremendous impact on total cost of ownership. Fortunately, this added value is just as relevant and applicable to Spring or Beehive-based applications as it is to applications built using EJBs. While lightweight Java technologies help to make development and maintenance easier, they do not replace the qualities of a true high-end application server. In fact, we view lightweight Java as being very complimentary to WebLogic Server.

dev2dev: Does BEA have a lightweight Java strategy? What is BEA's approach to lightweight Java?

Jim: Our strategy is to embrace any technologies that help to make developers more productive and to provide the best platform on the market for deploying those technologies. Lightweight Java, which helps to reduce development costs, and WebLogic Server, which helps to reduce ongoing operational costs, is a very powerful combination.

Application Frameworks

dev2dev: The Apache Beehive project is an obvious lightweight Java component model, donated by BEA. Can you tell us a little about Beehive and its role in your overall strategy?

Jim: Beehive is an application framework targeted at making J2EE application and SOA-based application development easier and is based on our experience in delivering WebLogic Workshop. It provides a programming model based on POJOs plus metadata for configuring dependencies, qualities of service, etcetera. Metadata is supported in the form of J2SE 5.0 code annotations as well as external XML files. There are components for accessing J2EE resources, defining business and Web services, and developing Web applications based on the MVC pattern. Beehive is a key part of our efforts to make developers more productive and to strengthen the Java market as a whole.

dev2dev: Beehive can be considered an "application framework." A very popular approach to lightweight Java can be found in the Spring Framework. How important is Spring (and other frameworks like it) to BEA?

Jim: Anything that can help our customers be more productive is very important to us. We welcome and embrace these efforts and, where appropriate, will engage at a technical level to integrate and/or share technology.

dev2dev: Do you envisage any explicit support for these frameworks?

Jim: As I said earlier, WebLogic Server has a lot to offer applications that are based on lightweight Java technologies. Much of this is implicit, however in some cases, a minimal amount of integration work can expose significant value to lightweight Java developers. As an example, adapters exist today that allow Spring applications to use WebLogic Server's distributed transaction capabilities without requiring any changes to the application code. We're investigating a number of other opportunities and of course are always listening to the requests of our customers.

dev2dev: We've already seen some of the influence of the lightweight frameworks on EJB 3. Do you see this spreading to other aspects of J2EE?

Jim: Yes. I see JSR 175, Metadata for Java, as a key enabling technology for simplifying J2EE programming models. EJB 3.0 is using it and its also the basis for JSR 181, Web Services Metadata, a BEA-led specification. There is no reason to believe it will stop there.

Lightweight Persistence

dev2dev: The IoC container seems to be at the hub of lightweight Java. Another key factor is POJOs and lightweight persistence. Can you shed some light on this issue?

Jim: Again, the common theme is about simplifying the programming model. You can't get much more simple than a POJO. Of course, enterprise development requires that we have the ability to apply additional qualities such as persistence rules, transaction semantics, and security constraints to our POJOs. The prevailing approach has been to define these qualities within metadata either as code annotations or in external files.

dev2dev: Do you see some danger in having multiple ways of doing things like persistence? For example, we'll soon have EJB 2, EJB 3, JDO, Hibernate, etcetera.

Jim: I think it's just a reality of being a maturing space. For years, this particular area has been underserved by the J2EE specs, and this has naturally resulted in the emergence of alternatives. From what I see happening in the JCP, we seem to be on the path of convergence. That's a good thing for the industry overall.

The Future

dev2dev: Can you give us a glimpse of the future with respect to lightweight Java and BEA?

Jim: We'll continue to be very active in the space, both in terms of pushing innovation forward through channels like Apache Beehive, XMLBeans, Eclipse, and the JCP as well as embracing other leading technologies like Spring and exploiting the synergies for the benefit of our customers.


Jon Mountjoy worked as the editor-in-chief of Dev2Dev and Arch2Arch until April 2008.

Jim Rivera is a director of technology with BEA Systems. In this role, Jim is responsible for driving adoption of BEA products through technology evangelism.