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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Avoid adding HTML content in the JSF pages. Styles or CSS files should be used instead as ADF Framework provides support for that.
- Do not use multiple database connection for the same Database, prefer to use nested application module (AppModule).
- 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
- When a view criteria is applied programmatically in a business method from the application model later the view criteria must be removed.
- 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.
- Avoid using the view’s attributes in the WHERE clause for filtering, instead use default criterias for each view instance from the application model
- 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.
- 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
- Use SetPropertyListenerinstead of SetActionListener for passing the values.
- Create separate style sheet for different devices in the application and retrieve the value from the <skin-family> tag.
- Avoid using heavy images as it increases the loading time of the page.