The previous post, Which Part Definitions, the Framework and Application Code Each Own, ended by saying that this one would gather the thirty posts into a single big picture.
This post covers:
- The three depths the framework offers along the axis of NoCode, LowCode and AnyCode
- The big picture: what grows out of a single
FormSchema, and what every call passes through - Which systems this design suits and does not suit, and where the long term return lands
- The road not yet finished, and what is deliberately not done
1. Three depths
The three depths are not mutually exclusive, and one form can use all three:
| Depth | What you write | What changing it costs |
|---|---|---|
| NoCode | Definitions, being FormSchema, TableSchema, FormLayout, and the FormRule and ValueExpression entries on fields | Swapping in another definition |
| LowCode | Overridden business object steps and business plugins | Compiling, packaging and deploying |
| AnyCode | A custom front end, business object or repository, or an ExecFunc method | Compiling, packaging and deploying |
What can be done by changing a definition is NoCode. Adding a piece of code at a step or stage the framework has already cut out is LowCode. Writing a whole stretch yourself because the framework's flow cannot hold it is AnyCode.
Logic that every company does the same way moves step by step from LowCode into definitions and the framework, following the process in the previous post's section on converging from the application into the framework.
2. The big picture
| Path | Question it answers | As forms are added |
|---|---|---|
| The vertical path | What this form looks like | Grows linearly |
| The horizontal path | What happened on this call | Does not change |
The vertical path:
Definitions (single source of truth) FormSchema at the center │ ┌───────────────────────────┼───────────────────────────┐ │ generated │ generated │ evaluated ↓ ↓ ↓ Layouts TableSchema FormRule → record, list, lookup → upgraded after comparing → at save and delete CRUD statements DataSet structure ValueExpression → assembled at run time → no entity classes needed → when a related field changes The horizontal path:
Front end → Connector → serialize → compress → encrypt ↓ Endpoint → access control → session → BO (extension points and plugins) ↓ Repository → data access → database Mechanisms that cut across both paths:
| Mechanism | Post |
|---|---|
| Definition caching and cross-node invalidation | Cross-Node Invalidation for Definition and Data Caches |
| The error contract | The Error Contract and User Visible Messages |
| Customization overlays and multiple languages | The Scope of the Customization Layer and Overlay Granularity and Multilingual Customization and Resource Structure |
| Deciding and applying permissions | The Three Axes of Permissions: Action, Row and Column |
| Auditing | The Audit Trail and the Before and After Values of a Change |
| Numeric rounding, the semantics of time, and time zone conversion | Numeric Semantics, Multiple Currencies and Units of Measure, The Semantic Boundaries Between Date, DateTime and Time and Time Zone Conversion of DateTime |
Mechanisms all over the picture keep using the same few principles:
| Principle | Examples |
|---|---|
| Position decides meaning | Which side of the transaction an extension point is on, in Extension Points on a Business Object and When to Override Them. Whether a value is kept per process, per session or per call, in The Connector and the Convergence of Client Responsibilities. Which layer stands in when a translation cannot be found, in the post on multilingual customization |
| Failure has to be visible | Whether you can tell that a cache has gone stale, in the post on cross-node invalidation. Whether a ProgId bound to the wrong type fails on the spot or looks like it is still running, in API Contract Layering and the Type Registry |
| Everything the caller sends is a claim, not a fact | A type name has to pass the allowlist first, in The Division of Labor Between XML, JSON and MessagePack. PayloadFormat has to match the level the method declares, in The API Payload Security Pipeline: Order, Protection Levels and Keys. The department column is looked up in the database once more, in the post on permissions |
The paths in the picture are offered, not enforced. Open your own connection, assemble your own statements, or go around the entry point, and none of the cross-cutting mechanisms take effect.
3. Which systems this suits and does not suit
An Overview of Definition-Driven Architecture asked three questions before you commit. Each gets one more sentence here, and two more questions are added:
| Question | The answer before | What going through the series adds |
|---|---|---|
| Are the screens standardized forms? | Layouts converge into a master block plus a detail block, and dashboards and scheduling are not in the pattern | Screens outside the pattern use manual layout, and the part that binds data is shared with forms, as FormLayout and Screen Generation for Multiple Front Ends showed |
| Is a request a single document? | The DataSet is self describing, and every response carries its structure along | Definitions have to be cached, and changes reach each node through notifications, as the post on cross-node invalidation showed |
| How long does the system have to live? | The cost is concentrated up front, and the return takes years to show | Where the return lands is laid out below |
| Is it connecting to an existing database? | The overview post did not ask | Existing tables first have to be changed to carry the framework's system fields, as The Northwind Case Study: Eight Forms and a Custom Business Object noted |
| Will a second one appear? | The overview post did not ask this either | A second company, a second language, a second role, a second currency. If none will appear, mechanisms such as the customization layer, multiple languages, permission models and the currency master are pure cost, as the previous post concluded |
Why ERP Needs a Definition-Driven Framework said that in the short term Code-First wins almost every time. The return on definition-driven design is long term:
| Return | Where it lands |
|---|---|
| Development process | There is only one way to do the same thing, and nothing to compile, package or deploy between changing a definition and it taking effect |
| Maintenance cost | Thousands of structurally identical FormSchema files can be checked by one script, for example whether every Currency field is marked with NumberKind |
| Education cost | Understand one form and you understand them all, as the overview post said. Extension points are listed, and which step you override and which stage you hook into each have a fixed name |
| User training | The layout vocabulary is small, so training cost does not grow in proportion to the number of forms, as the post on FormLayout said |
4. The road not yet finished
The previous post separated boundaries from backlog: what deliberately does not go through definitions is a boundary, and what the framework has not finished is backlog. The table below sorts what is not yet complete by why it is not complete:
| Why it is not yet complete | Examples |
|---|---|
| Should converge, and has not yet | The document numbering rule, a prefix plus date plus a sequence, which every company currently writes itself |
| The declarative side has not caught it yet | Cross row aggregation, such as at least one detail row and the master total; and the query condition screen for reports, where FilterNode already exists but a layout generator is missing |
| The mechanism is there, but only half done | Rounding a value to the column's capacity before a write has a rule and no implementation, as the post on numeric semantics noted; there is no extension point inside the transaction yet; the front end has no logout flow; the service container for local calls is not yet DI based; JSON-RPC batch requests are not implemented |
| The definitions are enough, and the tools are not built yet | Exporting import formats and test data from definitions, as in Data and Definitions Split Apart, So Forms Need No Types of Their Own |
| Not unfinished, but not done by design | Genuine business judgment, SQL for reports and batch jobs, and deep screen customization, as the previous post laid out; and ValueExpression does not query the database |
The declarative side not having caught something yet is progress: add aggregate functions and evaluation ordering, and it can become a declaration. Not done by design is a design decision. If ValueExpression could query the database, for example, the front end and the back end could not compute the same answer. Filing either one under the wrong heading costs something different. Treat progress as a boundary, and things that could have converged stay in every company's code for good. Treat a design decision as backlog, and the framework grows into one that can do anything, which means it has made no decisions for you, as the overview post put it.
The half done kind is the easiest to mistake for finished when reading the documentation: a rule written with no implementation, a route missing one stretch, something built with no caller. Take rounding to capacity before a write. If the discount column from the previous post, declared with no decimal places, is someday filled with a decimal, whether it gets rounded and how is up to whichever database it happens to be.
In closing
The first post said the enemy of ERP is restatement. What definition-driven design eliminates is not restatement but copying. The facts about one field still appear in FormLayout, TableSchema, the statements, the DataSet, FormRule, auditing, permissions and time zone conversion. The difference is that all of these places read the same FormSchema, rather than each keeping a copy of its own.
With everything reading the same one, that one has to be:
| Requirement | Post |
|---|---|
| Wide enough to carry meaning beyond structure | The overview post |
| Kept current by something that guarantees every node gets the latest version, or they stay on old values | The post on cross-node invalidation |
| Clear about who can change it, and down to which layer | The post on the customization layer |
| Built so that a missing declaration is visible, because once something is left out the remaining values are still valid | The post on numeric semantics |
A definition is structured data, and How FormSchema Drives SQL listed batch scripts, tools that produce definitions, and AI as all able to work with it. Now that AI can write code, what it produces can be a definition: build time diagnostics check it, the framework expands it, and structurally identical forms can be made one after another by the same procedure. The work of an ERP engineer moves accordingly to the framework, the mechanisms and this procedure, and what has to be understood is how the whole architecture works.
The thirty posts end here. As the first post said, the framework's only role in this series is to show that these ideas are not just talk on paper. You can skip it entirely, take away only the idea of letting definitions be the source, and build that idea in the languages and tools you know.
📚 Part of the thirty-post series ERP Architect's Notes: Designing a Definition-Driven Framework
📘 Original article on HackMD, in Traditional Chinese:
👉 https://hackmd.io/@jeff377/day-30-depths-and-map
📢 You are welcome to republish this, please credit the source.
📬 Follow for more engineering notes:
Facebook | HackMD | GitHub | NuGet
