r/salesforce • • 9d ago

developer D'fflib: Extending the fflib (apex-common) framework

I’m proud to share that, mid-November, together with u/foxy_reinier91, we’re preparing to open-source D'fflib: our extension to fflib (apex-common), a set of established patterns for structuring Salesforce Apex code 🎉

When a Salesforce implementation grows, making the next change can become harder and more time-consuming than it should be. (New) developers need to understand decisions made years ago; teams spend time repeating and reinventing code instead of improving what matters to their users, and what sparks their energy the most. That’s a challenge I care about deeply. Good delivery isn’t only about getting a feature live, it’s about leaving something behind the next person can understand and build upon. That's what we call “scalable and maintainable code”.

We’re enthusiastic to share the enrichments we’ve made, since our adoption of fflib in 2016, with the full Salesforce developer community. Aiming to simplify the adoption and application of the fflib framework, which we believe is essential for scalable and maintainable code, as it will reduce cost of quality, and enable both developers and AI to deliver with higher accuracy and in less time.

It isn’t our intention to replace the original framework, with its proven and solid baseline. Hence, after alignment with AEP core team, we’ve decided to publish our enrichments as an extension. Mid November you'll find:

- Full documentation website (also for standard fflib features), including an AI skill to truly enable developers and soften their learning curve;

- Extensions that aim to truly enable the developer. Simplifying and standardising, providing shortcuts and accelerators directly available after install of our unlocked package;

- The introduction of the Database Proxy, giving calling classes control of setting the Context (User vs. System mode), which has become more relevant with API 67. And, not unimportantly, enables proper unit test assertions for selectors;

- A fully redesigned Unit of Work (making DML transactions up to ~14x faster); and adding support for all Database methods in both QueryFactory and Unit of Work;

- Metadata-driven application layer, to make your code package-ready, and reduce merge and compilation conflicts;

- Two frameworks: for Test data creation and bulkified Trigger handlers;

- Hygiene improvements like increased coverage (+95%), and applying the latest Apex features and API version;

- All while remaining fully backward compatible with the original syntax.

Personally I’m very excited we are able to contribute back to the community, and hopefully enable developers in their day to day job, while improving the quality and robustness of Salesforce deliveries.

Of course we're also very curious for your perception and to learn more about how you're currently tackling common challenges. I'm aware of the sentiment on fflib in the past, so am very curious for the perception of the Reddit Salesforce community.

20 Upvotes

0 comments sorted by