Best practices for developing portlets using JSR 168 and WebSphere Portal V5.1
Overview
The first release of Java™ Portlet Specification, JSR 168, by the JavaCommunity Process (JCP), provides a standard for interoperability between portlets and portals. Portlets written to this portlet API can be deployed on any JSR 168compliant portal and run out-of-the-box.The portlet architecture is an extension to the Java Servlet architecture. Therefore, manyaspects of portlet development are common to typical Web application development.However, the unique aspects of a portal add complexity to the application model, such as:
•
Multiple portlets per Web page
•
Portlet URL addressing
•
Portlet page flow control
•
User interface rendering restrictions
•
Inter-portlet communicationYou need to carefully consider the design of a portlet to take advantage of portal featuresinstead of falling prey to its complexity. By following the best practices outlined in thisdocument your portlets will be portable, maintainable, and will perform optimally.This document is a collection of best practices for portlet developers who want their portlets to conform to, and to leverage the IBM® WebSphere® Portal infrastructure for,JSR 168. Divided into major categories, you can use these coding guidelines whendesigning and developing JSR 168 portlets for WebSphere Portal. It is not a primer for portlet development, because it does not address the fundamentals of portlet programming. Instead, use it as a checklist during design and code reviews to help promote consistent and quality portlet implementations.Refer to theWebSphere Portal V5.1.0.1 InfoCenter and thePortlet Development Guide
for more information on developing portlets. See also theResourceslisted at the end of this article, including references for JSR 168.
Definitions
This section covers the basic definitions you need to understand in order to program JSR 168 portlets.
Portlet entity
A portlet entity is a Java instance of a portlet parameterized with additional settings, a pattern known as the
flyweight
pattern. See
Design Pattern
Leave a Comment