How rutaks/deja-vu works
Main Components
a) Core Domain Model:
• Schedule Management
• Temporal Expressions
• JSON Parsing Layer
Component Relationships
┌─────────────────────────────────────────────────────────────┐
• Client Application │
• ┬─────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• JSON Configuration │
• {scheduleCode, scheduleConfig: {schedule: [{...}]}} │
• ┬─────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• ScheduleJsonParser │
• ┬─────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Temporal Expressions │
• ┬─────────────────┬────────────────────────┤
• Basic Types │ Composite Types│ Schedule Types │
• DayInMonthTE │ - UnionTE │ - BasicSchedule │
• DayInWeekTE │ - DifferenceTE │ - ScheduleElement │
• RangeEveryYearTE│- IntersectionTE│ │
• ┴─────────────────┴────────────────────────┘
Implementation Details to Highlight
a) Input Layer:
• JSON configuration format
• Schedule configuration structure
• Validation rules
b) Processing Layer:
• ScheduleJsonParser transformation logic
• Temporal Expression hierarchy
• Schedule composition
c) Domain Model:
• Different types of temporal expressions
• Composite pattern implementation
• Schedule generation rules
Key Architectural Patterns
• Composite Pattern: For temporal expressions (UnionTE, DifferenceTE, etc.)
• Strategy Pattern: For different schedule types
• Factory Pattern: For creating temporal expressions
• Builder Pattern: For constructing schedules
Additional Notes
• TE suffix: Temporal Expression
• Relationship types between components
• Configuration format examples
• Common use cases (like the examples in README)