$ show dotpas/dext
The Dext Framework is a comprehensive, modular full-stack framework for Delphi (v11+) designed to bring modern web development patterns to the native Delphi ecosystem. It is Apache 2.0 licensed and provides a coherent set of libraries covering web API construction (minimal APIs, MVC controllers, middleware pipeline, SignalR-compatible real-time hubs), an ORM with code-first migrations, dependency injection, background jobs, event bus, resilience pipeline, testing/mocking utilities, desktop UI patterns (MVU/MVVM with VCL binding), AI integration (MCP server, agent graph), CLI tooling, and telemetry/dashboard. The architecture is heavily inspired by ASP.NET Core/EF Core, with fluent builders (`TDextServices`, `TApplicationBuilder`), specification pattern, attribute-based configuration, and a focus on zero-allocation performance (custom SIMD-optimized collections, ring-buffer logging, direct codecs). It includes extensive documentation (The Dext Book in English and Portuguese), benchmark harnesses, and 40+ example applications covering real-world use cases from simple CRUD to multi-tenant e-commerce. The codebase is actively maintained, with multi-version Delphi support (XE2 through 13), community database drivers (UniDAC), and a growing ecosystem of IDE integration and design-time tooling.
The LLM identified 5 files worth highlighting for reuse:
Implements `IFrozenDictionary<K,V>` — an immutable dictionary that is built once via a builder and then provides O(1) read access. It avoids heap allocation on reads and uses internal hash tables optimized for lookup performance. This is a standalone, reusable component that can be extracted for any Delphi project needing an immutable key-value store, demonstrating careful memory management and high-performance design.
Provides `Mock<T>` — a generic record-based mock for interfaces that uses `TVirtualInterface` and never allocates on the heap. It supports `Setup`, `Verify`, `RaiseException`, and `Returns` with `It.IsAny<T>`. The mock is stack-allocated and requires no `Free`. This is a clean, reusable mock implementation that can be extracted for any Delphi test project, showcasing advanced generic and virtual interface usage.
Implements a startup lock middleware that returns HTTP 503 (Service Unavailable) for all incoming requests while the application is starting up, performing migrations, or initializing background services. It uses a simple atomic flag and can be configured with a timeout. This is a self-contained middleware pattern that can be extracted and reused in any web framework to prevent premature request handling during initialization.
Provides `TStringExpressionParser` that parses a string-based filter expression (e.g., `"Age > 18 AND Name like 'John'"`) into specification objects compatible with the ORM's `Where` clauses. It supports logical operators, comparison operators, string literals, and property resolution. This component is reusable for any application that needs dynamic query filtering from user input, demonstrating a clean tokenizer/parser design.
Defines smart record types (`StringType`, `IntType`, `BoolType`, etc.) that wrap Delphi primitive types with operator overloading and implicit conversions. These are used across the ORM and web framework to enable type-safe query expressions like `Where(Cust.Name.Contains('John'))`. Each smart type is a small self-contained record that can be extracted and used in any Delphi project requiring fluent, readable, and type-safe property access without runtime string errors.