Wrapping Functions and Heroku APIs in Apex Service classes
In previous chapters, we learned about the Service layer as a means for developers to capture and easily discover all business logic within an application. The Function and Heroku API created in this chapter are also part of the logic of the FormulaForce application. This not only enables them to be used from other Apex code, such as LWC controller, Platform Event handlers, but also declarative building tools like Flow.
In this section, we take a deeper look at how both the Heroku /insights
API (2) and the Driver Check-in Function (6) can be exposed via Apex classes adhering to the Service layer pattern (8 and 7), just like all the other services in the application so far.
As a reminder, here is a final look at our solution overview diagram, highlighting the corresponding aspects we will be going into in further detail in this section:
Figure 8.26: Service class in the FormulaForce application
The following...