Data Model Rule Placement: Guidance when the reuse potential is unclear [LSA Data Excellence]
Where to put a class when you don't know how reusable it is and be able to adapt when more is known
Your Client subject matter experts can often provide the best indication on how reusable something is. It is common for a Data Class in isolation to be quite reusable, but some of its features to be more application-specific and reside in application-level Rulesets.
Avoid cluttering the enterprise layer with application-specific classes "just in case we need to re-use it one day". Seek guidance from your Client SMEs if it is unclear.
Should you have gone live with an application-specific class later found to be a reuse candidate:
- Create the intended superclass in an alternate Ruleset available from the reuse layer;
- Configure direct-inheritance so that the new class is a superclass of the existing class; then
- Use the "Move Rules" refactoring wizard to move rules to apply to the new superclass in the more generic Ruleset.
Usages of the existing class should be unaffected as Rule Resolution will find the same rules it found before the refactoring, this time via inheritance. Now though, the incumbent behavior has been made available for reuse.
Discussion on this topic was sought from the LSA Data Excellence (Pega 8.4) webinar conducted in July 2020. The webinar and its full set of discussions that arose from it are available at LSA Data Excellence: Webinar, Questions & Answers.