Skip to main content

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
Benefits of SSOT
  • 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:

  1. Declarative Modeling: AI only needs to generate YAML model definitions
  2. Deterministic Code Generation: The same model always produces the same code
  3. Verified Templates: Code generation templates apply pre-verified best practices
  4. 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:

LayerDescription
Controller LayerREST API endpoints
Service LayerBusiness logic
Repository LayerData access
Entity LayerDomain model
Port LayerExternal system communication

Traditional Development vs ElastiCORE

AspectTraditional DevelopmentElastiCORE
Code WritingManually implement all layersDSL definition → Auto-generation
ConsistencyVaries by developerAlways the same pattern
RefactoringManually modify multiple filesModify model → Bulk regeneration
DocumentationSeparate from code, hard to syncModel itself is living documentation
Quality AssuranceDepends on code reviewGuaranteed by verified templates
AI UtilizationHard to verify code qualityModel verification is sufficient
OnboardingTime needed to understand project structureLearn 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