Question
CNO
US
Last activity: 18 Jan 2019 15:32 EST
Circumstancing vs Pattern inheritance
Please suggest when to use circumstancing vs pattern inheritance
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
Unfortunately, the answer tends to be "it depends". Basically, the determining factor is the scope of any difference.
If there are relatively few differentiating criteria, but they apply to a significant number of rules, class specialization is a better approach. For example, if each specialization impacts ~50 rules, having a dedicated class for each specialization simplifies application maintenance and organization.
If there are a lot of differentiating criteria, but they impact a small number of rules, then circumstancing is a better approach. For example, specializing a single email for account type, country, and state/province represents potentially ~200 differentiating criteria, but these criteria affect only the correspondence rule. Creating ~200 classes with one rule each would be over-engineering the solution.
So, if the correspondence is the main point of difference, then creating multiple classes for the small number of rules introduces a significant amount of overhead to manage the various rules in the application. In this case, the correspondence sent to the customer can be circumstanced on three variables: country, state/province, and account type. (Circumstancing is often thought of as managing "edge cases", but in a situation like this, that can be misleading - there's a lot of "edge" and not much of a middle.)
Unfortunately, the answer tends to be "it depends". Basically, the determining factor is the scope of any difference.
If there are relatively few differentiating criteria, but they apply to a significant number of rules, class specialization is a better approach. For example, if each specialization impacts ~50 rules, having a dedicated class for each specialization simplifies application maintenance and organization.
If there are a lot of differentiating criteria, but they impact a small number of rules, then circumstancing is a better approach. For example, specializing a single email for account type, country, and state/province represents potentially ~200 differentiating criteria, but these criteria affect only the correspondence rule. Creating ~200 classes with one rule each would be over-engineering the solution.
So, if the correspondence is the main point of difference, then creating multiple classes for the small number of rules introduces a significant amount of overhead to manage the various rules in the application. In this case, the correspondence sent to the customer can be circumstanced on three variables: country, state/province, and account type. (Circumstancing is often thought of as managing "edge cases", but in a situation like this, that can be misleading - there's a lot of "edge" and not much of a middle.)
If there are significant differences in the account opening process itself - different processes to run, different data to collect and present to users, and different decision-making conditions and results - between account types, then the overhead of class specialization is justified by the need to manage all of the different rules, so class specialization is the better strategy.
And remember that you can combine the two - this isn't an either/or situation. For example, you could create a case type for opening a cash account (checking, savings), and another for investment accounts. Then, you could create a base correspondence rule for each case type, and circumstance each one separately based on location.
Pegasystems Inc.
US
Circumstancing is useful when you want a particular rule to execute based on a property or date. For example, you may have versions of a particular rule that differ based on the region.
CNO
US
Thank you. Let's consider the scenario where you have to circumstance 20 rules based on same property rule and value. We should go for class specialization or circumstancing?
Pegasystems Inc.
IN
Hi,
Circumstances allow you to specialize a rule based on a property and/or a date. Keep in mind that circumstance resolution occurs after Class and RuleSet resolution.
-
Spriha Jha Raghavender Reddy Lankapothu
CNO
US
Please consider an example
Asset-Derivatives - Contains all the existing rules. The new requirement is to have specialization for Future and Option type of Security. This can be achieved using Security type property circumstancing, or we can use class specialization Asset-Derivatives-Option and Asset-Derivatives-Future.
Please comment which approach better fits?
-
Moses Alexander Arelly
Pegasystems Inc.
IN
Hi,
I think achieving using Security type property circumstancing is better.
Thanks.
CNO
US
In terms of code reusability and maintenance I feel circumstance is not developer friendly. What do you think?
PS : purpose of this discussion is to get pros and cons of both the method
Accepted Solution
Pegasystems Inc.
US
Unfortunately, the answer tends to be "it depends". Basically, the determining factor is the scope of any difference.
If there are relatively few differentiating criteria, but they apply to a significant number of rules, class specialization is a better approach. For example, if each specialization impacts ~50 rules, having a dedicated class for each specialization simplifies application maintenance and organization.
If there are a lot of differentiating criteria, but they impact a small number of rules, then circumstancing is a better approach. For example, specializing a single email for account type, country, and state/province represents potentially ~200 differentiating criteria, but these criteria affect only the correspondence rule. Creating ~200 classes with one rule each would be over-engineering the solution.
So, if the correspondence is the main point of difference, then creating multiple classes for the small number of rules introduces a significant amount of overhead to manage the various rules in the application. In this case, the correspondence sent to the customer can be circumstanced on three variables: country, state/province, and account type. (Circumstancing is often thought of as managing "edge cases", but in a situation like this, that can be misleading - there's a lot of "edge" and not much of a middle.)
Unfortunately, the answer tends to be "it depends". Basically, the determining factor is the scope of any difference.
If there are relatively few differentiating criteria, but they apply to a significant number of rules, class specialization is a better approach. For example, if each specialization impacts ~50 rules, having a dedicated class for each specialization simplifies application maintenance and organization.
If there are a lot of differentiating criteria, but they impact a small number of rules, then circumstancing is a better approach. For example, specializing a single email for account type, country, and state/province represents potentially ~200 differentiating criteria, but these criteria affect only the correspondence rule. Creating ~200 classes with one rule each would be over-engineering the solution.
So, if the correspondence is the main point of difference, then creating multiple classes for the small number of rules introduces a significant amount of overhead to manage the various rules in the application. In this case, the correspondence sent to the customer can be circumstanced on three variables: country, state/province, and account type. (Circumstancing is often thought of as managing "edge cases", but in a situation like this, that can be misleading - there's a lot of "edge" and not much of a middle.)
If there are significant differences in the account opening process itself - different processes to run, different data to collect and present to users, and different decision-making conditions and results - between account types, then the overhead of class specialization is justified by the need to manage all of the different rules, so class specialization is the better strategy.
And remember that you can combine the two - this isn't an either/or situation. For example, you could create a case type for opening a cash account (checking, savings), and another for investment accounts. Then, you could create a base correspondence rule for each case type, and circumstance each one separately based on location.
-
Afzal Natheer
Pegasystems Inc.
IN
Circumstancing requires a base rule as well as a circumstanced version. Without a circumstanced version, the base rule is the only rule, but without a base rule, circumstancing won't work, because the system can't identify a fall-back candidate in the event that the circumstance isn't met.
Hence it may not be reusable friendly.
-
SnehaLatha Siruvuri