davyddd/dddesign
61.4
Adequate · 9 November 2026
819
lines of production code
Python
primary language
7
measurements over time
What this system is
Features
Add BaseEnum and ChoiceEnum base classes for domain constants
New base classes for enumerations have been introduced in the constants module to standardize how domain constants are defined and used. BaseEnum provides a string representation of its value and a utility method to check if a specific value exists within the enum. ChoiceEnum extends this functionality to support UI-friendly patterns by offering a method to generate a human-readable title from the enum name (converting underscores to spaces and capitalizing) and a class method to return a tuple of value-title pairs suitable for dropdowns or selection lists.
dddesign/structure/domains/constants · high confidence
Initial package structure for domain design
The \dddesign.structure\ package and its \domains\ subpackage are introduced, exposing the core architectural layers (applications, domains, infrastructure, services) and specific domain components (aggregates, constants, dto, entities, errors, value\objects) via \\\all\\_\ declarations for cleaner imports.
dddesign/structure, dddesign/structure/domains · high confidence
Initial release of dddesign package with type hints
The dddesign package is introduced, exposing the structure, unittest, and utils submodules. The inclusion of a py.typed marker file indicates that the package now supports static type checking for consumers.
dddesign · high confidence
Introduce ApplicationFactory for dependency injection
The \dddesign/structure/applications\ module now provides \ApplicationFactory\ and \ApplicationDependencyMapper\ to manage application instance creation and dependency injection. \ApplicationFactory\ uses \ApplicationDependencyMapper\ configurations to map request attributes (defined via enums) to specific dependency implementations (such as adapters, repositories, or services), automatically instantiating the target application class with the resolved dependencies. The implementation uses Pydantic v2 patterns (\ConfigDict\, \PrivateAttr\) and enforces strict validation to ensure unique enum classes, unique attribute names, and that all required application fields are covered by the provided dependency mappers.
dddesign/structure/applications · high confidence
Introduce BaseError and CollectionError classes for structured error handling
Added new \BaseError\ and \CollectionError\ classes to the \dddesign.structure.domains.errors\ module. \BaseError\ enforces that message placeholders (e.g., \{name}\) are provided as keyword arguments during instantiation and automatically generates error codes from class names. \CollectionError\ acts as a container for multiple \BaseError\ instances, supporting iteration and addition of errors, with a boolean representation indicating whether any errors are present.
dddesign/structure/domains/errors · high confidence
Introduces Pydantic v2-based Aggregate and AggregateListFactory components
This change adds new domain aggregate components (\Aggregate\, \AggregateListFactory\, \AggregateDependencyMapper\) that are built on Pydantic v2, utilizing \ConfigDict\ for configuration (e.g., \validate\_assignment\, \frozen\) instead of the deprecated \allow\_mutation\ or \Config\ class. The \AggregateListFactory\ provides a mechanism to manage relationships between aggregates and entities, validating that attribute annotations and method return types are consistent to ensure correct data loading. These components replace older patterns and enforce stricter type checking and validation rules for domain models.
dddesign/structure/domains/aggregates · high confidence
Introduction of dddesign.utils package with base\_model export
The dddesign.utils package has been added to the project, exposing the base\model module as its primary public interface. This establishes a new utility location for shared base model functionality, making it accessible to other parts of the application through the package's \\init\\_.py.
dddesign/utils · high confidence
Introduction of immutable base models for DTOs and Value Objects
New base classes, DataTransferObject and ValueObject, have been added to the domain structure. These classes inherit from Pydantic's BaseModel and are configured with frozen=True, ensuring that instances are immutable once created. This change enforces data integrity by preventing accidental modification of these core domain entities.
_dddesign/structure/domains/dto, dddesign/structure/domains/value\objects · high confidence
New Entity base class with safe update method
A new Entity base class is introduced in the domains/entities module, inheriting from Pydantic's BaseModel with validation on assignment and support for arbitrary types. It provides an update method that accepts a data model and an optional set of fields to exclude, allowing users to safely update entity attributes while skipping unchanged fields to avoid frozen field errors.
dddesign/structure/domains/entities · high confidence
New MagicMock subclass for Pydantic BaseModel support
The dddesign.unittest package now includes a custom MagicMock class that extends the standard unittest.mock.MagicMock. When instantiated with a Pydantic BaseModel as a spec or spec\_set, this custom mock automatically configures its \_copy\_and\_set\_values method to return itself, simplifying test setups involving Pydantic models.
dddesign/unittest · high confidence
New base model utilities for change tracking, error handling, and data flattening
The dddesign.utils.base\_model package introduces several new utilities for Pydantic models. TrackChangesMixin allows models to track field modifications by comparing current values against an initial state, exposing changed fields, data, and diffs. The error handling suite includes create\_pydantic\_error\_instance for constructing custom Pydantic errors and wrap\_error to convert Pydantic ValidationErrors into a structured CollectionError. Additionally, flatten\_model\_dump provides a way to recursively flatten nested Pydantic model dumps into a single-level dictionary with configurable separators.
_dddesign/utils/base\model · high confidence
New domain components for UUID handling and error DTOs
The \dddesign/components\ package now exposes new domain primitives: an \AutoUUID\ value object that acts as a drop-in replacement for \uuid.UUID\ with automatic generation support and compatibility for both Pydantic v1 and v2, and an \Errors\ DTO for wrapping collection errors with appropriate status codes. These components are organized under \dddesign.components.domains\ alongside a standard \Error\ value object, providing a structured way to handle identifiers and validation failures in downstream applications.
dddesign/components · high confidence
Behavioural changes
Introduces Pydantic v2-based infrastructure components with strict method validation
The infrastructure layer now uses Pydantic v2 (via \ConfigDict\ and \frozen=True\) for its core domain components: \Repository\, \Service\, \ExternalAdapter\, and \InternalAdapter\. The \Repository\ class enforces a strict allowlist of permitted methods (including \exists\ and \count\), raising a \TypeError\ if any non-standard methods are defined, ensuring consistent and safe repository implementations.
dddesign/structure/infrastructure · high confidence
Migrated development tooling to dd-lib-stub v0.0.9
The project has adopted the dd-lib-stub v0.0.9 template, switching the dependency manager from Poetry to uv and updating the Python base image to 3.14. This migration introduces new linting and type-checking tools (ty, complexipy) alongside Ruff, standardizes the CI workflow stubs, and enforces a minimum Python version of 3.11 while dropping support for Python 3.9.
(repo-wide) · high confidence
Test coverage
1 commit adding/updating tests in tests; 1 commit adding/updating tests in tests/utils; Added structural validation tests for infrastructure components; Added tests for Aggregate domain components; Added tests for Application structure; Added tests for ApplicationFactory and ApplicationDependencyMapper; Added tests for DataTransferObject; Added tests for Entity component; Added tests for ValueObject component; Added tests for structure validators; Added unit tests for BaseEnum and ChoiceEnum components; Added unit tests for BaseError and CollectionError components; Added unit tests for Errors DTO and AutoUUID value object; Added unit tests for base model utilities.
Dependencies
Initial release of dddesign library with Python 3.11+ support
This change introduces the initial version (2.1.0) of the dddesign Domain Driven Design library. The package requires Python 3.11 through 3.14 and depends on pydantic (versions 2.1 to 2.14) and ddutils (versions 0.2.0 to 0.3.0). It is built using the uv\_build backend and includes development, testing, and linting tooling configurations.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 63 → 61 (-1.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 56 → 54 (-2.0)
- Readiness 59 → 59 (+0.0)
- Security 86 → 80 (-5.7)
Resolved (1)
- Documentation: no architecture or design documentation (README.md)
Changes since last survey
- 2 commits — 2 feature/other, 0 fixes
By area
- (root) — 2 commits
Notable commits
- change: Allow pydantic 2.14
- change: Update to dd-lib-stub v0.0.13: Python 3.15
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
davyddd/dddesign 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 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c28f4b5385708f07f582a4e8454eba843421805e — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-bb0cb800cd0f.