If you are a Domino developer, you are already familiar with the practice of using common design element subform in a form. If you have been a Java developer, you must have used extensions of other classes in your code.
Custom Controls are a similar new design element that was introduced along with XPages in the Domino Designer. In short, Custom Controls act as reusable subcomponents of XPages.
Some of the characteristics that define Custom Controls are:
- They are componentized parts of your application.
- They are much advanced version of subforms.
- You can use them multiple times on a single page.
- You can define parameters for custom controls.
- They can be shared across applications.
- They can be nested.
There can be different approaches for using Custom Controls in your application. The first and the most typical approach is to use them for coding parts of application that contain some logic and are used multiple times across the application. The second approach is to use them for breaking down the application user interface in parts so they can be used and changed easily across multiple pages. For example, when you are using the OneUI theme, you break down the components under different custom controls for heard, footer, left column, content, and so on .
The use of Custom Controls with XPages, can simplifies your development effort to a great extent, the sooner you start using them the better it will be. Custom Controls allow you to break up your application in small manageable parts which can be reused as part of the bigger picture. This approach is particularly beneficial if there are multiple team members working on the same application. You are also able to take advantage of other sources internal or external if you use this approach and this in turn help you gain in productivity and efficiency.
Parent topic: 4.0 Coding techniques