Expert OneonOne J2EE Design and Development [Electronic resources]

Rod Johnson

نسخه متنی -صفحه : 183/ 87
نمايش فراداده

Chapter 8: Data Access Using Entity Beans

Overview

Entity beans are the data access components described in the EJB specification. While they have a disappointing track record in practice (which has prompted a major overhaul in the EJB 2.0 specification), their privileged status in the J2EE core means that we must understand them, even if we choose not to use them.

In this chapter we'll discuss:

What entity beans aim to achieve, and the experience of using them in practice

The pros and cons of the entity bean model, especially when entity beans are used with relational databases

Deciding when to use entity beans, and how to use them effectively

How to choose between entity beans with container-managed persistence and beanrmanaged persistence

The sinificant nhancements in the EJB 2.0 entity bean model, and their implications for using entity beans

Entity bean locking and caching support in leading application servers

Entity bean performance

Important

I confess. I don't much like entity beans. I don't believe that they should be considered the default choice for data access in J2EE applications.

next chapter we'll consider effective alternatives, and look at how to implement the Data-Access Object pattern. This pattern is usually more effective than entity beans at separating business logic from data-access implementation.