Enterprise JavaBeans(TM)

Java 2 Platform, Enterprise Edition (J2EE), Part 1

By Richard G. Baldwin

Java Programming, Lecture Notes # 1305

October 2, 2000


Preface

This is one in a series of lessons designed to teach you about Sun's Enterprise JavaBeans(TM) technology, often referred to simply as EJB.  Enterprise JavaBeans(TM) is a trademark of Sun.

This lesson and the next two lessons constitute a three-part miniseries designed to provide background information, and to explain where EJB fits in the grand scheme of things at Sun.

Subsequent lessons will show you how to write, deploy, and execute enterprise beans.

Introduction

Preview

This lesson will introduce you to the world of enterprise data processing, Enterprise JavaBeans(TM), and Sun's Java 2 Platform Enterprise Edition, often referred to simply as J2EE.

I will explain the difference between Enterprise JavaBeans(TM) and JavaBean Components(TM).

The lesson will venture into the world of multi-tier systems (I will have much more to say about this topic in future lessons).

A couple of real-world examples of multi-tier systems will be cited in the form of the ubiquitous ATM and the gasoline pump that accepts credit card payments.

Enterprise JavaBeans(TM) and JavaBean Components(TM)

Because of the likelihood of confusion regarding the use of the term beans, I will begin by telling you that an EJB is not a JavaBean Component(TM), as discussed in my series of tutorial lessons beginning with lesson number 500.

What is a JavaBean Component(TM)?

Briefly, a JavaBean Component(TM) is reusable compiled code that is intended to be combined with other JavaBean components in a visual development tool.  For example, most of the Java AWT and Swing GUI components are JavaBean Components(TM).

While JavaBean Components(TM) may have some functionality on the server when used in conjunction with servlets and JSP, they are probably best suited for and most commonly used on the client side.

So, what is an EJB?

Enterprise JavaBeans(TM) consist of reusable compiled code that is designed to be installed inside a special application server that is compliant with Sun's Java 2 Platform Enterprise Edition.

More specifically, EJBs are reusable compiled software components intended for use in the middle tier of multi-tier enterprise software systems.  They have no applicability on the client tier of the multi-tier system (although one EJB can function as a client to another EJB).

First cousins

While enterprise beans and JavaBean Components(TM) are definitely cousins, and both are intended to provide reusable software components, they are very different.  Don't let the similar names confuse you.

Use of Bean in this lesson

Now that you know that there is a difference, I will have nothing more to say about JavaBean Components(TM) in this lesson.  From this point forward in this lesson, when I refer to beans, I will be referring to Enterprise JavaBeans(TM).

Java 2 Platform, Enterprise Edition

Enterprise JavaBeans(TM) technology is part of a larger overall software development technology from Sun known as the Java 2 Platform, Enterprise Edition (J2EE).

Why use J2EE?

One of the main goals of J2EE is to make it possible for the enterprise software developer to reduce development cost and reduce time-to-market response time.

Enterprise software requires many services

Enterprise software typically needs to provide a variety of services to customers, partners, employees, and suppliers.

In many cases, the software that provides these services must combine existing information systems with new business requirements to deliver the required services to a broad range of users.

What does Sun say about the required services?

According to Sun, these services need to be:

Multi-tier systems

In today's world, systems for delivering these services are usually built as distributed systems consisting of several tiers or layers.  Such systems usually include a client tier, a back end data storage tier, and one or more tiers in the middle to implement business logic and processes.

The Automatic Teller Machine (ATM)

For example, the ubiquitous ATM serves as the client tier in certain banking systems.  There are probably layers in the middle that communicate with the ATM, and interpret and process the information that flows from and to the ATM.  Certainly there is a back-end tier where the information about your bank balances is stored on a (hopefully) persistent basis.

Most development is at the middle tiers

According to Sun, the majority of application development work on enterprise systems is done in the middle tiers.  Therefore, in order to leverage software development dollars, we need to make the development of software in the middle tiers as straightforward and productive as possible.

Automatic gasoline pumps

The automatic gasoline pumps that process credit cards on the driveway in front of the convenience store probably represent the front end or client tier of another form of multi-tier system.

As these automatic gasoline pumps evolve (to allow you charge a car wash in addition to the gasoline, for example), the software in the middle tier must be upgraded to accommodate new features.

However, it is not likely that modifications would be required in the back-end data storage simply to accommodate the fact that the gasoline pump now knows how to sell a car wash in addition to selling gasoline.  Hopefully, that back-end data system, which stores your credit card balances, is solid as a rock and only rarely modified.

Reducing cost and complexity of development

J2EE is designed specifically to accommodate the need to productively develop and upgrade the software in the middle tier of a multi-tier system.  The design is intended to reduce the cost and complexity of developing and upgrading multi-tier capability.  The intent is to make it possible to quickly deploy and enhance new capability in response to competitive pressures.

According to Sun, "The middle tier shields the client tier from the complexity of the enterprise and takes advantage of rapidly maturing Internet technologies to minimize user administration and training."

Summary

This lesson, which is the first part in a three-part miniseries, has introduced you to the world of enterprise data processing, Enterprise JavaBeans(TM), and Sun's Java 2 Platform Enterprise Edition.

The lesson has explained the difference between Enterprise JavaBeans(TM) and JavaBean Components(TM).

The lesson has ventured into the world of multi-tier systems (I will have much more to say about this topic in future lessons).

A couple of real-world examples of multi-tier systems were cited in the form of the ubiquitous ATM and the gasoline pump that accepts credit card payments.

Where To From Here?

This lesson has been very general in nature.  The next lesson will become a little more specific with respect to a discussion of Sun's J2EE.

In addition to Enterprise JavaBeans(TM), other Java components such as servlets, Java Server Pages (JSP), and JDBC are part of J2EE.  I have already published a large number of lessons on servlets, JSP, and JDBC.  You will find links to those tutorial lessons on my personal web site.


Copyright 2000, Richard G. Baldwin.  Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.

About the author

Richard Baldwin is a college professor and private consultant whose primary focus is a combination of Java and XML. In addition to the many platform-independent benefits of Java applications, he believes that a combination of Java and XML will become the primary driving force in the delivery of structured information on the Web.

Richard has participated in numerous consulting projects involving Java, XML, or a combination of the two.  He frequently provides onsite Java and/or XML training at the high-tech companies located in and around Austin, Texas.  He is the author of Baldwin's Java Programming Tutorials, which has gained a worldwide following among experienced and aspiring Java programmers. He has also published articles on Java Programming in Java Pro magazine.

Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.

baldwin.richard@iname.com

-end-