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.

If you choose to use entity beans, hopefully this chapter will help you to avoid many common pitfalls. However, I recommend alternative approaches for data access in most applications. In the 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.



Expert One-on-One J2EE Design and Development
Microsoft Office PowerPoint 2007 On Demand
ISBN: B0085SG5O4
EAN: 2147483647
Year: 2005
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net