DLPR - The Architecture
Most frameworks organize code by technical role - models, views, controllers. DLPR organizes code by the question it answers. Four questions, four layers, no ambiguity about where code belongs. The names are the standard ones - Data, Logic, Presentation, Routing - so nothing you learn here stays here.
Architecture is always DLPR. Every piece of code has one obvious home.
- Data
- WHERE does data come from or go? The data layer holds things and keeps them valid. It doesn't make policy.
- Logic
- WHAT do we do with the data? This is where decisions are made. The buck stops here.
- Presentation
- HOW do we deliver results? Formatting only. No judgment calls.
- Routing
- WHY is this code running? A request arrived. Routing is purpose meeting execution.
"The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise."
The flow
Every request enters through Routing. Routing calls Logic. Logic calls Data. The result travels back up to Routing, which calls Presentation as needed - or delivers the response directly. There are no entry points to any other layer. Routing is the front door.
The decision test
If you can't immediately say which layer a piece of code belongs in, the code is doing too much. DLPR doesn't just organize - it exposes complexity that shouldn't exist. Every boundary violation is a signal that something needs to be decomposed.
Shallow, not flat
Two levels, never three or four. The top level answers the question; the second answers "what kind" - repositories and clients under Data, services and middleware under Logic. Siblings look like siblings: read one repository and you've read the pattern for all of them. The structure is the onboarding.
Where it fits
DLPR asks the same questions Clean Architecture asks, with a fraction of the ceremony. That ceremony - interfaces at every seam, ports, interactors - exists to protect large teams from each other. For one developer, or a team of two to four who can talk to each other, DLPR provides most of the benefit of Clean without as much overhead.
DLPR was built from experience before I encountered Robert "Uncle Bob" Martin's work, and finding the alignment was validating.
Documentation
The DLPR Alpha 1 documentation - architecture, middleware, guides, and standards extracted from a production codebase - is at github.com/jeremiahstover/dlpr.