Article

Home » Server-side Coding » Java and J2EE » Enterprise JavaBeans, A Primer: Part 3, A Tour of the Java Pet Store

About the Author

Jeff Hanson

author_jeff Jeff has more than 18 years of experience in the software development industry, including almost 7 years experience with Java and J2EE. He's authored numerous articles and books, including NET versus J2EE Web Services: A Comparison of Approaches and Connecting JMX Clients and Servers: Understanding the Java Management Extensions.

View all articles by Jeff Hanson...

Enterprise JavaBeans, A Primer: Part 3, A Tour of the Java Pet Store

By Jeff Hanson

January 12th, 2004

Reader Rating: 8

Page: 1 2 3 Next

The J2EE platform is built around an architecture designed for developing distributed, multi-tier systems.

As we saw in Part 1 and Part 2 of this series, such systems are typically implemented around:

  • a Web tier, embodied by request handling and user interface generation
  • a business tier, exposing business logic, services, and processes
  • an integration tier, providing data access and enterprise integration system (EIS) access

The figure below illustrates the various components that make up a typical J2EE environment.

1270_image1

As illustrated, the business tier exposes business-logic as Enterprise JavaBeans (EJBs). The EJB architecture allows a business-logic developer to concentrate on the business logic, leaving the complexities of a distributed, component infrastructure to the EJB container.

The EJB architecture is the center of attention in the J2EE programming model. The EJB specification makes a business-logic developer's life easier by:

  • Presenting a comprehensive set of APIs that a developer can use to implement business-logic components
  • Defining a distributed container environment in which EJBs are constructed, invoked, persisted, restored and retired without intervention by the business-logic developer

The Pet Store application is the quintessential sample application being used by distributed environment vendors to benchmark and demonstrate the features and performance of their products. This application demonstrates how to use the technologies of the J2EE platform, including EJBs, to develop full-featured enterprise applications.

The Pet Store application is an incarnation of the Enterprise BluePrints presented by Sun. This working example of the BluePrints enables developers to reduce the learning curve of the J2EE platform by acting as a starting point for a complete, end-to-end solution for most typical enterprise applications. Here, we'll focus our attention on the Pet Store's use of EJBs. First, we must install the needed environments.

Installing the Pet Store Application

The Pet Store application must run in an application server environment. The reference implementation application server can be downloaded here. The Pet Store application can be downloaded here.

Once you've downloaded the reference implementation and the Pet Store application, run the reference implementation's install program, then unzip the Pet Store application and extract its contents to your desired directory. Note the install directories and any other information for both products.

The rest of this article will refer to the reference implementation installation directory as <J2EE_HOME> and the Pet Store installation directory as <PETSTORE_INSTALL_DIR>.

From the bin directory of <PETSTORE_INSTALL_DIR>, run the setup script. On a UNIX or Linux system, open a shell window and type:

cd <PETSTORE_INSTALL_DIR>
sh setup.sh

On a Windows system, open a command window and type:

cd <PETSTORE_INSTALL_DIR>
setup.bat

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links