Download sample application - ADFIntegrationNested.zip. This sample contains multiple Oracle JDeveloper 11g PS2 applications to demonstrate integration functionality together with nested application modules usage.
You will find first application with Employees Model implementation. ADF BC Model is packaged into ADF JAR Library to reuse it inside main application:
Second application is identical to first one and implements Jobs Model functionality. It is packaged into ADF Jar Library as well:
There are two applications two integrate ADF BC Model and use Business Services inside ADF Regions. Why two applications? First integrates ADF JAR's directly into ViewController - means using Application Modules directly from ADF JAR's. Second integrates ADF JAR's into local Model project, Business Services from imported libraries are exposed through local proxy Application Module - this Application Module contains Nested Application Modules from imported libraries.
Application without Nested Application Modules (FIRST) - no Model part implementation:
Application with Nested Application Modules (SECOND) - contains local proxy Application Module, it joins Application Modules from imported libraries into Nested group:
We have two imported libraries, based on Employees and Jobs models:
FIRST application integrates Model libraries directly into ViewController, this means DataControl is available:
You can see two Data Controls available, this basically means we are using two different Application Modules. Application is deployed on WLS under regions context root path:
Now we can test FIRST application, it implements two ADF Regions based on two Application Modules from imported ADF JAR Libraries:
Type any value into Employees and Jobs regions, press Save inside Employees region:
Press Undo inside Jobs region - it works as expected, data from Jobs region is reset to original values and Employees keeps updated values. It happens because we are using two different Application Modules - transactions are managed separately:
While it works good from user perspective, if we check reserved database connections, we will see two of them:
Thats quite logical - we are using two Application Modules, both are present on current page inside of two regions. However, from performance view its not ideal - each user will use two database connections in this case.
How we can improve this and use only one connection even for two ADF Regions working with two Application Modules? We can use Nested Application Modules. When we are importing ADF JAR Libraries, local proxy Application Module can be created to join imported ones into Nested group - check SECOND application:
SECOND application imports ADF JAR libraries with Model implementation for Jobs and Employees into local Model project:
Local proxy Application Module doesn't have any View Object Instances - its empty:
But it contains Application Module Instances - Nested group of modules from imported libraries:
In Data Control we can see now only one local Application Module, it contains nested Application Modules:
Nested Application Modules bring View Object Instances from imported ADF JAR Libraries:
I'm using those View Objects from Nested Application Modules inside ADF Regions.
Important to mention, both Commit and Rollback operations are declared on local Application Module. Since imported ones are nested, Commit and Rollback operations are applied from master Application Module:
Main page contains ADF Faces Dashboard component with both regions for Jobs and Employees:
SECOND application is deployed with nestedregions context root path:
Again two ADF Regions are rendered:
We type into Employees and Jobs, press Save for Employees to commit changes:
Press Undo in Jobs region:
Uncommited data in Jobs is reverted, commited Employees changes remain:
Here is one very critical difference between ADF Region and ADF Page - even we are using Nested Application Modules and Commit operation from master Application Module - it still commits only transaction for current region (specific imported Application Module), which is great. With ADF Page it would commit changes from all Nested Application Modules at once.
Let's take a look into database connection usage, only one database connection is used now - great performance improvement:
As you can see, Nested Application Modules in combination with ADF Regions can be great performance improvement in Oracle Fusion applications.