Summarizing the implementation of the compliance framework

Using an Apex Interface and the Factory pattern, a framework has been put into place within the application to ensure that the compliance logic is implemented consistently, and this is a simple matter of implementing the Domain class interface and placing the generic Lightning component on each Lightning page in order to enable the feature for other objects in the future.

As this has been implemented as a service, it can easily be reused from a Batch Apex or Scheduled context as well.

The following screenshot shows the Compliance Checker Lightning Component within the Lightning App Builder tool being placed on the Driver page:

The following screenshot shows the Compliance Checker component on the Driver page. In Lightning Experience, there is no button; the component is embedded in the page and reacts to the field updates the user makes. So, the verification is performed immediately:

Salesforce Classic is an older user interface technology that has now been superseded by Lightning (as shown in the preceding screenshot). The following screenshots are useful if you are still working with Salesforce Classic with some of your customers and/or in your own organization. The following illustrates the Verify Compliance button on the Driver object. Ensure that the FIA Super License field is unchecked before clicking on the button:

The following errors should be displayed:

The following screenshot shows the Verify Compliance button on the Car object:

The following errors are shown by the generic controller defined/created previously:

Now that we have seen how the Domain layer is applied to an application, in the next section, we will understand how to write tests for the Domain layer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.166.98