Saturday, July 16, 2011

What are ADF business components and which component provides transaction management?

A challenge every Java developer developing applications using data from a database faces is mapping Java objects to relational tables, managing transactions and locking, and ensuring adequate performance. There are many frameworks that help us handle this, without us needing to build everything from scratch. The open source community has produced a large number of more or less complete and robust frameworks for working with databases and Java objects. Oracle's solution is the Oracle Application Development Framework Business Components.

The main components of the ADF Model layer are:

1. The Entity objects or EO's
2. The View objects or VO's and
3. Entity Association's
4. View Object ViewLinks
5. The Application modules or AM's
6. The Business Component Tester or AM tester

The EO/VO is similar to Object relational mapping elements.
So, in essence, EO/VO provide a standard way of interacting with database tables and serve as the data model source.

The Entity Object

An EO represents a table in simple terms. It defines the table's attributes, the data types, validation on the data, the primary keys and the entire business logic that needs to be defined for pushing data into the target table.


The View Object

The view object can be based on EO's, which are similar to SQL queries used to extract data, or it can be programatically populated, or with a static list.

However VO's based on EO's are most used option. While a few validations can be done even at the VO level, it's better to have business logic on the EO's as this will help provide a central point for all VO's dependent on them.


Associations and Viewlinks

They define the join or the link among EO's and VO's. Associations defines link between EO's. They can be considered as PrimaryKey/ForeignKey relationships between tables. They define the Join conditions.

A viewlink defines the link between VO's and can be based on an association or on attributes.

The Application Module

The application module packages the VO's and serves as the data control.The AM creates and manages the database transaction for ADF Model layer. It is the Application Module that exposes the data needed by the client. So, for an end user, the interaction and transactional capabilities are provided by the application module.

The Business Component Tester

The most used component of the model layer is the tester. It can be run to check the data model that is implemented. This serves as the first line of defense to see if data is exposed as desired, without the need to create a UI.

4 comments:

Anonymous said...

You forgot to mention that the entire pattern is rubbish.

ADFfan said...
This comment has been removed by the author.
ADFfan said...

Oracle ADF is excellent product ..I have successfully delivered plenty of applications in Oracle ADF and they all are happily running in PROD without any defect. For dummies who do not understand the product, it is rubbish.

elite.samyak said...

Very useful blog. Thanks for the information.

visit: Business Component development