How making/yavi works
Main Components
a. Core Validation Engine
• Core validator components (Validator, ValidatorBuilder, ConstraintViolations)
b. Constraint System
• This as a major subsystem connected to the core
• Different types of constraints:
• Primitive type constraints (Integer, String, etc.)
• Collection constraints
• Custom constraints
c. Builder Framework
• As a separate component that interfaces with the core
• ValidatorBuilder and its related components
Key Relationships to Highlight
a. Data Flow
• Input flow: Object → Validator → Validation Result
• Constraint application flow: ValidatorBuilder → Validator → Constraints
b. Component Integration
• How the builder pattern connects to the core validator
• How constraints are applied to different types
• Relationship between validators and violation reporting
Architectural Patterns to Emphasize
a. Builder Pattern Implementation
• ValidatorBuilder hierarchy
• How it constructs validators
b. Constraint Chain
• How multiple constraints can be chained
• Type-safe nature of constraints
Detailed Components
Core Layer:
• Core Validator |
• Validator |
• ConstraintViolations|
• ValidatorBuilder |
Constraint Layer:
• Constraint System |
• Primitive Constraints |
• Custom Constraints |
• Collection Constraints|
Builder Layer:
• Builder Framework |
• ValidatorBuilder |
• ConstraintBuilder |
• ArgumentsBuilder |
Implementation Details
• Rectangles for core components
• Rounded rectangles for constraints
• Hexagons for builders
• Relationship types
Additional Elements
• Validation flow direction
• Error handling paths
• Thread-safe nature of validators
• How custom constraints can be integrated
• No reflection usage
• No runtime annotations
• Support for any object type
• Thread-safe validation
Remember to maintain a balance between detail and clarity, focusing on the core architectural components while providing enough detail to understand the system's operation.
This design should reflect YAVI's philosophy of being lightweight, type-safe, and flexible while maintaining high performance through its lambda-based approach.