Posted: 26 Apr 2018 13:27 EDT Last activity: 5 Dec 2018 1:41 EST
Choosing between Work Classes and Data Classes
We have several data grids in our application pertaining to different data objects such as Insurance, Insurance Owner, Insurance Location.
Current scope of development only includes getting the data for these from external systems and displaying them as grids.
But in future, there is a possibility to create processes for few of these.
Do we create these objects and their attributes in the Data Class or Work Class from futuristic point of view.
If we go ahead with all data classes, how do we create cases and do processing on these objects in future.
You must create the Data properties in Data classes only for re-usability purpose and to separate it from the work classes.
You can refer the Data properties from work classes using Page, PageList, PageGroup properties and using Data pages and you can use them in work classes so that you can separate the Data from the process.
The approach is simple, pega has given Data Classes for the purpose of reusability. Whatever the properties you want to Reuse in your entire application(that is in different case types) you can simply refer those from the Data classes. Thing is you need to use Complex Property types like SinglePage, PageList or PageGroup property types in order to refer and reuse the properties from Data Class to Work Class.
Ex: I have 3 Properties named: FirstName, LastName, Age in "XXX-YY-Data-PersonalDetails" class.
I want to reuse the same properties from Data-PersonalDetails class into Work-ClaimRequest, Work-OrderRequest or any WorkType(Work Classes) using SinglePage or PageList properties. These PageList or SinglePage properties should be created in respective Work Classes. You can create once and reuse multiple times anywhere.