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

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

This paper introduces XF (the eXtensible Framework), a metadata-centric architectural paradigm designed to mitigate the tight structural coupling inherent in traditional compiled enterprise systems. Whereas conventional Model-View-Controller (MVC) frameworks tightly bind storage, transport, logic, and presentation, the proposed architecture externalises the domain model into a structured Meta-Model interpreted dynamically at runtime. Serving as a unifying descriptive layer—a "Rosetta Stone" for enterprise semantics—the Meta-Model aligns database schemas, transport payloads, business rules, and user interfaces.

By combining principles from Adaptive Object-Models and semantic abstraction within a distributed environment, the work reframes these ideas as the foundation for a fundamentally different class of system: one in which business objects are treated as instances of a generic schema, and where the entire application stack is orchestrated through a single, declarative "language". The architecture is instantiated in a working system, referred to as xF, which serves as a practical implementation demonstrating the feasibility of this approach.

The core premise of this paper is that such an architecture can deliver the productivity of historical RAD tools while remaining stateless, horizontally scalable, and suitable for modern web deployment.
KEYWORDS: metadata-driven architecture; model-first persistence; generic object server; interpreter pattern; adaptive object-model; Rosetta Stone architecture; schema-driven UI; stateless systems; semantic layer; runtime interpretation; Auto-DDL; RBAC; FGAC; Unified API

1. Introduction

Enterprise applications have historically been constrained by vertically coupled architectures in which database schemas, transport contracts, business logic, and presentation assets are tightly interdependent. Such coupling produces a predictable cascade of changes across the entire stack, even for minor domain-level adjustments. A routine modification such as introducing a Taxation Category field within the customer entity typically necessitates coordinated updates to the database schema, transport-layer contracts, compiled logic tiers, and corresponding user-interface templates.

This architectural rigidity is increasingly misaligned with the demands of contemporary software systems, which require rapid iteration, stateless execution, and horizontal scalability. In response to these challenges, xF adopts a fundamentally different approach: it treats metadata not as passive documentation but as an operational contract that governs runtime behaviour. By elevating the domain model to an executable artifact interpreted dynamically, the architecture seeks to reconcile rapid application development with the requirements of modern, web-native deployment environments.

In contrast to traditional enterprise stacks that embed the business model within compiled code, xF externalises the model as metadata structured within a formally defined Meta-Model. The system functions as a Dynamic Runtime Interpreter of this metadata, using it to:

Through this mechanism, xF operates not merely as another backend or user-interface framework but as a meta-framework for constructing business software. It positions the domain model as a first-class, runtime-interpreted artifact capable of governing the entire application lifecycle.

2. Theoretical Background and Related Work

XF synthesises several established paradigms—metadata mapping, adaptive object-models, semantic layers, reflective architectures, and model-first persistence—into a distributed, metadata-driven runtime. While grounded in practical engineering experience, its design is deeply informed by foundational work on dynamic modelling, runtime interpretation, and semantic abstraction.

2.1 Metadata Mapping and Adaptive Object-Models

The architectural roots of XF begin with Fowler's Metadata Mapping pattern (2002), which advocates externalising structural and behavioural information about domain objects into metadata rather than embedding it in compiled code. This separation enables systems to evolve by modifying descriptive data instead of redeploying software components. Yoder and Johnson (2002) expanded this idea into the Adaptive Object-Model (AOM) style, in which classes, attributes, relationships, and even business rules are represented as metadata and interpreted at runtime.

XF advances these concepts for modern, distributed, stateless environments by encoding its adaptive model as transportable JSON Schema dictionaries rather than in-memory object graphs. By externalising the domain model into structured JSON metadata, xF supports cross-service consistency and runtime configurability while preserving the scalability expected of RESTful architectures.

2.2 The Semantic Layer Lineage

A second conceptual influence is the BusinessObjects Universe semantic layer (1995), which decoupled user-facing query construction from physical database schemas. However, the Universe was fundamentally a read-oriented technology. xF extends the semantic layer concept into the write lifecycle by using metadata not only to describe data but also to define constraints, workflows, and interaction patterns that govern how data is modified.

2.3 Reflective Architectures and Continuation-Passing Style

Reflection (Maes, 1987) and continuation-passing style (CPS) (Reynolds, 1993) provide foundational concepts for systems that treat program structure and control flow as data. xF applies these principles by externalising both state and progression into metadata.

