XF: A Metadata‑Driven Runtime Interpreter for Stateless Enterprise Systems

P. Sanil
Independent Researcher
sanil@xf.com.mt
ABSTRACT

This paper presents xF, a metadata‑centric architectural paradigm designed to eliminate the structural coupling that characterises traditional compiled enterprise systems. Conventional Model‑View‑Controller (MVC) frameworks tightly bind storage, transport, logic, and presentation, creating cascading change dependencies across the stack. xF replaces this rigidity with a runtime‑interpreted Meta‑Model that externalises the domain model as structured metadata. This Meta‑Model acts as a unifying semantic layer — a “Rosetta Stone” — aligning database schemas, transport payloads, business rules, and user interfaces.

Building on the lineage of Metadata Mapping (Fowler, 2004) and the Adaptive Object‑Model architectural style (Yoder & Johnson, 2002), xF reframes these ideas for modern, stateless, horizontally scalable environments. The system treats business objects as instances of a generic schema interpreted dynamically at runtime, enabling rapid iteration without code generation or redeployment. The architecture is instantiated in a production‑grade implementation powering high‑volume operational systems. The core premise is that a metadata‑driven runtime can deliver the productivity of historical RAD tools while remaining stateless, cloud‑native, and operationally robust.
KEYWORDS: metadata‑driven architecture; model‑first persistence; generic object server; interpreter pattern; adaptive object‑model; semantic layer; schema‑driven UI; stateless systems; runtime interpretation; Auto‑DDL; RBAC; FGAC; Unified API; HATEOAS.

1. Introduction

Enterprise systems have long been constrained by vertically coupled architectures in which database schemas, transport contracts, business logic, and presentation assets are tightly interdependent. Even minor domain changes — such as adding a Taxation Category field — typically require coordinated updates across SQL schemas, DTOs, controllers, and UI templates.

This rigidity is increasingly incompatible with modern requirements for rapid iteration, stateless execution, and horizontal scalability. xF adopts a fundamentally different approach: it treats metadata not as documentation but as an operational contract. The domain model is externalised into a formally defined Meta‑Model, interpreted dynamically at runtime.

The runtime uses this metadata to:

xF is therefore not a backend framework or UI toolkit, but a meta‑framework for constructing business software. The domain model becomes a first‑class, executable artifact governing the entire application lifecycle.

2. Theoretical Background and Related Work

xF synthesises concepts from metadata mapping, adaptive object‑models, semantic layers, and reflective architectures into a distributed, metadata‑driven runtime.

2.1 Metadata Mapping and Adaptive Object‑Models

Fowler’s Metadata Mapping pattern advocates externalising structural and behavioural information into metadata rather than compiled code. Yoder and Johnson’s Adaptive Object‑Model (AOM) style extends this by representing classes, attributes, relationships, and rules as runtime‑interpreted metadata.

xF advances these ideas by encoding the domain model as transportable JSON Schema dictionaries, enabling cross‑service consistency and runtime configurability in stateless environments.

2.2 Semantic Layer Lineage

The BusinessObjects Universe (1995) introduced a semantic layer that decoupled user‑facing queries from physical schemas. xF extends this concept beyond read‑oriented semantics: metadata defines not only structure but also constraints, workflows, and interaction patterns governing data modification.

2.3 Reflective Execution and Continuation‑Passing

Because xF is fully stateless, workflow continuation cannot reside on the server. Instead, the runtime returns metadata describing the next logical action and the conditions for resumption. This creates a lightweight form of continuation‑passing where control flow is represented as data.

sequenceDiagram participant Client as Client / UI participant Runtime as xF Runtime participant Meta as Meta-Model Client->>Runtime: 1. Submit payload (stateless) Runtime->>Meta: 2. Interpret metadata Meta-->>Runtime: 3. Next action + timing Runtime-->>Client: 4. Return metadata-encoded continuation Note over Client: Wait for specified time
(temporal gap) Client->>Runtime: 5. Re-enter with same metadata Runtime->>Meta: 6. Resume workflow from continuation Meta-->>Runtime: 7. Next step Runtime-->>Client: 8. Updated continuation
Figure 1. Metadata-driven continuation: control flow encoded as data, enabling temporal recursion in a stateless environment.

