The Design Decision Hidden in Plain Sight
Delphi's DFM file — the companion to every Pascal unit in a form-based application — stores a form's complete component hierarchy and property values as a readable stream of declarations. A TButton sits nested inside a TForm, its Caption, Left, Top and event bindings written out as name-value pairs, one per line. Nothing about that structure is accidental.
Early Delphi releases stored DFM content in a compact binary format, optimised for fast streaming by the VCL's built-in persistence machinery. Delphi 5 formalised the shift to plain text as the default ↗, making forms both human-readable and meaningful to version-control systems. Before that change, diffing two form files meant decoding an opaque byte sequence; after it, a merge conflict in a DFM was no different from one in a Pascal unit.

The VCL's depth is the point: a form arrives with several generations of ancestor behaviour already linked into it.

A parts store rather than a code library, but the same premise — take a standard piece off the shelf instead of making one.
Photo: Charlie Merrow / Pexels
The file's structure mirrors the VCL's property model directly. Only published properties — those declared in a class's published section and backed by RTTI — appear in the DFM. The compiler emits type metadata for every such property, and the streaming system walks that metadata at load time to restore the object graph without a single hard-coded field name. The DFM is therefore a readable projection of what the RTTI system knows, nothing more and nothing less.
Visual inheritance sharpens the point further. When a derived form overrides one property of an ancestor's button, only that delta appears in the child's DFM. The format encodes difference, not duplication, and the Delphi IDE enforces that discipline silently every time a form is saved.
The consequences were practical and lasting. Component vendors shipping a BPL could trust that any property they marked published would survive a save-load cycle without custom code. Third-party tools — visual diff utilities, form auditors, localisation extractors — could parse the format with a straightforward recursive-descent reader, because the grammar of a DFM file is close to a subset of Object Pascal itself ↗. A binary alternative would have closed all of those doors.
More in Delphi
