Enterprise JavaBeans 3.0

What’s New in EJB 3.0

The main objective of the Enterprise JavaBeans (EJB) 3.0 specification is to improve the EJB architecture by reducing its complexity from the developer’s point of view. EJB’s new features include support for:

  1. metadata annotations
  2. default values for a configuration
  3. simplified access of environmental dependencies and external resources
  4. simplified session and entity beans
  5. interceptors
  6. enhanced support for checked exceptions
  7. elimination of callback interfaces

The persistence and object/relational model in EJB3.0 is the Java Persitence API (JPA).

EJB 3.0 metadata annotations reduce the code required and make the deployment descriptors redundant. The local/remote and local home/home interfaces are not required in EJB 3.0 entity beans, and only a POJO class is required for an entity bean. The Java Persitence API provides an object-relational mapping model. Interceptors, simplified checked exceptions, and callback interfaces are some of the other new features in EJB 3.0.

Source: EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g, Vohra, D., pp. 7-22

How to format a good Git commit message

There are a few rules you can stick to that will make sure you have the best commit message in your team! They are as follows:

  1. The first line should contain 50 characters or less and explain the change very briefly.
  2. The next paragraph should contain a bit more explanation about what you are trying to solve. Try to keep the length of the line under 72 characters. this way, it’s easy to scan people.
  3. If you have more information that you want to tell, you can do so in the next paragraph. This can be as long and detailed as you want. More details are better!
  4. If you want to create a list, user the – or * characters to do so.
  5. When you’re working on an issue, add a reference to that issue in the last line.

Source: GitLab Cookbook, van Baarsen J., pp. 145

Facade Pattern

I was studying how to develop enterprise applications through this book. After I have followed all steps indicated from the book I was curious about files from jpacontroller folder. All those files contains word Facade at the end.

So what that means? I presume that means a design pattern called Facade Pattern is used. From that, I have another question: what is Facade Pattern job?

According to this source, Facade Pattern simplify the interface to large body code. Look at the image below and compare the difference.

Facade Pattern - Image to understand the job of Facade Pattern
Facade Pattern

Summarize

Facade Pattern is used when it is necessary to have a cleaner code and a separation of front-end presentation and back end functionality.

Data Access Object

Data Access Object also know as DAO is a J2EE Design Pattern learned from this book.

There is a site explains this design pattern.

Problem

You want to encapsulate data access and manipulation in a separate layer.

Forces
  • You want to implement data access mechanisms to access and manipulate data in a persistent storage.
  • You want to decouple the persistent storage implementation from the rest of your application.
  • You want to provide a uniform data access API for a persistent mechanism to various types of data sources, such as RDBMS, LDAP, OODB, XML repositories, flat files, and so on.
  • You want to organize data access logic and encapsulate proprietary features to facilitate maintainability and portability.
Solution

Use a Data Access Object to abstract and encapsulate all access to the persistent store. The Data Access Object manages the connection with the data source to obtain and store data.