Ask the Expert

Entity beans vs. session beans

If I am using Session Beans (Stateless and Stateful) for my application, which implements a simple workflow or process kind of thing; what is the consideration I have to make for using either Session bean or Entity Bean? What if I use Entity Bean instead of Session Bean?

    Requires Free Membership to View

Best practices recommend entity beans for data access and session beans as frontline controllers between the Web tier and business tier or between the client tier and the business tier, depending on the type of application. Business logic should be implemented with session beans and/or plain old Java objects (POJOs). If you will be receiving asynchronous messages within your workflow framework, message-driven beans are very effective and highly recommended. With this in mind, the following chart loosely illustrates the interactions between these components:

Browser Application:

Browser <--> Servlet <--> Stateless Session Bean <--> Entity Bean <--> Data

Fat-Client Application:

Swing App <--> Stateful Session Bean <--> Entity Bean <--> Data

Asynchronous Messaging:

App <--> Session Bean <--> Message-Driven Bean <--> Message Store

This was first published in July 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: