The state of Java middleware, Part II: Enterprise JavaBeans - JavaWorld - April
1999
Tutorial Details:
The state of Java middleware, Part 2: Enterprise JavaBeans
The state of Java middleware, Part 2: Enterprise JavaBeans
By: By Anil Hemrajani
Learn how Enterprise JavaBeans fits into your enterprise -- and which tools support EJB
ast month JavaWorld published the first article in this two-part series, covering the state of Java middleware . The first article provided an overview of the many features offered and promised by Java middleware; this article focuses specifically on one of those features: Enterprise JavaBeans (EJB).
By now you've probably heard about EJB, read articles about it, and possibly even written a few enterprise beans yourself. However, if you're like many people out there, you might not understand the big picture -- despite the fact that working with EJB is supposed to be extremely simple. Here's a list of questions many developers new to EJB struggle with:
What are all the features of EJB?
What tools are available today that support EJB?
When should I use session beans versus entity beans ?
When to use a stateful session bean versus a stateless one?
What are the do s and don't s of EJB development?
How does EJB relate to JDBC 2.0 (Java Database Connectivity) and the transaction management APIs?
How does EJB's security work?
How do complex joins in an existing relational database work with entity bean mapping?
This article addresses these and other common concerns about EJB. It includes examples of how some vendors provide EJB support. Moreover, this article addresses the following key issues:
Why do we need EJB?
Who will support EJB?
What exactly is EJB?
How do you develop, deploy, and manage EJB?
How do you integrate EJB with existing systems?
Where does EJB go from here?
In short, this article describes the current state of EJB and the Java middleware (tools) that support it. Rather than focus on in-depth coding examples, I devote attention to the more challenging aspects of working with EJB: the design issues and tools selection. To learn more about nitty-gritty programming with EJB, see the JavaWorld articles in the Resources section below. Furthermore, EJB programming (developing enterprise beans), in my opinion, is the easy part (as Sun intended it to be); design issues and tools selection are the more challenging aspects of working with EJB.
Note that throughout this article I use the terms Java middleware, application servers, and EJB servers somewhat interchangeably. Marketeers, authors of the EJB (or CORBA/DCOM) specification, and niche developers may see many distinctions among these terms, but for the purpose of this article they all mean the same thing.
Note also that this article is jam-packed with information on EJB. While it may seem overwhelming, don't be discouraged: EJB developers typically don't have to deal with all the issues discussed here. In fact, the EJB specifications define several roles and responsibilities that can be handled by either one person or several people, depending on the size of your project. Nevertheless, an understanding of the big picture is essential. And remember, developing enterprise beans is actually extremely simple.
Why do we need EJB?
Ever since the Web began to make the Internet popular and useful for almost everyone (not just the government and students), new Net technologies (Internet, intranet and extranet) have emerged from all directions and organizations. It is now close to impossible to keep up with these technologies at the speed they're being introduced.
So, why should we add EJB to this list of technologies? Well, there are various reasons, but before we look at the reasons for EJB, let's look at several reasons why we need middleware or, more specifically, application servers.
Glue between clients and servers
On the front end, there are many different types of clients (desktops/browsers, PDAs, Web phones, NCs/thin clients, different platforms). On the back end, there are many types of platforms (Unix, Windows, Mac) and data repositories (RDBMS, ODBMS, Mainframe). Java middleware connects the two (see Figure 1). In other words, business logic can be implemented as reusable components in the middle tier, thereby providing access for a variety of clients to all types of data on the back end.
Figure 1. What an application server provides
Scalability and standards-based technologies
The original HTML and/or CGI solution isn't scalable and APIs such as Netscape's NSAPI and Microsoft's ISAPI are proprietary. Most app servers provide standards-based technologies that scale well. Additionally, these products typically provide features such as resource pooling, fault-tolerance, security, management, and other built-in bells and whistles.
One-stop shop
Many app servers are a one-stop shop, that is, they support all the necessary protocols to provide a complete application development solution. Take for example, BEA's WebLogic application server, which provides support for HTTP, RMI, EJB, Servlets, JNDI, JDBC, and other protocols, or Oracle's Application Server, which supports HTTP, CORBA/IIOP, and more. This frees you from having to run multiple servers (e.g., a Web server, a CORBA ORB, and an RMI server).
Now that we've looked why application servers are needed for Net development, let's look at why there's a need for EJB.
Productivity
EJB increases productivity for developers because they need not worry about low-level system programming (such as connection pooling, security, transaction management, state management, persistence, number of clients, and multithreading); they simply concentrate on writing the business logic and develop the enterprise bean almost as if it will be used by a single client.
Open server-side component architecture
In the past two or more decades, most server-based products have used the vendor's proprietary APIs, so not many off-the-shelf, plug-and-play components have been available, except from the vendors themselves. EJB changes this by providing portability across platforms and vendors. Because EJB sets a clear path for application vendors, all must provide the same minimal functionality in their server products, opening the flood gates for component builders to build off-the-shelf server-side components, not just client-side GUI components. For example, an off-the-shelf enterprise bean could handle functions such as credit card validation.
Object-oriented programming on the server
Thanks to Java's object-oriented roots and the EJB component model, organizations can more easily create and use reusable components, and thus spend less time writing code. One factor helping this reusability is that the logic and data are packaged together in objects. Additionally, EJB containers can translate relational data into objects automatically. This eliminates the distinction between accessing data from a database versus from any other object.
Java in the middle tier
EJB brings all Java features (such as security, directory services, and serialization) to the middle tier. In general, EJB drives forward Sun's layer-and-leverage philosophy, which calls for portability and leveraging existing enterprise investments.
Support for other languages and CORBA
EJB provides support for other languages and CORBA because the middleware vendor, not the enterprise bean developer, handles the communication protocol issues. For example, the default wire protocol for EJB is RMI; however, the EJB 1.0 specifications also provide mapping to CORBA. Furthermore, a vendor can use any distributed protocol to support many types of clients (COM/DCOM for example).
Who will support EJB?
EJB by itself isn't a product. Rather, it's a specification. One of the key objectives of EJB is portability across platforms and vendor products. Several vendors already support EJB or have announced plans to support it in future versions of existing products; additionally, Sun intends to provide a reference implementation of EJB by the second quarter of this year. Table 1 shows a partial list of vendors that have endorsed EJB:
Vendor
Product
BEA Systems
WebLogic Application Server
Bluestone
Sapphire/Web
Gemstone
Gemstone/J
IBM
Websphere
Information Builders
Parlay Application Server
Inprise
Inprise Application Server
Lotus
Notes/Domino
Netscape
Netscape Application Server (Kiva)
Novera
jBusiness
Oracle
Oracle Application Server
Persistence
PowerTier for EJB
Progress
Aptivity, Webspeed
Secant
Extreme Enterprise Server for EJB
Silverstream
Silverstream Application Server
Sun
NetDynamics
Sybase
Enterprise Application Server
Valto Systems
Ejipt
Wall Data
Cyberprise Server
Table 1. EJB endorsers
What exactly is EJB?
EJB is part of Sun's Java Platform for the Enterprise (JPE) initiative. JavaBeans introduced a standard way of developing and using Java components on the client side. Similarly, EJB serves as the Java component architecture for the server side.
EJB enables software developers to build server-side, reusable business objects (enterprise beans). However, EJB takes the notion of reusable objects one step further by providing for attribute-based programming to dynamically define lifecycle, transaction, security, and persistence behavior in EJB applications. For example, using attribute-based techniques, the same enterprise bean (in its binary form -- that is, class and/or Java archive [JAR] files) can exhibit different transactional behavior in different applications. Additionally, the method of persisting an enterprise bean can be altered during deployment without ever having to recode the enterprise bean. For example, an entity bean could use a relational database for its persistence or CICS; the enterprise bean developer never needs to know.
To provide a more concrete picture of what EJB is, let's look at the following topics borrowed from the EJB 1.0 specifications:
Goals
Features
Roles and responsibilities
Programming restrictions
Goals
The EJB 1.0 specification
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: The state of Java middleware, Part II: Enterprise JavaBeans - JavaWorld - April
1999
View Tutorial: The state of Java middleware, Part II: Enterprise JavaBeans - JavaWorld - April
1999
Related
Tutorials:
Use Web services
to integrate Web applications with
EISs
Use Web services
to integrate Web applications with
EISs |
Integrate EJBs with CORBA
Integrate EJBs with CORBA |
Rumble in the
jungle: J2EE versus .Net, Part
1
Rumble in the
jungle: J2EE versus .Net, Part
1 |
Jini's relevance emerges, Part
2
Jini's relevance emerges, Part
2 |
Should you go
with JMS?
Should you go
with JMS? |
Sun boosts
Sun boosts enterprise Java |
A first look at JavaServer Faces, Part I
A first look at JavaServer Faces, Part Learn how to implement Web-based user interfaces with JSF |
Finally, getting hands in !
Finally, getting hands in ! |
A Generic MVC Model in Java
A Generic MVC Model in Java
Model-View-Controller (MVC) is a widely used design pattern, especially popular in graphical user interface (GUI) programming. JDK 1.5 introduces parameterized types, or generics. Combining the two allows for a generic imple |
JMS Messaging Online Resource
JMS Messaging Online Resource
JMS Tutorials
JMS provides a way for Java programs to access an enterprise messaging system, also known as message oriented middleware (MOM). Check out the below tutorials.
|
An Introduction to Java Object Persistence with EJB
The 'impedance mismatch' between relational databases' tabular orientation and object-oriented Java's hierarchical one is a perennial problem for which the Java world has several good solution offerings. This article, the first in a three-part series, wil |
Distributed Objects & Components: JavaBeans
What is JavaBeans ? (from the FAQ) |
JSP (JavaServer Pages) is a standard for combining Java and HTML to provide dynamic content in web pages.
With JSP, you embed Java code in HTML using special JSP tags similar to HTML tags. You install the JSP page, which has a .jsp extension, into the WebLogic Server document root, just as you would a static HTML page. When WebLogic Server serves a JSP page.. |
Testing Your Enterprise JavaBeans with Cactus
Enterprise JavaBeans provide many advantages. But each server-side/back-end developer knows that development of EJBs is sometimes painful, time-consuming, and requires a lot of patience while creating assembly descriptors, application-server-specific conf |
Getting Started with Java Message Service (JMS)
The Java Message Service (JMS) is designed to allow Java applications to use enterprise messaging systems. It makes it easy to develop enterprise applications that asynchronously send and receive business data and events. Learn how to implement it for you |
Getting Started with Java Management Extensions (JMX): Developing Management and Monitoring Solutions
The Java Management Extensions (JMX) API is a standard specification developed through the Java Community Process (JCP) as JSR 3 for managing and monitoring applications and services. |
What is Persistence Framework?
What is Persistence Framework?
What is Persistence Framework?
A persistence framework moves the program data in its most natural form (in memory objects) to and from a permanent data store the database. The persistence framework manages the |
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java
Struts
Struts Frame work is the implementation of Model-View-Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open |
Developing Distributed application using Enterprise Java Beans, J2EE Architecture, EJB Tutorial, WebLogic Tutorial.
Developing Distributed application using Enterprise Java Beans, J2EE Architecture, EJB Tutorial, WebLogic Tutorial.
Distributed Architecture
Two-tier application:
In the past two-tier applications were used. Two-tier applications are also know as |
Introduction to the JDBC
Introduction to the JDBC
Introduction to the JDBC
Introduction
T his article introduce you with JDBC and shows you how to our search engine with database.
What is JDBC?
J ava Database Connectivity or JDBC for short is set of Java API's that |
|
|
|