Because the system is fully stateless, the continuation of a workflow cannot reside on the server. Instead, xF returns metadata that encodes the next logical action and the conditions under which the workflow should resume. When the client re-enters the system, the runtime interprets this metadata to continue execution from the correct point. This creates a lightweight form of continuation-passing in which control flow is represented as data rather than as a stack frame.

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 Metadata Mapping and the Virtual Active Record

To understand xF's approach to object modelling, it is useful to contrast it with traditional static class hierarchies. xF constructs domain objects dynamically at runtime—similar in spirit to the Active Record pattern but without requiring static class definitions.

Traditional Active Record implementations rely on static coupling between compiled classes and database tables. xF introduces the Virtual Active Record. At runtime, xF:

  1. Reads metadata describing fields, relationships, and constraints.
  2. Constructs an in-memory representation of the entity (a dictionary).
  3. Attaches generic CRUD and navigation behaviour.
  4. Exposes the construct as if it were a compiled Active Record class.

There is no static class and no compile-time domain model; the "class" is interpreted entirely at runtime.

3. The Rosetta Stone Approach to Architecture

The "Rosetta Stone" approach to software architecture is a metaphor for building a common, unifying mapping between different views of a system. The xF Meta-Model functions as a shared reference model. It serves as a unifying 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 these dimensions are mapped to the same metadata language, xF guarantees cross-layer consistency. Changing a concept in the Meta-Model is analogous to updating the Rosetta Stone inscription: every dependent representation can be reinterpreted on the next request without recompilation.

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.

flowchart LR Client[Frontend Interpreter] <-->|Dual Payload JSON| API[Unified API] API -->|Lookup| MM[(Meta-Model)] API <--> Router{Logic Gateway} Router <-->|Standard Entity| CRUD[Auto-CRUD Engine] Router <-->|Aggregate| FaaS[Stateless Function\ne.g., f_ot_allocmgr] CRUD <--> DB[(Business Database)] FaaS <--> DB style Router fill:#eef2ff,stroke:#4f46e5,stroke-width:2px style FaaS fill:#f0fdf4,stroke:#16a34a
Figure 3. The Logic Gateway routing identical payloads to either physical CRUD operations or stateless functional logic.

5. Integrated Security: Authorization Through Metadata

In the xF architecture, security is not an auxiliary layer injected into compiled controllers; rather, it is an emergent property of the metadata graph. The system maps principals (Users, Roles, or Groups) directly to the Meta-Model components via a central Rights registry:

The Runtime Interpreter utilises the security metadata to prune the y segment of the payload. If a principal lacks "View" rights for an attribute, the field is omitted from the stream, rendering it invisible at the UI tier. Simultaneously, the Server Interpreter validates the z segment of incoming POST requests against the same metadata, enforcing Unified Security Invariants across both layers.

6. Runtime Dynamics: The Interpreter Loop

At runtime, xF follows a cyclical process comprising Hydration, Interpretation, and Decomposition.

6.1 Phase 1: Hydration (GET)

  1. Read Entity Metadata: xF loads the definition (fields, types, constraints, UI hints) from the Meta-Model.
  2. Build Runtime Dictionary: xF constructs a dynamic dictionary to represent the entity (The Virtual Active Record).
  3. Serialize to JSON: The dictionary is sent to the UI as a pure data contract driven by metadata.

6.2 Phase 2: Command (POST)

  1. Deserialize JSON: The UI sends JSON back; xF deserializes this into a dictionary.
  2. Type Checking via Metadata: xF validates the dictionary strictly against the Meta-Model, enforcing domain constraints without domain classes.
  3. Send to Logical Endpoints: Once validated, the dictionary is passed to the Logic Gateway.
  4. Persistence Layer Deconstruction: Finally, the persistence layer reads the metadata to map dictionary keys directly to table columns.

7. Frontend Agnosticism and the Interpreter Pattern

At its core, xF is a strictly Headless Architecture. The backend concerns itself exclusively with the generation of the Dual Payload. How the client chooses to visualise this payload is an implementation detail decoupled from the server.

To implement the Interpreter pattern in modern frameworks (e.g., React, Vue), xF utilises a Dynamic Registry. The server response acts as an Abstract Instruction Set, describing the intent of the interface rather than its implementation. The client parses this instruction set and dynamically assembles the interface using a component registry. This allows the UI to evolve instantly in sync with the backend schema without code changes.

8. Comparative Analysis and Architectural Positioning

The architectural novelty of xF lies in its underlying execution mechanism.

8.1 xF vs. Compiled Model-View-Controller (MVC)

