Interpreting the Domain layer

In this chapter, we look at the platform's interpretation of the Domain layer pattern, one which ensures that behavior invoked both through Apex Trigger events and through direct Apex method calls (from the Service layer and other Domain classes) is considered.

Platform Event Subscriptions (via Apex Triggers) and Async Apex Triggers are specialized forms of Apex Triggers that do not directly apply to the Domain layer pattern described in this chapter. They will be covered in Chapter 11, Asynchronous Processing and Big Data Volumes.

A single Domain class can be created to encapsulate all of the behavior and will begin to leverage OOP principles, such as interfaces, to further enrich the code for reuse and Separation of Concerns, which we will explore later in this chapter.

The following diagram illustrates two consumers of the Domain layer classes—the code from the Service layer, and also direct interactions with objects resulting in Apex Trigger events, which will also be routed to the same Domain layer class:

Application development in Lightning Platform focuses heavily on objects; these objects store your application's data and protect its integrity. In this section, you can see how they are critical parts of your application regardless of whether the user is manipulating records directly or through your applications service code. This combination of managing data and behavior is something that will be explored in the next section.

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

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