In this chapter, we have taken an in-depth look at how the platform executes Apex code and the different contexts from which it does so. We have also taken the time to understand how key concepts such as state and security are managed, in addition to highlighting some Apex governors and their respective scopes.
This has enabled us to identify some common needs, and using the principles of separation of concerns we can develop guidelines to be applied to layers in our business application code, making the Apex logic more reusable and accessible from different contexts as your application functionality and, indeed, the platform itself evolve.
As we progress further into practicing SOC, the Domain, Service, and Selector layer patterns will become a further layer of separation within our application business logic. We will continue to define the naming and coding guidelines...