This presentation is part of the Advanced UI Techniques Self-Study Course.
As with many rules in PRPC, there are multiple ways of maximizing reuse in harnesses, sections, and flow actions. The most obvious way of achieving optimum reuse is by placing the rule in the appropriate location within your class structure.
By building HTML form rules to display common embedded content in the Work- part of the class structure, it can be re-used across all work object types. However, the limitation is that you must fully qualify the path of the embedded property.
By building the HTML form rule in the same class as the property, you inherently achieve reuse. You can use this rule to display any property of any type of this class. The benefits of doing this are that you…
- Do not have to fully qualify the references to the properties
- Can display data elements without the need for detailed work object property structures
- Are allowing for quick development at the start of a project
- Achieve a consistent display of data across the application
For instance, if a section rule has been defined in the Work- part of our class structure and displays address details, you must fully qualify the path to each individual property relative to the work object. Although this functionality will work, it can only be used to display an address when the address is part of a page property named Address, and the section rule that this property is defined on has limited reusability.
Looking at the same section rule defined within the Data-Address-Postal class, you only need to put references relative to the class you are currently in, which allows for the use of this form wherever an address is to be displayed. Therefore, a work object can display two addresses, which relate to two different address properties on our work object, but can use the same section rule to display both.