Class Structure
Class Structure
In Pega, the class structure is a fundamental aspect of application design, as it defines how data
and rules are organized within the system. The class structure in Pega is hierarchical and is built
using inheritance, allowing for reusability and scalability.
Class is like a blueprint that defines how different parts of an application should work and what
data they should manage. It organizes related rules and data, making it easier to build and
maintain the application.
OR
a Class is a way to organize and define how certain parts of your application work and what data
they should handle. It helps in structuring the application, making it easier to manage and reuse
components.
1.Abstract Class
2.Concrete Class
Class Types:
Work Class:
o Represents the core business process or case.
o All work items or cases are instances of work classes.
o Example: MyApp-Work-Order, where Order is a case type.
Data Class:
o Used to define reusable data objects or entities.
o Typically stores information that supports work classes but doesn’t represent a
case itself.
o Example: MyApp-Data-Customer, where Customer holds customer-related data.
Integration Class:
o Manages interactions with external systems.
o Usually corresponds to data models used for integrations like SOAP, REST
services.
o Example: MyApp-Int-ERP, where ERP is the external system.
Rule Class:
o Defines the rules and logic for processing data and managing cases.
o Examples include rule types like activities, decision tables, and when rules.
Importance of Class:
Any Pega Rules we create & execute/Compile can be done only under a class. only under
classes we can create rules & execute the rules.
User Defined Classes: Organization Names, Application Name/Division, Unit Name ( Work,
Data, Int) it will generate user-defined Classes
Class Structure & Inheritance
In Pega, the Division (Div) Layer and Unit Layer are part of the organizational class structure
that appears in the Implementation application class structure. These layers help in organizing
and managing rules, data, and processes within different parts of a large organization.
The Division (Div) and Unit layers are not typically present in the Framework application class
structure because the framework layer is designed to be a reusable and generic foundation that
can be applied across multiple implementations, divisions, and units.
Scalability: As the organization grows, new divisions or units can be added easily, with
their specific rules organized in their respective layers.
Maintainability: Changes can be made at the division or unit level without affecting the
entire organization, making maintenance easier and less risky.
Inheritance:
Inheritance in Pega refers to the ability of one rule to use or extend the functionality of another
rule. Pega uses inheritance to promote reuse, simplify development, and manage changes across
applications. There are two main types of inheritance in Pega
1.Pattern
2.direct
Directed Inheritance:
Directed inheritance refers to explicitly specifying a parent class from which a rule or class can
inherit. This type of inheritance allows you to reuse rules defined in other classes by directly
inheriting them.
Example: If Class A is specified as the directed parent of Class B, then Class B can use
the rules defined in Class A.
Pattern Inheritance
Pattern inheritance follows the hierarchical structure of class names, where classes inherit rules
from their immediate parent classes based on the naming pattern.
Example: If you have a class named MyCo-LoanApp-Work-AutoLoan, Pega will look
for rules in the following order:
o MyCo-LoanApp-Work-AutoLoan
o MyCo-LoanApp-Work
o MyCo-LoanApp
o MyCo
o @baseclass (a built-in Pega class that all classes ultimately inherit from)
Class Structure & Inheritance
If the rule is not found in the pattern inheritance path, Pega then checks the
directed inheritance path, which could be a completely different class structure
specified by the developer.
Key Points About Inheritance in Pega:
Reuse: Inheritance allows for the reuse of rules across different classes, reducing
redundancy and improving maintainability.
Flexibility: By combining pattern and directed inheritance, Pega provides flexibility in
how rules are shared and overridden across an application.
Class Structure & Inheritance