Skip to main content

Implementing an effective data model

4 Tasks

45 mins

Visible to: All users
Advanced Pega Platform 8.8 English
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Scenario

Imagine that the Booking team is still in the design phase of their project; no development occurs. The Booking team’s first task is to review the current set of enterprise-level data classes developed by the FSG Center of Excellence (COE) team. This task aims to see which data classes the Booking team can reuse in their design. During their analysis, the Booking team is likely to discover data classes that the FSG COE team has not defined. The Booking team must then decide whether those undefined data classes are worthy of being defined at the enterprise level or, instead, be owned by the Booking team.

The following table provides the credentials you need to complete the challenge.

Role User name Password
Administrator COE@FSG rules
Administrator Admin@FSGPricingTest rules
Administrator Admin@Booking rules

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Analyze FSG Center of Excellence data model

After logging in as Admin@FSGPricingTest and COE@FSG, you notice a pattern. The classes shown in each application’s Data Types view are the ones that the application owns. The application is primarily responsible for testing, maintaining, and defining how to package and deploy those data types.

Application / Operator

Data Types Owned

Test-Only Data Types

Comment

FSGPricingTest

Admin@FSGPricingTest

(FSG-Data-)

Price, Priceable, Pricing, PricingInit, PricingPropertySource, PricingSummary

(FSG-PricingTest-Data-)

PricingDisplay

The FSGPricingTest application serves four purposes:

  1. Product rule creates the CustomerData schema tables for the Pricing component
  2. Includes the Pricing component in its Application rule. The Product rule also includes the component
  3. Tests the Pricing component
  4. Demonstrates how to use the Pricing component within an application

FSG

COE@FSG

(FSG-Data-)

Address, Contact, Hotel, Location, Venue

N/A

The FSG application contains organizational or enterprise layer classes. These classes describe the structure of objects that are shared by multiple applications within the organization. Objects are typically identified with nouns, and they represent “Persons," "Places," or "Things."

  • Business applications leverage standardized data classes that define Persons and Places.
  • Every other data type owned by the FSG application is either a Person (Contact) or has something to do with a Place (Address, Location, Hotel, Venue).

FSGEmail

COE@FSG

None

N/A

  • The FSGEmail application does not define any data types.
  • The FSGEmail application defines a relevant record for the Work- WhenToSendEmail property.
  • FSG cannot define a Relevant Record applied to Work-, so it  defined one that is applied to the FSG-Email-Work-Email class.

From the FSG application, the Booking team reuses the Persons and Places classes; to not do so cannot be justified.

Use configuration sets or application settings to maintain constants

The first stage in the Booking application involves quoting the price to a customer (Contact) to host an event at a certain location. The Booking application can reuse the data types owned by the FSGPricingTest application. There is a test-only data type named PricingDisplay that is defined by the FSGPricingTest application; this a clue that the Booking application must define its own PricingDisplay class.

2 Analyze the Booking team’s data model

The Booking team considered using categorizable Application Settings. The Booking team likes how the FSG COE’s solution supports dotted-path syntax to a property with a data type other than text.

For the Booking application specifically, the Booking team likes how the FSG COE modeled an example event quoting screen where a PricingDisplay data type was utilized. The Pricing component supports a PricingDisplayPage page name parameter within three data transforms: Work- WorkRecalculatePrices, @baseclass RecalculatePrices, and FSG-Data-Pricing Recalculate. The capability is there; the Booking Team might as well use it. Doing so saves the time and effort spent building that functionality themselves.

The Booking team has created a table like the one used to analyze and review the FSG COE’s data model. The Test-Only Data Types column is repurposed as a New Data Types where ownership is undecided column.

Application / Operator

Data Types Owned / Shared

New Data Types where ownership is undecided

Comment

Booking

Admin@Booking

(FSG-Booking-Data-)

PricingDisplay


EventVenue  (concrete)

Event

The Booking application quotes a customer’s event and the start and end dates. Subcases are spun off as required. Those subcases must not be spun off immediately; each waits until the appropriate time before the event.

Hotel / HotelProxy

Admin@HotelDevOnly

(FSG-Data-Hotel-)

RoomsRequest

 

The Hotel application must communicate with a separate HotelProxy application for various reasons. The two applications are hosted on different databases. The HotelProxy application does not need access to code other than its own and FSG. The Hotel application needs access to FSGEmail.

