Portlet Factory, Version 6.1.2


 

Choosing a method implementation: LJO or Method builder?

WebSphere Portlet Factory Designer provides you with two ways to implement logic in Java in your models. You can use a linked Java object builder call or you can use a method builder call. The linked Java object adds the public methods of a Java class to your model, while the Method builder adds one Java method to your model. A general rule of thumb is to implement small, simple methods (processing pages, calling model actions, and so on) with the Method builder and use an LJO for larger, more complex methods.

 

When to use a linked Java object

Use a linked Java object builder call to re-use an existing Java class or if you anticipate the methods that you will be writing for the current model will be re-usable by other models. Also, use a linked Java object to implement if you want to take advantage of the code development features of a full IDE when writing more complex methods.

 

When to use the Method builder

Use a Method builder call to implement methods that provide model-specific functionality such as displaying pages, setting variable values, invoking service calls, and so on. Also, use a method builder if you want to profile various elements of the method, such as arguments or even the code for the method.

Parent topic: Writing methods


Library | Support |