Monday, December 4, 2006

Oracle ADF - between 4GL and J2EE is only one step

According to ADF architecture described in Oracle JDeveloper 10g (10.1.3) Developer's Guide Section 1.1.1 - Framework Architecture and Supported Technologies, it is possible to use both Business Services - EJB+TopLink (J2EE track) and ADF Business Components (4GL track) in the same View layer. ADF Faces components used in View layer should access separate Business Services through unified ADF Controller layer. However, I have never tested it in practice. To test it, I have created sample application -, where two JSF pages are used - one to create data, another to view it.

For database schema I'm using standard HR schema and one table from it - LOCATIONS. Application contains three projects - DataModelJ2EE (for EJB+TopLink), DataModelBC (for ADF Business Components) and UserInterface (for ADF Faces). As you see, I'm using the same view layer for both Business Services.

View layer contains two pages - create.jspx and view.jspx. JSF page create.jspx contains ADF Creation Form generated from BC application module data control. When new record is created, view.jspx page is opened. JSF page view.jspx contains two ADF Tables, each table contains data from the same LOCATIONS table. First table is generated using EJB Facade data control, second using BC application module data control. There are two JSF navigation cases - from view.jspx to create.jspx and otherwise.

Application View layer, based on EJB+TopLink and BC works correctly, just do not forget to add refresh condition for table generated using EJB Facade data control. All definitions for both tables are stored in the same page definition file. Let us explore page definition file in more detail.

For table generated using EJB Facade data control we have:

1. Method iterator

2. Invoke action for table refresh

3. Method action

4. Table

For table generated using BC application module data control we have:

1. Iterator

2. Table

All of these definitions are in the same file and are used by the same JSF page. So, there are two tracks - J2EE and 4GL, but you can integrate them perfectly in View layer, using the same ADF Faces components.

No comments: