Skip to content
CAI
Software that uses CAICheck a score

roadtoagility/dflow

55.6

Adequate · 3 August 2026

631

lines of production code

C#

primary language

3

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

DFlow is a .NET framework for building domain-driven applications using a CQRS and event-driven architecture. It provides core abstractions for aggregates, value objects, and specifications, alongside persistence support for Entity Framework Core and LiteDB. The system facilitates asynchronous command handling, domain event publishing, and outbox-based event export, with sample applications demonstrating these patterns.

How it got here

2020–2021 — Domain model and persistence refactoring

27 changes.

This period focused on a major refactoring of the DFlow core domain model and the introduction of a specification pattern for validation. The team also expanded the sample applications to demonstrate CQRS, asynchronous event handling, and Entity Framework Core persistence, while significantly increasing test coverage for the new architecture.

2022–2023 — Domain modeling and persistence infrastructure

8 changes.

This period focused on establishing the core domain modeling primitives, including aggregate roots, entities, and validation frameworks. It also introduced the outbox pattern for event sourcing and added Entity Framework Core implementations for PostgreSQL, providing a complete persistence layer for the DFlow library.

Features

Add Entity Framework Core persistence implementations for PostgreSQL and general database sessions

The DFlow framework now includes new persistence components: an Entity Framework Core implementation for PostgreSQL (Npgsql) featuring an outbox pattern for transaction logs, a generic DbSession for database operations, and a SoftDeleteDbContext that automatically handles soft-delete logic. These changes provide users with ready-to-use database integration tools for DDD-based applications.

src/contrib · high confidence

Add Entity Framework sample application

A new sample application has been added for the Entity Framework persistence layer. This sample demonstrates how to configure and run a CQRS-based application using SQLite, including dependency injection setup, command/query handlers, and domain event handling.

samples/SimplestApp.Persistence.EntityFramework · high confidence

Added CQRS sample application demonstrating async command and event handling

A new sample application has been added to the CQRS business layer, providing a complete example of setting up a command handler and domain event handler using FluentMediator and dependency injection. This sample demonstrates how to configure the service collection, register handlers, and execute commands asynchronously, serving as a reference implementation for the CQRS pattern within the application.

samples/SimplestApp.Business.Cqrs · high confidence

Added Outbox event export interface

A new interface, IEventsExporting, was added to the Outbox namespace. This interface defines a contract for exporting change sets from a primary entity, enabling the system to capture domain events for outbox processing.

src/DFlow.Persistence/Outbox · medium confidence

Added SimplestApp sample demonstrating user creation with validation

A new sample application, SimplestApp, has been added to demonstrate a basic workflow for creating a user. The sample includes a Program.cs entry point that instantiates a UserService with a UserValidSpecification, and an AddUser operation class to hold user data. This provides a concrete example of how to use the library's validation and service patterns.

samples/SimplestApp · high confidence

Added extension methods for mapping between User and UserState

A new file, BusinessObjectsExtensions.cs, was added to the samples project, introducing extension methods to convert between the domain User object and a UserState representation. This change provides utility methods to map user identity, name, and email between the two formats.

samples/DFlow.Samples/Persistence/ExtensionMethods · high confidence

Added outbox aggregate state model

Introduced a new \AggregateState\ record in the DFlow.Persistence library to represent the state of an aggregate within the outbox mechanism. This model captures key metadata including the aggregate ID, type, event type, and the associated event data, enabling the persistence layer to track and manage outbox events.

DFlow.Persistence · high confidence

Added read model for user projections

A new read model for user projections has been introduced, consisting of the UserProjection entity, its corresponding repository interface, and the concrete repository implementation. This change provides a dedicated persistence layer for querying user data, supporting operations such as retrieving, adding, removing, and finding user projections.

samples/DFlow.Samples/Persistence/ReadModel · high confidence

Added sample application demonstrating specification-based validation

The sample application now includes a new service layer and specification pattern implementation for user management. A new \IUserService\ interface and \UserService\ implementation have been added to handle user creation, utilizing a \UserValidSpecification\ to validate the \UserEntityBasedAggregationRoot\ before processing. This demonstrates how to integrate domain specifications for validation within the DFlow framework.

samples/SimplestApp/Services · high confidence