2.4 The Virtual Active Record

Traditional Active Record implementations rely on static class definitions. xF introduces the Virtual Active Record, constructed dynamically at runtime:

No static domain classes exist; the “class” is interpreted entirely at runtime.

3. The Rosetta Stone Approach to Architecture

The xF Meta‑Model functions as a unifying semantic substrate across five dimensions:

flowchart TD MM((Meta-Model
The Rosetta Stone)) MM -->|Generates| PS[Physical Storage
Tables & Columns] MM -->|Defines| TM[Transport Model
Payloads & APIs] MM -->|Dictates| UI[UI Representation
Forms & Controls] MM -->|Enforces| BR[Business Rules
Validation & Logic] MM -->|Describes| LM[Logical Model
Entities & Aggregates]
Figure 2. The Rosetta Stone Mapping: Metadata as a unifying substrate across architectural concerns.

Because all dimensions map to the same metadata language, cross‑layer consistency is guaranteed. Updating the Meta‑Model is analogous to updating the Rosetta Stone inscription: every dependent representation is reinterpreted on the next request.

4. The Core xF Architecture

4.1 Separation of Concerns via Dual Payloads

To maintain a stateless architecture while supporting rich UIs, xF employs a Dual Payload strategy. Each runtime payload pairs data with metadata:

Crucially, xF utilises an Asymmetrical Payload Strategy to optimise performance. While the GET request retrieves both segments to drive the UI interpreter, the POST (write) operation transmits only the z segment. By stripping the heavy y metadata from the upstream traffic, xF effectively mitigates "over-posting", ensuring the write-path remains lightweight.

4.2 The Unified API vs. Controller Sprawl

Traditional enterprise systems invariably suffer from Controller Sprawl, where the complexity of the domain model is linearly mirrored by an ever-expanding set of API endpoints (e.g., /api/customers, /api/orders).

xF resolves this by implementing a Unified API—a single pair of entrance/exit points that serve the entire domain graph. Instead of the client asking for specific fields, the client asks for the Entity Concept (e.g., GET /api/xf_get/customer). The server responds with the Dual Payload. The "Magic" of the runtime interpreter eliminates the need for manual wiring, strictly adhering to the Single Responsibility Principle: the API handles communication; the metadata handles intent.

4.3 Structural Homogeneity across Diverse Domains

To illustrate the power of this homogeneity, consider three distinct entities from a production Vehicle Booking System: ot_booking, ot_driver, and ot_vehicle. Although their business roles differ vastly, their interaction via the Unified API is identical. The frontend does not "know" about drivers or bookings; it knows how to "render a y segment" and "collect a z segment."

4.4 Entities, Aggregates, and the Logic Gateway

A cornerstone of the xF architecture is the functional equivalence of physical and logical constructs via the Unified API. In xF, a clear technical distinction is made between Entities and Aggregates, though both are managed via the exact same metadata mechanisms:

Crucially, the Unified API treats both constructs identically. When a GET or POST request is received for either an Entity or an Aggregate, the payload is routed through a central Logic Gateway. For standard physical Entities, the gateway utilizes the Auto-CRUD engine to directly manipulate the database.

However, when custom business rules or complex UI interactions are required (often via Aggregates), the gateway bypasses standard CRUD and routes the state payload to an isolated, stateless function station (e.g., f_ot_allocmgr or f_ot_bookingmgr). Because these stations focus entirely on pure computation—written in standard languages like C# or VB—without concerning themselves with API routing, session state, or JSON serialization, the architecture functions as a highly efficient, domain-specific serverless execution engine.