Weather Forecast

Admin@Booking

(FSG-WForecast-Data-)

Weather, Precipitation, Forecast

 

The Weather Forecast application aims to forecast the weather ahead of an event and then assist with whether preparation must occur due to a likely probability of rain.

Parking

Admin@Booking

(FSG-Parking-Data-)

ParkingLot, ParkingGarage

ParkingLocation

The Parking application aims to record the number of cars parked within each selected parking lot or garage close to an event venue’s location.

The Booking team’s BookEvent case needs to capture information about an event, such as its start and end date.  Hosting an event is core to FSG’s business model, yet the Booking application’s BookEvent case is the only place, so far, where an Event data type is used.

The Booking team can extend the COE-owned FSG-Data-Hotel class for its Hotel application but does not see an immediate need to do so.

The Hotel application and Hotel Proxy application communicate by using the RESTful Pega API. For various reasons such as application size, security, and ease of maintenance, the Hotel Proxy application is not built on the Hotel application. Either a RoomsRequest data type must be defined at the FSG COE level for both applications to inherit. The Hotel and Hotel Proxy applications must use another mechanism to share the class. However, it is necessary to share the REST integration classes that both applications use. The logical conclusion was to build a component to house the shared classes and related code.

The COE has not defined a set of data types related to weather forecasting. So, the Booking team must decide whether its Weather Forecast application owns those data types. Weather forecasting is not essential to FSG’s business model. Should other applications use the same weather forecasting data types but disregard weather preparation? What impact is there if the code to perform both are packaged together? The assumption is the weather forecasting code is lightweight.

The Parking application deals with different types of locations, such as a parking lot or garage. Attendees attending an event and wanting to park nearby would want to view their choices where to park on a map.

A Shuttle application can handle any location, whether a venue, hotel, or where cars are parked. This knowledge reinforces the notion that FSG COE must define a ParkingLocation class. The Booking team can directly inherit, or pattern inherit, that class as needed.

Finally, a Shuttle application requires data types that are related to shuttle trips. The Booking team can define its data types, but can other applications leverage an abstraction of those Data Types such as Trip, Vehicle, and Company?

3 Decide who owns undecided data types

Hosting an event is central to FSG’s line of business. The potential exists for other applications within FSG, such as Billing and Advertising, to use the same data type definition. As time goes on, other applications can add properties to FSG-Data-Event. A customer might contact a Booking Team member to ask how an event hosting is billed. Property-Read ABAC security can be applied to mask information that only Billing Team members should be allowed to view. The Booking team member can relay the information that the team member can see and then refer the customer to the Billing team if the customer wants detailed information.

A best practice is to standardize the definitions for Persons and Places across an enterprise. It makes sense that the FSG COE maintains the core definitions for classes that extend FSG-Data-Location. One reason for doing so is that Locations are stored in the same CustomerData schema table. When it is built, the Shuttle application must define a Trip as taking place in any two Locations regardless of the type of Location. Best to let the FSG COE take ownership of a ParkingLocation class.

The following table records the decisions made regarding the original set of undefined Data Types.

Application

New data types where ownership is undecided

Should be owned by FSG COE?

Booking

Event

Yes

Parking

ParkingLocation

Yes

Shuttle

Trip, Vehicle, Company

TBD

It is unknown when the Shuttle application is due for construction. The Booking team can certainly benefit if  FSG COE designs an abstract data model where any Vehicle with a limited capacity makes Trips between two Locations. In all likelihood, the Company that owns the Vehicle is not FSG. FSG does not want its employees to become full-time shuttle dispatchers. Instead, FSG wants to automate decision-making as much as possible. For example, the system runs by itself unattended. Over-reliance on stale data could lead to a “garbage in = garbage out” situation. The solution must be capable of accepting data in real-time and making decisions in real-time.

4 Complete the following assignments

Sketch out the data model for a shuttle application. The data model's definition here includes the data model for each case type, not just Data- class-extending data types.

For each data model class show:

  • The full class name and what class is extended
  • Whether the class is abstract or concrete
    • If concrete, the class shows the schema in which instances are persisted
  • Properties used for data relationships
    • Say embedded or, if a reference. add Ref to the property name
    • Say list if something is a list
  • Critical scalar properties
Note: An Interaction Diagram may help to gain a better perspective of the problem domain, especially the timing of inputs received by the system.


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice