Monday, March 12, 2012

Learning from Fusion Applications Development

The purpose of this blog post is to get my feet wet with "the art" of Fusion Applications programming and of course learn best practices from Oracle in the overall application design and architecture for custom ADF Applications. In order to get there I downloaded the following components from Oracles eDelivery Platform:

* Oracle JDeveloper and ADF 11.1.1.5.3

* Oracle Fusion Applications Companion

Installation

Following the Fusion Applications Development Guide I installed the JDeveloper (nothing special here - like every other 11g JDev version). After starting JDev 11.1.1.5.3 I installed a bunch of extensions wich are part of the fusion apps companion package.

...

After JDev Restart I have created a new app usgin the well known app template "Fusion Web Application (ADF)" opened the ViewController preferences and added the following Libraries

0000@2807_2807-41266a99be90e085

When you now create a JSF Page you are able to choose from the following Page Templates:

0001@2807_2807-41266a99bf240796

The UIShell based JSF page looks as follows

0002@2807_2807-41266a99c0369d03

Taking a deeper look into the JSF template we can see a bunch of popup definitions

0009@2807_2807-41266addace209dc

From a UI Pattern perspective I would imagine to see one common practice for popup but as you can see almost every tech. possible solution is in use

0010@2807_2807-41266addae40795d

The UIShellMainArea template is for JSF Fragments has nothing special. It looks like

0003@2807_2807-41266a99c1ad524d

One interesting thing here is that there is another facet exposed which is not visible

0004@2807_2807-41266a99c1f31aed

To ease the development experience with the apps UI Shell a special controller exists that is exposed as datacontrol (UIShellController)

0005@2807_2807-41266a99cb5dad52

Further DC are

0006@2807_2807-41266adda52adb36

0007@2807_2807-41266adda54dbf87

0008@2807_2807-41266adda57e4b18

and many many more.

So now let's create a playground HRAppModule an drop a collection on the page

0011@2807_2807-41266addb71c71c7

The apps extensions have additional support for

Popup
Table
Panel
Dialog Details
Tree
Tree Table

I will try the table

0012@2807_2807-41266addb7a67eac

Pressing "Continue" we are moved to the next interesting screen

0014@2807_2807-41266addb8acf135

After confirming with OK..unfortunataly the visual design is messed up

0015@2807_2807-41266addb9555555

Never mind...under the hood the following is created

0016@2807_2807-41266addba7104ee

Can we run this without looking into the dev guide?

Lets try start the integrated WLS:

<12.03.2012 22:01 Uhr MEZ> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>

<12.03.2012 22:01 Uhr MEZ> <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "SearchDB": I/O-Fehler: Unknown host specified >

<12.03.2012 22:01 Uhr MEZ> <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "SearchDB": I/O-Fehler: Unknown host specified >

=> Solution: fixed the jdbc connection in $DH/config/config.xml. Just pointed it to a valid Oracle DB.

The start procedures moves on. Stops with the following exception:

12.03.2012 22:17 Uhr MEZ> <Error> <HTTP> <BEA-101020> <[ServletContext@8785308[app:FusionAppsCustomization module:FusionAppsCustomization-ViewController-context-root path:/FusionAppsCustomization-ViewController-context-root spec-version:2.5]] Servlet failed with Exception

oracle.jbo.NoDefException: JBO-25002: Definition oracle.apps.fnd.applcore.uicomponents.view.DataControls of type null is not found.

at oracle.jbo.mom.DefinitionManager.findDefObjectUsingMetadataObject(DefinitionManager.java:2918)

at oracle.adf.model.binding.DCDataControlConfigDef.findDefObject(DCDataControlConfigDef.java:32)

=> No solution yet! One more great example of bad exception handling in ADF ;)

Lessons learned so far

- UI Popups: The different popup construction practices may come from different reusability contexts.
- UI Popups: Put global available popups into the page template
- DataControls for UI specific operations
- Usage of declarative components to simplify/standardize ui development
- Of course BTFs where ever you look
- AND: Although Fusion Apps developers have same JDeveloper it is enriched with great extensions (by the cost of performance. The IDE performance is much worse than the pulicly available JDev)

ADF Enhencement requests
- The default for af:popup/contentDelivery attribute should be changed from: "lazy" to "lazyUncached". Fusion apps template confirms this!
- Dear Oracle, please integrate the Applications extensions for: Table, Panel, Popup.....into default JDev Wizard.

References