In Pega, a class is a rule of type Rule-Obj-Class. It says what kind of thing something is, and it sets the position in the inheritance tree. A class can be one of three kinds, and the third, the Class Group, is the one people find hardest to explain.
The three kinds of class
| Kind | Can it have instances? | Purpose |
|---|---|---|
| Abstract | No | Holds shared rules that other classes inherit |
| Concrete | Yes | Stores records, such as a case or a customer |
| Class Group | Yes | A concrete class that also groups related classes so they share one table |
What a Class Group does
A Class Group is a set of classes that share the same key structure. All instances of every class in the group are stored in the same database table. On the class form you tick Is a class group, and the group's name becomes the prefix of its member classes.
A worked example
A bank defines the class group Bank-Work. Its member classes are:
Bank-Work-LoanBank-Work-CreditCardBank-Work-Complaint
Because the group is mapped to one table, a loan, a card application and a complaint are all rows in that same table, told apart by the class name stored in the row. That means one table to index and back up, and a single report can list cases from all three types.
Why it matters
- Case IDs are unique across the whole group because they share the key space.
- Reporting across different case types is simple, because they live in one table.
- Storage is managed once, through the database table mapping for the group.
Tips
- Decide on class groups early. Moving classes between tables later means a data migration.
- Do not put unrelated data in one group just to save tables. Keep the key structure the same for everything in it.
- Check the database table mapping when a new member class is added.
Interview tip
Answer in one line: "A class group is a concrete class that groups classes sharing a key structure so their instances live in one table." Then give the Bank-Work example. See also the Enterprise Class Structure and the Pega Basics label.
No comments:
Post a Comment