Book Image

Mastering Netbeans

5 (1)
Book Image

Mastering Netbeans

5 (1)

Overview of this book

Table of Contents (17 chapters)
Mastering NetBeans
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a session bean façade for entity classes


In the previous section, we saw how we can use NetBeans to help us create business methods within EJBs and easily invoke EJB from client applications.

In all but the most simple application, however, we usually have a database component and a graph of database objects modeled with the @Entity annotation within our application.

Since one of the benefits of EJBs is that they offer transactional support, EJBs make a good candidate for a session façade for entity classes. A session façade is a design pattern that abstracts the implementation of methods away from callers in order to decouple business objects from callers. In this instance, NetBeans can create a session façade that abstracts away all of the database functionality from clients, making the clients unaware of how business objects are persisted. This is only one use of a session façade though, and as a developer, we can add more methods into the façade to provide the exact services that...