Added sample command handlers for user creation

New sample command handlers have been introduced in the business layer to demonstrate user creation workflows. The synchronous AddUserCommandHandler processes commands in memory, while the new AddUserPersistentCommandHandler extends this functionality to include asynchronous database persistence and event publishing, providing a complete example of the CQRS pattern with a repository.

samples/DFlow.Samples/Business/CommandHandlers · high confidence

Added sample persistence implementations for Entity Framework and LiteDB

The sample application now includes concrete persistence layers for both relational and document-based storage. A new Entity Framework Core context (SampleAppDbContext) is provided for standard state management, while a LiteDB-based context (SampleAppProjectionDbContext) supports projection storage. These are paired with corresponding session classes (SampleDbSession and SampleProjectionDbSession) that wire the repositories to the respective database contexts, enabling the sample to demonstrate data persistence across different storage backends.

samples/DFlow.Samples/Persistence · high confidence

Added sample query handler for retrieving users by filter

A new sample implementation for querying users by name filter has been added to the business layer. This includes the query filter definition, the query handler that executes the asynchronous database lookup, and the corresponding response model, demonstrating the CQRS pattern within the DFlow framework.

samples/DFlow.Samples/Business/QueryHandlers · high confidence

Added specification pattern implementation for business object validation

The DFlow.Specifications assembly now includes a complete specification pattern implementation, introducing the ISpecification\<TBusinessObject\> interface and supporting composite logic through And, Or, and Not operations. This allows developers to construct complex validation rules by combining simpler conditions, with support for both direct object evaluation and LINQ expression-based specifications.

src/DFlow.Specifications · high confidence

Initial Entity Framework Core persistence and read-model scaffolding for the DFlow sample

The DFlow sample application now includes a complete Entity Framework Core persistence layer. This includes database models (ProjectState, UserState, ClientState, ActivityState), corresponding read-model projections (ProjectProjection, UserProjection, ActivityProjection), and repository implementations (ProjectRepository, UserRepository, ActivityProjectionRepository) that handle data access and concurrency checks. The change also adds the initial EF Core migration (20210210004122\_InitialCreate) and a subsequent migration (20210210161238\_Versioning) that adds row versioning columns to the projection tables, along with the necessary extension methods for state conversion.

samples/DFlow.Samples.Persistence.EntityFramework · high confidence

Introduces AggregateBase as the new foundation for domain aggregates

A new abstract base class, AggregateBase, has been added to the DFlow library. This class provides a standardized structure for aggregate roots, managing the root entity, applying changes, and raising domain events. This change establishes a consistent pattern for implementing aggregates within the framework.

DFlow · high confidence

Introduces domain modeling primitives: EntityBase, Aggregates, and Validation

The DFlow library now provides core domain modeling components. A new \EntityBase\<TIdentity\>\ class manages entity identity, versioning, and domain events. The \IAggregate\<TChange\>\ interface and \VersionId\ struct support aggregate root modeling and version tracking. Additionally, a validation framework is introduced, including \BaseValidation\, \ValidationResult\, and \Failure\ classes to handle business rule enforcement.

src/DFlow · high confidence

Introduces new domain value objects and entities

Added new domain classes for the sample application, including value objects for Currency, Email, Name, and Money, as well as an EntityId and a User entity. These classes implement the ValueOf pattern and support features like identity, versioning, and validation state propagation.

samples/DFlow.Samples/Domain/BusinessObjects · medium confidence

Removals

Removed obsolete benchmark scenario files

Deleted the 'cenario1' benchmark directory, including the SQL script for the 'TB\_PRODUCT' table, the 'new' and 'stereotypy' subdirectories containing C\# source files (controllers, services, repositories, and configuration), and associated IDE/IDEA project metadata files. This removes the legacy benchmark implementations and their supporting infrastructure from the repository.

benchmark · high confidence

Behavioural changes

Async repository implementation for user persistence

The sample application now includes an asynchronous repository implementation for the User entity. A new IUserRepository interface and UserRepository class provide async methods (Add, Remove, Get, FindAsync) for database interactions using Entity Framework Core, including concurrency versioning checks and query filtering. A corresponding UserState persistence model class was also added to support this layer.

samples/DFlow.Samples/Persistence/Model · high confidence

