Tuesday, December 4, 2012

ADF Mobile - Implementing Reusable Mobile Architecture

Reusability was always a strong part of ADF. The same high reusability level is supported now in ADF Mobile also. I have a blog, where ADF reusability architecture is described through ADF Libraries and ADF Task Flows - Integration in Oracle ADF Through ADF Libraries and ADF Task Flows. This blog was posted in 2009, now this architecture approach became de facto standard and is applied in every ADF project. We go mobile and apply similar architecture pattern for reusability through ADF Mobile libraries (Feature Archive Files) and ADF Mobile Feature sets. You can read more about ADF Mobile Feature Archive Files here - 5.12 Working with Feature Archive Files. Main goal of this post is to prove technically that reusable architecture concept works for ADF Mobile.

Here you can download a set of sample applications developed for this post - mobilereusable.zip. Sample use case is based on previous post - ADF Mobile - Secured Web Service Access, it contains one new application - ADFMobileEmplFar. This application implements reusable ADF Mobile artifact.

The main idea for ADF Mobile reusable architecture is to split one big block into smaller ones and allow to develop these smaller blocks separately:


To test ADF Mobile reusable functionality and Feature Archive File import into main ADF Mobile application, I decided to consume secured Web Service in my library application and import it into main ADF Mobile application. To make it more fancy, I have exposed VO through secured Web Service and implementing a list in my reusable mobile library:


VO is exposed through service interface:


Reusable mobile library contains mobile feature file, where mobile task flow is registered with employees list:


This feature is enabled with security, this will make sure it will be accessible only if user is authenticated into mobile application:


Reusable mobile library contains a list of employees, retrieved from secured Web Service:


This list is implemented using regular ADF approach - drag and drop Data Control element into ADF Mobile page:


Once we define secured Web Service connection and generated Data Control, reusable mobile library is updated with connection details for secured Web Service - connections.xml file:


You must copy connection details into main application connections.xml file manually, otherwise connection will fail.

Define ADF Mobile Feature Archive deployment profile and deploy your reusable mobile library:


Create file system connection in Resource Palette - you can browse through and see ADF Mobile features packaged into library:


Import library into main ADF Mobile application, same as you would import regular ADF library into regular ADF project and ADF Mobile feature becomes available in the main application context:


As I have said earlier - copy secured Web Service connection details into main application connections.xml file:


We are ready to test now - login into ADF Mobile application:


You can see two buttons - Home and Employees, these buttons represent ADF Mobile features we deliver with our application. Home is default feature and it loads first:


Click on Employees button - it will load feature included from reusable mobile library with Employees list:

2 comments:

Unknown said...

Hi great post, and what I was trying to do exactly! Thanks!

Anonymous said...

Hi,

Is there a way I can use ADF templates, ( à la webcenter portal) in designing amx pages? where I can provide a header/footer in template and the body as the amx page ?

Thanks in advance !