Show TOC

Background documentationPresentation Layer Locate this document in the navigation structure

 

The presentation layer of the Project Management and Employee Services application uses JSF 1.2 and JSP 2.1 technologies. Below, you can find our hints related to this layer:

  • Create beans to wrap EJBs (used as JSF-managed beans to combine the dual layers of Web actions and EJBs).

  • We do not recommend you mix Frames technology in JSF pages as it is difficult to handle JSF navigation.

  • Use backing beans and attributes defined therein in the smallest scope that fits the requirement.

  • Avoid using properties of global (session/application) scope at different pages, especially for different meanings.

  • Clear separation of concerns to reduce possible side-effects.

  • Standardize similar UIs and use fitting beans that can be configured in the faces-config to serve in each of the cases.

  • Cached entities (or lists of them) in higher layers may worsen the memory consumption and performance.

  • Avoid huge lists and objects to be cached.

  • Think about maintaining the most recent state of cached entities.

  • Restrict access to Create, Read, Update, Delete (CRUD) operations for these entities to a small, well-maintained API. When caching, strive for a consistent manner to avoid side effects or locking exceptions.

  • Usage of multiple forms on one page could lead to inconsistency.

  • Only use multiple forms on one page if both forms are distinct semantically and lead to independent navigation paths.

  • Consider where to store JSF View state information.

    The specification and implementation provide client-side saving and server-side saving.

    In case of views with a huge number of UI components, server-side state saving should be considered. In this way, the communication traffic is reduced as the view state is not propagated back to the client. For more information, see JSF 1.2 Specification section 7.6.2 State Saving Alternatives and Implications.