Think of a shared kitchen. A framework is the drawer labels. The kitchen still works without them, right up until you hire a second chef.
Every enterprise org I have worked in had a coding framework. A few were chosen. Most piled up, one delivery partner’s house style over the last. I now work in an org with 100+ developers across multiple teams and vendors, sharing a monorepo of more than 20,000 components. The framework holding it together is about ten base classes, a wiki page and a review checklist.
The usual argument for a framework is that it saves time, and I think that undersells it. What a framework buys is consistency: code with the same shape wherever you open it, so anyone can read work they did not write. That is what lets a hundred developers behave like one team. It is also why the payback is easy to miss, because consistency is worth very little on the first feature and a great deal on the hundredth.
What a framework is made of
A framework has three parts: base classes, conventions and enforcement. The base classes are the part you can draw. In the framework I work with, they include a trigger handler, a selector base, a unit of work, an async worker and a mocking utility, among others. Which classes you have matters much less than everyone using the same ones.
The conventions say when each class is used and what the classes built on it are called. Consistency means the same shape for the same problem, and the code inside each class can differ as much as the problems do. A request can arrive from a Lightning Web Component controller, a Flow action, a batch job or a trigger. Wherever it arrives, it passes through the same layers: an entry point, a service, a selector for reads and a unit of work for writes.
The enforcement is the lint rules and the review checklist that notice when someone has not followed the conventions. Each part leans on the other two. Base classes without conventions become optional, conventions without enforcement become folklore, and enforcement without base classes is a list of things nobody has a good way to do.
Where the classes meet
Each base class is easy to justify on its own, which is how many orgs end up with two or three and wonder why the framework feels like overhead. The value sits where the layers meet, as in this example from the framework I work with.
A Case is inserted. The trigger hands it to a handler, which runs the modules (our name for trigger actions) registered for Case in a fixed order, all sharing one unit of work. One module needs a related record that may not exist locally yet, so it asks a selector. The record lives in an external system, and a callout from inside a trigger is off the table. So the module registers an async worker on the unit of work and finishes.
After the commit, the worker runs and hands off to a service. The service reads through selectors, calls the integration, and registers the returned records on its own unit of work. That commit updates the Case, the trigger fires again, and recursion control skips the records whose fields have not changed since the first pass.
Now count the joins. The module issued no DML (Data Manipulation Language) and read only through a selector, so with the selector stubbed it can be tested in memory. The unit of work sends every write through one database wrapper, so a single mock captures all of them for the test to check. The async worker got retries on record-lock failures and a limit on chain depth from its base class.
Take away the database wrapper and the mock has nothing to hold. Take away recursion control and the worker’s commit reruns every module. None of that belongs to a single layer, which is why half a framework costs the whole learning curve and returns a fraction of the value. It also means the return depends on the framework being complete, and staying complete, for years.
That walk-through looks complicated, and the first time you read it, it is. The payback comes the hundredth time, when a different developer has written the same flow the same way and you can follow it without reading every line. It pays out again on every feature after that.
Why the return comes late
The cost of a framework arrives first. The first feature built on it is slower than the same feature built freehand, because someone has to learn the layers. The fiftieth is faster, because the layers are already there. By the hundredth, the org without a framework has a codebase people are reluctant to touch, and every change starts with someone asking whether it is safe to make.
Every year a codebase without a framework collects habits: a partner’s trigger pattern here, a contractor’s error handling there. Each is cheap to write and expensive forever after, because every reader has to work out which one they are looking at. A framework does not stop a codebase growing. It stops the number of ways to read it growing with it.
Coding agents raise the price of those habits. An agent works out how things are done in a codebase by reading it, and in a codebase with a pattern per team it has to guess. Consistency always made code cheaper to review, and with agents writing a growing share of it, consistency also makes code cheaper to produce. The kitchen now has a chef who forgets where everything is at the start of every shift, and the drawer labels are all it has to go on.
None of this shows up in the sprint where a framework is funded, which is one reason frameworks so often get funded late, after the habits have set.
Changing the pattern at a hundred developers
I will leave aside orgs that build almost everything in configuration. That is a different argument. For an org that writes Apex at scale, the hardest thing about a framework is changing one.
Consistency locks in whatever pattern you started with, which is fine until the pattern needs to change. Apex API version 67.0 is a good example, because classes saved at 67.0 run database operations in user mode, so the running user’s permissions and sharing apply. A framework can absorb that change in a handful of base classes; that’s the easy part! Rolling the change out to a hundred developers across several teams and vendors takes coordination, buy-in and time. Until it lands, every new class faithfully copies the old behaviour.
Strict rules also cost goodwill. A good developer who can see a better way, and is told the convention says otherwise, either complies and resents it or routes around it. With a hundred developers, enough of them route around it that the exceptions become a second, undocumented framework living inside the first. A framework change pushed out without buy-in gets exactly the same treatment.
What it looks like on a Tuesday
For the delivery team, the first difference is that nobody argues about structure in review. The ticket describes a behaviour and the framework says where each part goes. The pull request is a service method, a selector method, possibly a module and a test, in files a reviewer can name before opening them. Review checks whether the code follows the conventions and whether it works. Taste mostly stays out of it, which is the only kind of review I have seen survive a hundred developers.
The test is where the framework pays the delivery team directly. Because reads go through a selector and writes go through the unit of work, a test can swap both for mocks. The service then runs without a single record touching the database, so the test runs in seconds.
A coding agent on a ticket gets the same benefit. In a consistent codebase it finds the selector, extends the service and writes the test the reviewer expects, because there is only one shape to find. In a codebase with a pattern per team it picks one, often whichever it read last, and the review becomes an argument about which pattern it should have used.
Keeping all of this consistent at a hundred developers comes down to who checks what. In the org I work in, the rules a machine can check are automated, for example no SOQL (Salesforce Object Query Language) outside a selector. Each rule is a deterministic lint rule, flagged before a human opens the pull request.
The rules a machine cannot check, such as business logic belonging in a service, go on a short review checklist. Those are also the rules an AI reviewer handles well. Given the conventions as context, a model flags logic in a controller on every pull request without tiring on its sixth review. The human reviewer then starts from its findings. That is the tiered floor from Fires, rust and dust, with an AI first pass in front of the human reviewer.
Exceptions still happen. A developer who needs a raw query for performance writes the reason in the pull request, and the framework owner decides within a day. Without that path the exceptions happen anyway and nobody writes them down. All of which assumes the framework has an owner, and in plenty of orgs it does not.
Who keeps the labels
Drawer labels go stale when keeping them current is nobody’s job. The frameworks I have seen rot were mostly the ones that had no commitment or team to keep them current. They existed because the codebase needed them, then fell behind the platform. Teams routed around the stale parts, and the “framework way” and the “fast way” ended up living side by side. Eventually the rot got blamed on the platform.
So my recommendation, to the architect and to the tech leads who live with the result, is to treat the framework as a product. An established library such as fflib or Trigger Actions Framework gives you a pattern to start from, and the org still has to own it. Owning it means a named owner, whether a person or a governance team, a small standing allocation of time, and one place where changes to the pattern get decided. Put a lead from each team and vendor in that room, so the buy-in arrives with the decision.
A change to the pattern then rolls out the way any convention should. It is published with one worked example, enforced on new code first, and picked up by old code as teams touch it, so nobody launches a rewrite. Coding agents make the last step cheaper than it used to be. Rewriting a few hundred classes to a new convention is mechanical work they do well, and the reviewer already knows what the result should look like.
A hundred chefs, one kitchen
To see where your own framework stands, take the last ten merged pull requests. Write down which layer each new or changed Apex class belongs to, in whatever terms your framework uses. Anything you cannot place in under a minute is a gap in the framework or a gap in its enforcement. If nobody can name the framework’s owner, you have found the first gap, and probably the cause of the rest.
The second chef was always coming. In a large org it is a hundred of them, from several vendors, plus a coding agent. They cook like one team when the drawer labels are clear, checked and kept current.