Types of classes and Inheritance in Pega

 Types of classes and Inheritance in Pega

In Pega, classes and inheritance in pega are fundamental concepts that help in organizing and reusing rules and data models. Here’s a detailed overview of the types of classes and inheritance mechanisms in Pega.

Inheritance in Pega
Inheritance in Pega

What is a class?

  • A class is a structural unit that encapsulates business functionalities.
  • The class is executable, and it takes a specific input to process the business transaction and generates a specific output as a result.
  • Classes are created inside an application.
  • We create an application.
  • We create classes inside an application.
  • We create functionalities inside classes.

Types of Classes in Pega

There are two main types of classes:.

1.Concrete class 

First, define the functionalities. Then, initiate the transaction by executing these functionalities. Consequently, a transaction ID is generated, and the transactions are closed here. Furthermore, we can reuse the functionalities.

2.Abstract Class 

Define the functionalities, and we can reuse the functionalities.

1. Concrete Class: A concrete class is one where business transactions can be initiated and processed.

2. Abstract Class: An abstract class is the one where we cannot initiate business transactions.

3.Work Classes

Work: The root class for all work items.

Work-Cover: This represents a cover object that groups related work items.

Workfolder: Used for organizing related work objects into folders.

4..Data Classes

Data: The root class for all data objects.

Data-Admin: Contains administrative data like operators and organization hierarchy.

Data-Party: Represents parties involved in a work item, such as customers or employees.

5.Integration Classes

Int: The root class for integration-related rules.

Int-SOAP: For SOAP web service integrations.

Int-REST: For RESTful web service integrations.

6.Rule Classes

Rule: The root class for all rule objects.

Rule-Obj: Represents specific types of rules like properties and activities.

Rule-Connect: Used for connector rules to integrate with external systems.

7. System Classes

System: Contains classes related to system-level processes.

System-Queue: Manages background processing queues.

Inheritance

Inheritance in Pega
Inheritance in Pega

It is the process of transferring the attributes and functionalities of one class into another. Here, at least two classes will be involved.

One of the two classes will act as a parent, while the other class will act as a child.

There are three types of inheritances, mainly two in pega.

1. Pattern Inheritance:

After we create the implementation application, PRPC has created many classes; out of these, the three most important are: Example: “PASH-PASHON-WORK”

  • Pattern inheritance uses the call-name pattern.
  • It can access the functionalities in the same application.

PASH-PASHON-WORK: This is 3 different classes.

1. PASH

2. PASH-PASHON (PASHON)

3.PASH-PASSION-WORK (WORK)

The “(-)” symbol represents the inheritance relationship between these two classes.

EXAMPLE :

A-B means B is a child of A.

A-B-C, where C is a child of A-B

In PRPC, the class definition is a pattern of multiple classes separated by “-” for our classes.

  1. PASH-PASHON-WORK (WORK): The parent of the work class is PASH-PASHON.
  2. The parent of PASHON is PASH.

By means of pattern inheritance, PRPC utilizes the properties of organization, division, and unit.

2. Direct Inheritance:

The parent class in direct inheritance is specified in the class rule form under the dropdown “parent class Directed” (accessing the functionalities of another application).

3.Multiple Inheritance

Pega effectively supports multiple inheritances through a combination of directed and pattern inheritance. Consequently, a class can inherit rules from multiple parent classes through these mechanisms, providing extensive flexibility in application design.
As a result, a class can inherit rules from multiple parent classes through these mechanisms, enhancing flexibility and extensibility in application design.

Example: MyCo-FW-Finance-Work-Invoice can inherit rules from both MyCo-FW-Finance-Work (pattern inheritance) and Work-Invoice (directed inheritance if explicitly set).

Practical Usage

Pega designs its class structure and inheritance mechanisms to facilitate efficient and scalable application development. Additionally, these mechanisms ensure optimal performance and flexibility throughout the development process. Consequently, this approach streamlines development processes, ensuring optimal performance and scalability.

Consequently, here are some practical examples and scenarios demonstrating how classes and inheritance are used in Pega.

Work classes typically handle the main business processes and workflows.

Data classes are used to model and handle data entities that support these processes.

Int-classes manage external integrations, ensuring smooth communication with other systems.

Rule classes define the behavior and processing logic.

By leveraging these class types and inheritance in pega , Pega enables developers to create a scalable, maintainable, and reusable application architecture, thereby fostering efficient development practices. Therefore, developers can efficiently build robust applications. Additionally, they can ensure long-term maintainability and adaptability to evolving business requirements. As a result, developers can efficiently build and manage complex applications.

1 thought on “Types of classes and Inheritance in Pega”

Leave a Comment