A fluent API for type-safe domain model validation and mapping using annotations, code generation, and a DSL.
dOOv is a Java library that provides a fluent, type-safe API for validating and mapping domain models. It uses annotations and code generation to create a domain-specific language (DSL), allowing developers to write complex validation and data transformation rules with compile-time safety. This approach reduces boilerplate code and helps prevent runtime errors in domain logic.
Java developers working with domain-driven design (DDD) who need robust, maintainable validation and mapping logic in their applications, particularly in enterprise or complex business domains.
Developers choose dOOv for its type-safe DSL that eliminates common validation errors at compile time, its fluent API that improves code readability, and its integration with existing Java ecosystems via annotations and code generation.
dOOv (Domain Object Oriented Validation) a fluent API for type-safe bean validation and mapping
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The DSL enforces validation and mapping rules at compile time, reducing runtime errors as emphasized in the key features and examples.
Supports chaining with and/or operators and methods like matchAny, allowing for readable, complex business logic without boilerplate code.
Provides a fluent API for data transformation between models with customizable converters, streamlining model-to-model conversions as shown in the mapping example.
Rules output plain text syntax trees via Readable#readable, aiding in debugging and documentation, as demonstrated in the syntax tree section.
Includes AssertJ-based assertions for validating rule behavior, making it easier to write and maintain tests for validation logic.
Requires annotating domain models with @Path and setting up code generation plugins, adding initial complexity and tying models to dOOv-specific infrastructure.
Compared to established frameworks like Hibernate Validator, dOOv has a smaller community, which may result in fewer third-party integrations or resources for troubleshooting.
The proprietary DSL and annotations make migration difficult; refactoring domain models and rules would be required if switching to another validation library.
The DSL and code generation layer can introduce slight overhead compared to direct Java code, which might be a concern in high-performance, latency-sensitive applications.