Traditional MVC development is predicated on a Compiled Class Hierarchy. Domain semantics are fragmented across SQL schemas, DTOs, and ORMs, dictating a vertical change cascade. xF replaces this with:

8.2 The Interpretive vs. Generative Paradigm

Generative AI tools (e.g., Copilot) accelerate the production of software but maintain the status quo of Static Artifacts. They generate imperative code that must be committed, tested, and maintained, potentially accelerating technical debt. xF treats code as a liability to be minimised, focusing on the execution of intent rather than the generation of static artifacts.

9. Industrial Case Study and Implementation

To transition from architectural theory to practical viability, xF is evaluated through its deployment in live, high-volume production environments.

9.1 System Context: Scalability & Load Handling

The architecture currently powers Client A, a deeply relational, large-scale dispatch and booking platform utilized for coach, tour, and transfer operations. The most computationally expensive operations for Client A involve fleet dispatching—requiring the real-time cross-referencing of vehicle capacities, driver rosters, and dynamically calculating aggregate departure times across passenger intersection tables. Despite relying on a Virtual Active Record interpreted dynamically at runtime, the system processes upwards of 500 daily passenger allocations with zero latency degradation during peak morning dispatch hours.

Furthermore, the architecture's scalability is validated by its deployment at Client B, a high-volume watersports booking operator. During peak summer loads (August), the system processes massive daily booking influxes via the f_ot_bookingmgr stateless function. This declarative stability translates to a remarkably low maintenance overhead; production deployments operate smoothly with an average of only 1 to 2 support requests per month.

9.2 Codebase Reduction via the Logic Gateway

In a standard MVC baseline, managing the highly relational domain of Client A (approx. 15 physical application tables and 20 system tables) would require over 35 distinct API controllers and corresponding DTOs for complex UI views.

By utilizing the Logic Gateway to route Aggregates directly to targeted FaaS execution, xF eliminates this entire controller layer. Analysis of the production system reveals that the entire custom backend business logic of Client A's dispatch console is contained within approximately 1,500 lines of code (encapsulated in pure functions like f_ot_allocmgr). This represents an order-of-magnitude reduction in application footprint.

9.3 Metamodelling Transparency (The Recursive UI)

A primary criticism of commercial Low-Code/No-Code (LCNC) platforms is their reliance on proprietary, opaque visual editors (the "black box" problem). xF resolves this through architectural recursion.

The administrative metadata environment (the xF Admin Portal) is itself built using the xF architecture. The metadata definition screens—where developers configure attribute constraints, relational mappings (e.g., FK Selectors), and UI components—are simply rendering system "meta-entities" via the exact same JSON dual-payload mechanism used by the business application. Because the framework is self-describing, the metadata layer remains infinitely customizable and fully introspectable via standard SQL.

9.4 Wire Protocol Sketch

To illustrate the wire protocol, below is an extract from the trip entity payload, showing the Dual Payload design (z for transactional data, y for UI metadata) heavily anonymized for this paper:

{
  "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

This paper demonstrates that a metadata-centric runtime interpreter provides a robust architectural alternative to the vertically coupled enterprise systems that dominate contemporary practice. By elevating the domain model to an active Meta-Model acting as a true "Rosetta Stone" for enterprise semantics, xF dynamically interprets this single source of truth across storage, transport, logic, and presentation layers.

10.1 Future Directions: Generative Metamodelling

A persistent barrier to the adoption of metadata-driven systems is the initial overhead required to construct comprehensive domain models. However, by fine-tuning Large Language Models (LLMs) on established enterprise data dictionaries and prompting them to output structural JSON schemas rather than imperative code, the architecture naturally neutralizes the primary security vectors associated with AI code generation. This establishes a secure execution boundary where LLMs generate declarative intent, and the xF runtime performs the execution.

10.2 Future Directions: Metadata-Injected Micro-Frontends

A parallel research track explores extending the metadata paradigm directly into the presentation layer via a Zero-Build Host Shell architecture. In this model, frontend components (HTML, CSS, and JS) are treated as runtime metadata, stored as database records, and injected into the y segment of the payload. By storing executable presentation logic in the database and assembling it dynamically, the architecture bypasses complex bundling pipelines, creating a truly dynamic, runtime-assembled micro-frontend ecosystem.

11. References

12. Acknowledgments

The concepts described in this paper are part of the author's independent ongoing architectural research. The author thanks collaborators, early adopters, and the broader developer community whose historical work on MDA, metadata-driven systems, and interpreter-based UIs provided essential inspiration.