Dual Payload JSON

Lookup

Standard Entity

Aggregate

Frontend Interpreter

Unified API

Meta-Model

Logic Gateway

Auto-CRUD Engine

Stateless Function
e.g., f_ot_allocmgr

Business Database

Figure 3. The Logic Gateway routing identical payloads to either physical CRUD operations or stateless functional logic.

5. Integrated Security Through Metadata

Security is an emergent property of the metadata graph. A central Rights registry maps principals to Meta‑Model components:

The runtime prunes the y‑segment for unauthorized fields and validates incoming z‑segments against the same metadata.

6. Runtime Dynamics: The Interpreter Loop

flowchart TD subgraph Phase 1: Hydration GET direction TB G1[Load Metadata] --> G2[Construct Virtual Active Record] --> G3[Serialize to JSON] end subgraph Phase 2: Command POST direction TB P1[Deserialize JSON] --> P2[Validate via Metadata] --> P3[Route to Logic Gateway] --> P4[Map to Table Columns] end G3 -.->|Sends Dual Payload to UI| P1
Figure 4. The cyclical Interpreter Loop for stateless data hydration and command validation.

6.1 Hydration (GET)

6.2 Command (POST)

7. Frontend Agnosticism and the Interpreter Pattern

xF is strictly headless. The server emits an Abstract Instruction Set describing UI intent. The client uses a Dynamic Registry to assemble components at runtime. UI changes follow metadata changes instantly, without code modifications.

8. Comparative Analysis and Architectural Positioning

8.1 xF vs. Compiled MVC

MVC systems embed domain semantics across SQL, DTOs, and controllers. xF replaces this with:

8.2 Interpretive vs. Generative Paradigms

Generative AI tools accelerate code creation but preserve static artifacts. xF treats code as a liability and executes intent, not generated code.

9. Industrial Case Study

9.1 Scalability and Load Handling

xF powers large‑scale dispatch and booking platforms. Despite dynamic interpretation, the system handles:

with negligible latency and minimal maintenance overhead.

9.2 Codebase Reduction

A domain requiring ~35 controllers in MVC is implemented in xF with ~1,500 lines of pure functional logic, thanks to the Logic Gateway.

9.3 Metamodelling Transparency

The xF Admin Portal is built using xF itself. Metadata screens are simply meta‑entities rendered through the same Dual Payload mechanism, ensuring full introspection and avoiding the “black box” problem of LCNC platforms.

9.4 Wire Protocol Sketch

{
  "z": {
    "tripno": 23,
    "tripdate": "2025-05-06",
    "vehicle_": 103,
    "driver_": 13,
    "deptime": "10:00",
    "xf_entity": "ot_trip",
    "xf_id": 23
  },
  "y": {
    "vehicle_": {
      "id": 2512, "h": "Vehicle", "c": "col-lg-3",
      "p2": "ot_vehicle",
      "p10": [
        { "v": 103, "k": "Fleet-001-Minibus" },
        { "v": 100, "k": "Fleet-002-Coach" }
      ]
    },
    "driver_": {
      "id": 2802, "h": "Driver", "c": "col-lg-3",
      "p2": "ot_driver",
      "p10": [
        { "v": 13, "k": "Driver 101" },
        { "v": 24, "k": "Driver 102" }
      ]
    }
  }
}

10. Conclusion and Future Directions

xF demonstrates that a metadata‑driven runtime interpreter can replace vertically coupled enterprise stacks with a unified, dynamic, stateless architecture. The Meta‑Model acts as a Rosetta Stone across storage, transport, logic, and presentation.

10.1 Generative Metamodelling

LLMs can generate declarative metadata safely, avoiding the risks of AI‑generated imperative code.

10.2 Metadata‑Injected Micro‑Frontends

A Zero‑Build Host Shell architecture stores frontend components as metadata, enabling runtime‑assembled micro‑frontends without bundling pipelines.

11. References