Async support for domain event handlers

Domain event handlers in the business layer now support asynchronous execution. New handlers, such as UserAddedDomainEventHandler and UserAddedUpdateProjectionDomainEventHandler, implement the ExecuteHandle method returning Task, enabling non-blocking processing of domain events and updates to the read model.

samples/DFlow.Samples/Business/DomainEventHandlers · high confidence

Introduced persistent state model for entity tracking

Added IPersistentState interface and PersistentState abstract class to the persistence model, providing a base for entities to track persistence identifiers, creation timestamps, row versions, and soft-delete status. Also moved the IsExternalInit helper to the persistence model namespace.

src/DFlow.Persistence/Model · medium confidence

Major refactoring of DFlow with new solution structure and domain modeling improvements

DFlow has undergone a major refactoring to provide a more consistent programming model and improved domain modeling. The core domain layer has been consolidated back into the DFlow assembly, while the specifications pattern has been moved to a separate assembly. Key API changes include renaming BaseEntity to EntityBase, requiring all domain events to inherit from the DomainEvent abstract class, and introducing a new interface for raising events from Entities or Aggregates. The solution file (DFlow.sln) has been restructured to reflect these changes, and build configuration files (Directory.Build.targets) have been updated to support the new project layout.

(repo-wide) · high confidence

Refactored User aggregate to support optional domain events

The sample application's User aggregate has been refactored to make domain events an optional feature. This is demonstrated by introducing three distinct aggregation root implementations: one that raises a UserAddedEvent upon creation, one that includes event handling, and one that operates without events. This change allows users to choose whether or not to utilize domain events in their aggregate design.

samples/DFlow.Samples/Domain/Aggregates · medium confidence

Simplified repository interfaces for persistence layer

The DFlow persistence layer now exposes simplified, async-ready repository interfaces. IDbSession provides a generic session with a Repository accessor and an async SaveChangesAsync method. IRepository\<TState, TModel\> extends IRepositoryAppendOnly and adds a Remove method. IRepositoryAppendOnly defines the core persistence contract with an Add method and an async FindAsync query method that accepts a predicate and cancellation token. These interfaces streamline how the application interacts with data storage, supporting asynchronous operations and cleaner separation of concerns in the persistence layer.

src/DFlow.Persistence/Repositories · high confidence

Test coverage

Added domain layer tests for aggregates, business objects, and value objects; Added initial performance benchmarks for entity ID creation; Added test domain objects and aggregate factories; Added test specifications for business entity validation; Added test support classes for CQRS command handling; Added test support classes for domain events; Added tests for Money value object; Added tests for Outbox event persistence; Added tests for domain model and specification support; Added unit tests for CQRS command handlers.

Dependencies

Migrate sample and test projects to .NET 6 and update dependencies

The DFlow samples and test projects have been updated to target .NET 6.0, replacing the previous .NET 5.0 and .NET Core 3.1 targets. This includes updating the target framework in project files for samples (e.g., DFlow.Samples, SimplestApp) and test projects (e.g., DFlow.Tests, DFlow.Testing). Additionally, dependencies have been updated, such as Microsoft.EntityFrameworkCore to version 6.0.14, and other packages like xunit, AutoFixture, and BenchmarkDotNet have been adjusted to their respective versions. The project structure has also been reorganized, with some projects moved from benchmark directories to src and tests directories.

(dependencies) · medium confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 54 → 56 (+1.9)

Lenses

  • Code Health 98 → 98 (+0.0)
  • Architecture 90 → 90 (+0.0)
  • Maturity 65 → 65 (+0.0)
  • Readiness 58 → 70 (+11.7)
  • Security 35 → 35 (+0.0)
  • Domain Modelling 100 → 100 (+0.0)
  • Performance 79 (new)

Resolved (9)

  • Bounded contexts not declared
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • redundant comment (src/DFlow.Persistence/IDbSession.cs)

New (8)

  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • redundant comment (src/DFlow.Persistence/IDbSession.cs)

Architecture

  • Unchanged — 1 containers · 2 contexts · 0 edges

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

roadtoagility/dflow was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 3 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit aea989dbbfa7fce4ee64e00b7ba2d44fc1293a44 — the exact code this score is about.
  • Scored under rubric-2026.08.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer latest.