O'Reilly logo

Building Java Enterprise Applications by Brett McLaughlin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Business Logic

You have now completed the data layer of your application, and are ready to dive into the business layer. If you recall from Chapter 2, the business layer incorporates your application’s business logic. Specifically, you will need to provide access to your entity beans, business calculations, and a scheduling facility. In this chapter, I’ll detail the access to entity beans already in place, and discuss how to handle more complex business tasks. Chapter 9 then details the scheduling process.

First, I’ll discuss the façade pattern, in which you use session beans to access entity beans. This access method is used instead of allowing direct access to entity beans, and is key to a sound strategy in building enterprise applications. I’ll also outline the problems and penalties associated with this approach, giving you the information you need to make good decisions in your own applications. This pattern goes hand in hand with the manager component discussed in Chapter 6 when working with directory servers. I’ll illustrate the pattern with a simple example, an OfficeManager session bean.

From there, I’ll move on to slightly more complex session beans. You’ll see how a single session bean can perform operations on multiple beans and on other Java components. You’ll build a UserManager component, which will administer users, and will operate upon the User entity bean as well as the LDAPManager directory server component. This should give you an idea of how to handle ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required