- Class
- Inheritance
- Rule Resolution
Class - Object
‘Object’ is an instance of ‘Class’, Pega we define ‘Work Object’ as an instance of a concrete class derived from ‘Work-’ base.
Now we have to learn about the ‘Class’ concept in Pega
Types of Classes in Pega:
Abstract classes end with hyphen/dash. Instances of Abstract classes are not stored into the database. Example: ABC-
Concrete classes are used to building our application and their instances are stored in the database, these classes will not end with hyphen/dash.
Example: ABC-Work-myApp
In Pega, Inheritance is categorized into four types, they are;
Class Inheritance
Class Inheritance is a very important part of Pega. Pega has a sophisticated algorithm to search for a rule; it is named ‘Rule Resolution’.
This class inheritance helps Rule Resolution to find a required rule. Class Inheritance is again divided into two types:
Pattern Inheritance causes a class to inherit characteristics from classes that it resembles in naming, moving up the pattern class hierarchy. In Pattern Inheritance dashes/ hyphens are delimiters for pattern matching. Pattern Inheritance is optional while creating a class but if specified takes precedence.
‘Rule Resolution’ – Class Inheritance
‘Rule Resolution’ a very best algorithm used by Pega to search for a required rule, here in this topic, we discuss Rule Resolution only in the context of ‘Class Inheritance’.
Rule Resolution always looks for the rule in the class provided (current class). If it does not find the required rule them it uses the algorithm as below:
If Pattern Inheritance is used, then it precedes Directed Inheritance. For a class using Pattern Inheritance, the following (next slide) is a simplified description of the Rule Resolution algorithm.
Step 1: Search each class formed by repeatedly truncating the original class name, stopping if the required rule is found.
Step 2: If the Pattern search finishes without finding the rule, go back to the original class and use Directed Inheritance to find the parent of the original class.
Step 3: If the parent class identified in Step 2, was searched during Step 1, skip it and skip to Step 5.
Step 4: If the parent class was not previously searched, search it. Stop if the required rule is found.
Step 5: If not found, determine whether the parent class uses Pattern Inheritance, if so repeat, this the algorithm, starting at Step 1, with the parent class.
Step 6: Otherwise, Identify the parent of the parent, continue at Step 4.
To find the rule in “MyApp-Extn-Bpm”, which is derived from “Academy-App” and “MyApp-Extn-Bpm” uses pattern inheritance.
No comments:
Post a Comment