In this tutorial you will learn how to develop an application that uses Enterprise JavaBeans technology. You will build the EJBProjectTutorial application, which uses session, entity, and message-driven beans to model a music site, registering information about bands, recordings, and recording ratings. The below diagram shows the components that you will build in blue. The components in white are predefined in the tutorial.
Note. If you are new to Enterprise JavaBeans technology, you might want to consider running the Getting Started: Enterprise JavaBeans tutorial first before continuing with this tutorial. The Getting Started Tutorials is a series of short tutorials that offers a basic step-by-step introduction to the core J2EE components and how you can develop these components with WebLogic Workshop
The
tutorial consists of three parts. In Part One, you will create a new application,
import an existing entity bean Band and develop a stateless session
bean Music. You
will also add component methods and EJB references. In the final section
of Part One you will test the EJBs using two different page
flows. Both page flows allow you to add bands to the database and receive
a listing of
known
bands.
One
page
flow uses an EJB control to locate and reference an EJB while the other
page flow uses Java JNDI API directly embedded in a JSP page.
In Part Two of the tutorial you will develop a second entity bean Recording, and define a relationship between bands and recordings. You will use another page flow to add bands and recordings for bands, and receive listings of recordings and bands. You will also develop a test web service to run and test the Bands bean.
In Part Three of the tutorial you will develop a message-driven bean Statistics that creates ratings for recordings. You will learn how to send a message for this bean from the Music EJB and how to store the rating information the Statistics bean generates. You will use another page flow to test the EJBs.
In this tutorial you will learn how to develop session, entity, and message-driven beans. Along the way you will become acquainted with advanced features such as entity relationships. Also, this tutorial shows how to build a full-fledged application by including a page flow application, and demonstrates popular design patterns used to model EJBs. The tutorial guides you through the process of adding functionality in increments and shows how to test your EJBs as you build them.
The following components are used in this tutorial:
The entity beans in this tutorial perform operations on database tables that hold information about bands and recordings. The session bean encapsulates the business logic of the music site. It serves as an intermediary between client applications and the entity beans - a common design pattern called Session Façade - and also sends JMS messages. The message-driven bean, which processes these JMS messages, invokes an entity bean to store information generated during the processing of a message. Message-driven beans are frequently used in this manner to enable asynchronous handling of business tasks that require involvement of session and/or entity beans.
To begin the tutorial, see Part One: Building Your First EJBs. You can also click the arrow to navigate to this next step.
|