Recently I had opportunities to present to the Nashville Salesforce Developers Group and Richmond Salesforce Developers Group on how to adopt the dependency injection design pattern with the force-di library, an open source project that I’m developing in collaboration with Andy Fawcett and John Daniel.
In this webinar, I explain what the dependency injection design pattern is and the kinds of problems it solves. I walk through refactoring a set of tightly coupled Apex classes and also explore how to address declarative dependencies, such as object action overrides and custom buttons. I show how you can use the force-di library to dynamically swap out their behavior too with Lightning or Visualforce components, or even Flows.
Applying the dependency injection design pattern with force-di library has profound implications for how the programmatic and declarative customizations in an org can be developed and released as separate, modular unlocked packages.
I hope you find my presentation informative and thought provoking on how you can begin architecting your applications for reuse and changing requirements.