xmolecules/jmolecules
52.3
Adequate · 9 November 2026
3.2k
lines of production code
Java
with Kotlin
10
measurements over time
What this system is
This system is a Java and Kotlin library that provides a comprehensive set of annotations and marker interfaces for modeling architectural styles and domain-driven design concepts. It supports multiple patterns including CQRS, Hexagonal, Layered, and Onion architectures, as well as core DDD building blocks like entities, aggregates, and domain events. The library enables developers to explicitly mark and structure their code to enforce consistent architectural boundaries and domain modeling practices.
How it got here
2020 — DDD and architecture style annotations
7 changes.
This period focused on expanding the jMolecules library with comprehensive annotations for Domain-Driven Design and various architectural styles. New modules were introduced to support CQRS, Hexagonal, Layered, and Onion architectures, alongside foundational DDD building blocks like AggregateRoot and BoundedContext. The work established a standardized way to model domain concepts and enforce architectural boundaries through Java and Kotlin annotations.
2021–2025 — Architecture and DDD feature expansion
6 changes.
This period focused on expanding the library's architectural and domain-driven design capabilities, introducing new annotations for CQRS, Hexagonal Architecture, and Kotlin support. The team also standardized the Maven build environment and introduced a new stereotype meta-annotation to support structured configuration.
Features
Add AggregateRoot annotation for DDD modeling
The jMolecules DDD module now includes an \AggregateRoot\ annotation in both Java and Kotlin, allowing developers to mark classes as aggregate roots in a Domain-Driven Design context. This new annotation, which carries a \@Stereotype\ meta-annotation, provides a standardized way to identify the root entity of an aggregate, supporting the modeling of consistent rules and boundaries within the domain layer.
jmolecules-parent · high confidence
Added project infrastructure and tooling files
The repository now includes essential project configuration files to support development and build processes. This includes an .editorconfig for consistent code formatting, a .gitignore for build artifacts and IDE files, a CODE\_OF\_CONDUCT.md to establish community guidelines, a settings.xml for Maven deployment credentials, an application.yml for changelog configuration, and the Apache Maven Wrapper scripts (mvnw/mvnw.cmd) to ensure consistent Maven versions across environments.
(repo-wide) · high confidence
Introduce @Stereotype meta-annotation and supporting schemas
A new @Stereotype meta-annotation is added to the org.jmolecules.stereotype package, allowing developers to mark types or annotations as representing specific architectural or design elements. This change also introduces JSON Schema definitions for jMolecules stereotypes and stereotype groups, enabling structured configuration and validation of these stereotypes in project files.
jstereotype · high confidence
Introduce layered architecture annotations
The library now provides a set of Java annotations to mark classes and packages for a layered architecture. Specifically, @ApplicationLayer, @DomainLayer, @InfrastructureLayer, and @InterfaceLayer are introduced, each annotated with @Stereotype and @Documented, and configured with RUNTIME retention. These annotations allow developers to explicitly define architectural boundaries in their code, supporting domain-driven design practices by clearly separating application, domain, infrastructure, and interface concerns.
jmolecules-architecture/jmolecules-layered-architecture · high confidence
Introduce new jMolecules modules for architecture styles and events
The project now includes new Maven modules for CQRS, Hexagonal, Layered, and Onion architectural styles, alongside dedicated modules for Domain-Driven Design (DDD) and Events. A new 'jstereotype' module provides the foundational annotations, while a Kotlin-based 'kmolecules-ddd' module offers a Kotlin flavor of the DDD concepts. These modules depend on the core 'jstereotype' library and are managed by a new parent POM that sets the project version to 2.1.0-SNAPSHOT.
(dependencies) · high confidence
Introduces domain event abstractions and externalization support
Adds new annotations and interfaces to express CQRS concepts, including \DomainEvent\, \DomainEventHandler\, and \DomainEventPublisher\ in the \org.jmolecules.event.annotation\ package, alongside corresponding marker interfaces in \org.jmolecules.event.types\. The update also introduces the \@Externalized\ annotation and interface to mark domain events for external publication, and moves the \module-info.java\ to the JAR root.
jmolecules-events/src/main/java · medium confidence
Kotlin support for DDD building blocks
The kmolecules-ddd module now provides Kotlin counterparts for core Domain-Driven Design concepts, including annotations and type interfaces for AggregateRoot, Entity, Factory, Repository, Service, ValueObject, and Association. This enables Kotlin developers to use idiomatic Kotlin constructs to mark and model DDD elements such as entities, value objects, and associations, aligning the Kotlin API with the existing Java implementation.
kmolecules-ddd · high confidence
New DDD building block annotations and types
The library now provides a comprehensive set of Domain-Driven Design (DDD) building blocks. This includes new annotations such as @BoundedContext, @Module, @Association, @Entity, @Factory, @Repository, @Service, and @ValueObject, alongside corresponding marker interfaces and types like AggregateRoot, Association, Identifiable, and Identifier. These additions enable developers to explicitly model and identify core DDD concepts within their applications.
jmolecules-ddd/src/main · high confidence
New Hexagonal Architecture annotations with metadata support
The jmolecules-hexagonal-architecture module now includes new Java annotations for Hexagonal Architecture patterns, including @Adapter, @Application, @Port, @PrimaryAdapter, @PrimaryPort, @SecondaryAdapter, and @SecondaryPort. Each annotation now supports 'name' and 'description' attributes to provide metadata for external tooling, and all annotations use runtime retention to ensure they are available for reflection-based processing.
jmolecules-architecture/jmolecules-hexagonal-architecture · high confidence
Behavioural changes
Deprecate legacy CQRS annotations in favor of new architecture markers
The CQRS architecture module now provides new, non-deprecated annotation types in the \org.jmolecules.architecture.cqrs\ package (\Command\, \CommandDispatcher\, \CommandHandler\, \QueryModel\) that serve as the primary interface for expressing CQRS concepts. The corresponding annotations in the \org.jmolecules.architecture.cqrs.annotation\ package are now marked as deprecated and will be removed in version 2.0. Users should migrate their code to use the new annotations to ensure future compatibility.
jmolecules-architecture/jmolecules-cqrs-architecture/src/main/java · high confidence
Onion architecture annotations now use runtime retention and are documented
The Java annotations for the onion architecture (ApplicationRing, DomainRing, DomainModelRing, DomainServiceRing, and InfrastructureRing) have been updated to use runtime retention, making them available at runtime for frameworks that inspect annotations dynamically. Additionally, all these annotations are now marked with @Documented, ensuring they appear in generated JavaDoc. The stereotype metadata in jmolecules-stereotypes.json has been updated to reflect these changes.
jmolecules-architecture/jmolecules-onion-architecture · high confidence
Updated Maven Wrapper to version 3.9.11
The Maven Wrapper configuration has been updated to use version 3.3.4 of the wrapper script and to download Apache Maven 3.9.11 from the official Maven repository. This ensures that all developers and CI systems use a consistent, pre-configured version of Maven for building the project.
.mvn · high confidence
Test coverage
Added unit tests for the Association class
Added a new unit test class, AssociationUnitTests, which validates the behavior of the Association class. The tests cover static factory methods for creating associations from identifiers and aggregates, null argument rejection, equality checks, and reference comparison methods such as pointsTo and pointsToSameAggregateAs.
jmolecules-ddd/src/test · 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 53 → 52 (-0.5)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 76 → 76 (+0.0)
- Architecture 90 → 88 (-1.4)
- Maturity 41 → 41 (+0.0)
- Readiness 45 → 46 (+0.2)
- Security 84 → 77 (-6.5)
Resolved (4)
- Inconsistent generic signature between Java and Kotlin versions of the same logical operation. The Java version uses raw type wildcard Association<?, ID> while the Kotlin version uses Association<ID>. This creates an inconsistency in how the API is consumed across languages, potentially causing interoperability issues or confusion about whether the association type parameter must match exactly.
- Inconsistent naming convention for identity access between Java and Kotlin. Java uses the standard getter getId(), while Kotlin exposes it as a property id. While this is idiomatic for each language, it represents a surface inconsistency in the conceptual API design if the library aims for a unified cross-language contract. More critically, the Java Identifiable interface uses getId() while the Kotlin Identifiable interface uses id. This is expected for language idioms, but combined with the Association inconsistency above, it highlights a lack of unified design strategy.
- Semantic ambiguity between 'for' and 'pointsTo' methods. 'forAggregate' and 'forId' appear to construct or identify an association, while 'pointsTo' appears to check a relationship. However, the naming convention is inconsistent: 'for' suggests creation/lookup, 'pointsTo' suggests a boolean check. It is unclear if 'forId' creates an association to an ID or checks if the current association points to that ID. Furthermore, having both 'forAggregate' and 'pointsTo(aggregate)' suggests overlapping intent (identifying the target aggregate).
- The SimpleAssociation type in Kotlin includes equals, hashCode, and toString methods explicitly, while the Java Association type does not show these. This suggests SimpleAssociation is a data class or value object in Kotlin, whereas Association in Java is an interface. This creates a semantic inconsistency: one is a concrete implementation with value semantics, the other is an interface. If SimpleAssociation is meant to be the Java equivalent, it should be an interface or abstract class, not a concrete class with value semantics.
New (1)
- High interface indirection
Architecture
- Unchanged — 0 containers · 2 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
xmolecules/jmolecules 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 20d2636beba2e3cb8f0a9b62c07e3606c49da84f — 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.