Oracle ADF Best Practices for web based application development

The Application Development Framework provides numerous controls and components to make Rich Client UI for the application. The following given best practices can allow the developer to use the available controls and components in the most optimized way.

  1. Avoid using the invokeAction in pageDefbecause will be executed several times. Use a task flow with a method call and the page can be reused in other task flows.
  2. Do not create view criteria’s containing the name of the view since the name of the view can be changes thus require change in the View Criteria also.
  3. Service methods should not be called from the application model as they are dependent of the view iterators Standard operators like standard operations CreateWithParams, ExecuteWithParams can be used to achieve the same.
  4. Always prefer to create the template for the JSP pages and include that in corresponding pages. The UI controls like Panel Splitter, PanelGroupLayout can be used with different facets using the common template structure.
  5. Prefer to create the iterators for the view in the service method ( java bean class) and default iterator provided by view object should be avoided.
  6. Avoid adding HTML content in the JSF pages. Styles or CSS files should be used instead as ADF Framework provides support for that.
  7. Do not use multiple database connection for the same Database, prefer to use nested application module (AppModule).
  8. Do not combine view accessors with data model master-detail because accessor attributes create distinct row sets based on an internal view object other than that from detail
  9. When a view criteria is applied programmatically in a business method from the application model later the view criteria must be removed.
  10. Always use the Connection Type as ‘JDBC DataSource’ and provide the JNDI name defined in the Data Source of Web Logic Server to leverage the Connection setting and pooling techniques provided by the Application Server.
  11. Avoid using the view’s attributes in the WHERE clause for filtering, instead use default criterias for each view instance from the application model
  12. Always define the scope in the JSF Page to use the page variables. Following scopes are used:
  • RequestScope,
  • backingBeanScope,
  • viewScope,
  • pageFlowScope,
  • sessionScope,
  • applicationScope,
  • backingBeanScope

SessionScope and PageFlowScope are preferred if the pages have limited variables and are required to be used by other applications pages.

  1. In the context of fragment based task flows, use viewScope in preference to request scope for a more predictable behavior within the context of the sub-flow that contains the fragments
  2. Use SetPropertyListenerinstead of SetActionListener for passing the values.
  3. Create separate style sheet for different devices in the application and retrieve the value from the <skin-family> tag.
  4. Avoid using heavy images as it increases the loading time of the page.