Apache Beehive Project

Introduction

When BEA released WebLogic Platform 8.1, they introduced an enhanced version of Workshop 8.1. Workshop 8.1 was not just another IDE but an IDE plus an application development framework all built into one solution.

Even though BEA might deny allegations that Workshop is based on Microsoft’s Visual development tools, the fact remains that the primary Architect on this project was Adam Bosworth, who formerly worked for Microsoft.

The primary intention BEA had in introducing an application development framework was to make it easier for developers to develop complex web applications, manipulate XML, use web services and integrate with 3rd party resources or other applications.

In May 2004, BEA announced that it was going to extract the application development framework from Workshop and make it an Open Source initiative. It also announced that this initiative would be an Apache project. It would be called the Beehive project.

Overview

The Beehive project consists of the following components:
1. Page Flows
2. Controls
3. Java Web Services
4. XML Beans (this is not considered part of the Beehive project but will be packaged in the first release)

The figure below shows how all these components all fit together.

Beehive Framework 

Source: BEA dev2dev website

Architecture

The Beehive implementation is dependant on JDK 1.5 (or also called J2SE 5.0). JDK 1.5 introduces annotations to the Java language. Annotations can be thought of as meta-data on Java classes. The advantages of such an approach (i.e. annotations) are that any existing Java class/component can be transformed to expose functionality based on the requirements.

Beehive heavily relies on annotations. This is different from the implementation that ships with Workshop 8.1 as no annotations were used. Also Workshop 8.1 is JDK 1.4 compliant. Beehive also exposes all its interfaces as simple Java Beans (POJOs).

Details

In this section we will cover details of every component that is part of the Beehive initiative.

  1. XML Beans
    XML beans are a Java representation of XML documents. Most of developers find the need to manipulate XML in their applications. Technologies like JAXB help developers bind XML to Java objects. But how XML Beans differ is that they treat Java Beans and XML as one entity. So when a developer modifies the Java Object using accessor methods like setters, the underlying XML document is modified. The advantages of such an approach is:
    • Ease of use
    • Developers focusing on solving the business problems rather than technological nuances
  2. Controls
    Controls are a mechanism of exposing interfaces to either 3rd party applications/projects, components or simple Java APIs. The advantage of such an approach is the ability for developers to use controls to integrate with existing functionality or APIs rather than re-writing all the logic again.     

    BEA has tons of pre-written controls that ship with Workshop 8.1. Examples of common controls are:
    • Documentum Controls
    • JDBC Controls
    • Entity Bean Controls
    • JMS Controls
    • WebSphere MQ Controls

    Another benefit is developers can now share components by exposing their code as a control. Controls have properties (implemented as member variables) and methods (providing the business functionality).

    Example: With a JDBC control, a developer would not need to worry about opening and cleaning up of connections but would just be required to provide the SQL and get the result.

  3. Java Web Services
    Java Web Services is a mechanism to expose any Java Component (or a simple class) as a Web Service. Again this is done through the use of annotations.     

    This enables developers to concentrate on the business aspect of the solution rather than focusing on how web services work, how marshalling/un-marshalling is handled etc.

    Another advantage is the ability for application developers to expose existing functionality as web services.

  4. Page Flows
    Page Flows is an easy-to-use web development framework. It is built on top of the Struts Programming Model.     

    Beehive uses annotations on Java Beans to represent the flow of the application. The use of annotations replaces the need for Struts developers to define the struts-config.xml An IDE like Workshop adds benefits like visually being able to create a flow for a web application.

Example 1
public class UserRegistrationController
  extends PageFlowController
 {

   /**
    * @jpf:action
    * @jpf:forward name=”getAddress”
    *              path=”address.jsp”
    */
   public Forward name_next( … )
   {
    …

    return new Forward(”getAddress”);
   }

   …
  }

Source: BEA website

Note the highlighted code. Annotations are built into the Java class to represent what page needs to be called.

Page Flows are a grouping of JSPs and actions to provide functionality to the end-users. A web application generally consists of multiple modules. Each web module in Beehive can be implemented as a Page Flow. There exists a master Page Flow that links all the modules together. Page Flows correspond to the concept of modules in Struts.

Conclusion

Beehive is still nascent. But the concept is sound. Developers have always had problems with the technical implementation rather than focusing on delivering the solution. Beehive makes it easier for developers to use technologies like Struts, XML, JMS and Web Services. Developers can now focus on the “what” rather than the “how”.

References

http://incubator.apache.org/beehive/
http://www.controlhaus.org/
http://dev2dev.bea.com/technologies/beehive/index.jsp
http://www.eclipse.org/pollinate/
http://java.sun.com/j2se/1.5.0/index.jsp
http://home.ishisystems.com/ishi/docs/bea-platform-eval-guide

Learn more about our vertical solutions