D'fflib
The framework that truly enables Apex developers and AI agents to deliver scalable, maintainable and testable Salesforce functionalities. Extending the fflib (apex-common) framework, with redesigns, shortcuts, accelerators and adopting latest Salesforce features. To simplify usage and adoption for a better developer experience, while improving performance.
Why every project should adopt D'fflib
Regardless of already having fflib or not, when properly adopted, D'fflib significantly enhances your Salesforce development process.
Faster bugfixes, handovers and onboarding as developers more easily understand and navigate others’ code.
Well-structured, consistently organised code means AI tools need less context to understand your codebase, reducing token usage. Combined with full documentation and ready-to-apply AI skills, your team gets faster and more accurate first-time-right AI assistance.
Accelerators and frameworks prevent reinventing the wheel, while automatically applying industry standards and best-practices.
Database interactions can become 14x faster, and mocked unit tests can shave off 40–60% on your deployment time.
Install and update in only a couple minutes via the single unlocked package link. Actively maintained by its open-source community. No vendor lock-in, IP friction or abandonment risk.
Continue on the proven fflib, embraced by Salesforce since 2014 and applied on thousands of projects. Now extended to focus on enabling and accelerating your developers (better developer experience).
Applying Apex Enterprise Design Patterns (EDP) to structure code, realising maintainable and scalable solutions, while having security-compliant functionality one function away.
Where fflib focuses on theoretically optimal EDP, D'fflib focuses on developer acceleration, standardising cross-layer features, providing shortcuts to eliminate duplicate boilerplate and making the framework easier to learn.
Framework natively supports most Database query and DML methods, redesigned for better performance (14x faster Unit of Work) and more standardised developer control. See the “What” section below.
The framework’s consistent structure gives AI tools clear, unambiguous context. Full documentation and a set of AI skills will strengthen your AI responses, enabling faster and more accurate responses.
Install or upgrade within minutes, no classes needed in project codebase. One package including fflib-apex-common, fflib-apex-mocks, an out-of-the-box trigger handler and test factory builder framework.
Last update: November 16th 2026
What you'll get
One unlocked package. The proven from fflib,
significantly simplified, extended and faster to truly enable developers.
Mappings moved from Application class to metadata. Directly available, packaging-ready, eliminating merge and compilation conflicts.
defineMock() replaces 2–3 lines per mock to one single declaration.Simplifying framework adoption by aligning cross-layer signatures, like mocking and setting sharing context for Unit of Work and selectors.
Input validation, Collection utils and common Exception classes.
Faster and more reliable unit tests as you can finally (properly) assert selector methods, while eliminating the execution of the query.
Structure to enable bulkified and untangled handlers. Including automatic transaction management with a centralised unit of work.
Flexibly and centrally initiate all test data per SObject. Supporting to mock complex parent-child relations, formula and read-only fields.
Full adoption of recent Salesforce functionalities:
- Aggregate results & SOQL functions (
DISTANCE,FOR,GROUP BY) Databasemethods like Cursors, QueryLocator- SaveResults and DML Operations like Immediate, Approvals, Emails and Events
Let calling classes define sharing and security context (Mode), enabling method reuse, eliminating project customisations (WithoutSharing inner classes) and standardising database interactions across Selectors and Unit of Work.
How to adopt D'fflib
Install the framework, set up an adoption plan, and enable your team.
Find and click your relevant guide below, or → visit Getting started article.
Success stands or falls with a feasible, concrete and conscious plan regarding framework adoption. Read on suggestions and lessons learned for a phased adoption.
Upgrade guide to unlock latest features safely and quickly.
Developers should be enabled and empowered in their journey.
Plan learning, support and championship consciously.
Find layer-specific deep-dives including examples and reasoning. Enabling developers at their own pace with reference materials.
Consistency is what matters most and no golden set of conventions exists. Find a starting point for naming conventions, collection efficiencies and other coding standards.
Support
Practical support to accelerate your team's adoption, usage and ROI.
Challenged with no or fewer expected benefits? Or interested in potential benefits? A (D')fflib assessment provides clear maturity insights, value potential and a concrete phased adoption recommendation.
Challenged with team enablement? Trainings can lay the foundation, sharpen weak spots so developers really understand instead of blindly copy-pasting. Location and content can be tailored to your needs.
Easily reach out for support by requesting features, reporting bugs, or starting discussions. The framework is open-source, so check our Contribution guide to create your own pull requests.