Model-Driven Development Philosophy
Overview
ElastiCORE is a framework built on the Model-Driven Development (MDD) paradigm. You declaratively define domain models using a YAML-based DSL, and the framework automatically generates complete Spring Boot application code.
This approach maximizes development productivity while ensuring code quality and consistency.
Core Principles
1. Single Source of Truth (SSOT)
In ElastiCORE, the YAML DSL definition serves as the Single Source of Truth (SSOT).
# This single definition is the standard for everything
entity:
User:
meta: entity @expose(20)
fields:
userId: long @id @sequence
name: string(100)! @search(like)
email: string(255)! @search(eq)
From this single definition, all of the following are automatically generated:
- JPA Entity classes: Database mappings
- DTO classes: Data transfer objects
- Repository interfaces: Data access layer
- Service classes: Business logic layer
- Controller classes: REST API endpoints
- SearchDTO: Search condition objects
- Q classes: Specification-based dynamic queries
- JUnit test code: Automated tests
- All related code is updated in bulk when the model changes
- Inconsistencies between code artifacts are prevented at the source
- Refactoring is safe and fast
2. AI Safe Architecture
ElastiCORE is designed with an architecture that is safe for the AI era.
Why AI Safe?
In traditional development, it is difficult to verify the quality of code produced by AI code generation tools. In contrast, ElastiCORE offers:
- Declarative Modeling: AI only needs to generate YAML model definitions
- Deterministic Code Generation: The same model always produces the same code
- Verified Templates: Code generation templates apply pre-verified best practices
- Structural Constraints: Clear model grammar prevents invalid definitions upfront
Traditional AI Code Generation:
AI → [Arbitrary code] → Hard to verify → Risky
ElastiCORE + AI:
AI → [YAML model] → ElastiCORE → [Verified code] → Safe
Structural Safety
- Model-level verification: You only need to verify the model, not the code
- Consistent patterns: All generated code follows the same architectural patterns
- Traceability: Every piece of generated code can be traced back to the source model
3. Deterministic Code Generation
ElastiCORE's code generation is deterministic:
- Same input → Same output: The same DSL definition always produces the same code
- Predictable: Developers can accurately predict what code will be generated
- Reproducible: Identical results in any environment
# Produces the same result regardless of when or where it is run
./gradlew elcore
4. Declarative Modeling
ElastiCORE lets you define "What" you want, and the framework handles the "How".
# Developer defines "what"
entity:
Product:
meta: entity @expose(20) @audited
fields:
name: string(200)! @search(like)
price: bigdecimal(10.2) @search(between)
Things that are handled automatically without developer intervention:
- JPA mapping strategies
- REST API endpoint design
- Search/pagination logic
- DTO conversion logic
- Audit logging configuration
Development Workflow
1. Model Design
Analyze business requirements
↓
Design domain model
↓
Write YAML DSL
2. Code Generation
./gradlew elcore
3. Customization
Review generated code
↓
Add business logic (within block comments)
↓
Test and verify
4. Iterative Improvement
Modify model
↓
Regenerate
↓
Test
Architecture Layers
The code generated by ElastiCORE follows clean architecture:
| Layer | Description |
|---|---|
| Controller Layer | REST API endpoints |
| Service Layer | Business logic |
| Repository Layer | Data access |
| Entity Layer | Domain model |
| Port Layer | External system communication |
Traditional Development vs ElastiCORE
| Aspect | Traditional Development | ElastiCORE |
|---|---|---|
| Code Writing | Manually implement all layers | DSL definition → Auto-generation |
| Consistency | Varies by developer | Always the same pattern |
| Refactoring | Manually modify multiple files | Modify model → Bulk regeneration |
| Documentation | Separate from code, hard to sync | Model itself is living documentation |
| Quality Assurance | Depends on code review | Guaranteed by verified templates |
| AI Utilization | Hard to verify code quality | Model verification is sufficient |
| Onboarding | Time needed to understand project structure | Learn the DSL and start immediately |
Suitable Projects
ElastiCORE is particularly well-suited for the following types of projects:
- Data-centric applications: CRUD-based business systems
- Microservices: Service development with consistent patterns
- Enterprise systems: Large-scale domain model management
- Rapid prototyping: Turn ideas into working systems instantly
- AI-collaborative development: AI generates models, ElastiCORE guarantees the code
Next Steps
- DSL Overview - Learn YAML-based declarative modeling
- Code Generation - Understand the code generation process
- Project Structure - Explore the generated project structure