Skip to main content
ElastiCORE 3.0 is a release candidate: 3.0.261022-rc1 on Maven Central. Projects on the 2.2 line: see the 2.2 documentation.
Version: 3.0

Project layout and file ownership

The blueprint​

src/main/resources/blueprint/
shop/ a domain (one bounded context)
env.yml settings: domain name, packages, generation options
model/entity.yml entities - the part you write
model/enum.yml enumerations
model/dto.yml DTOs of your own (optional)
model/metrics.yml business measures (optional)
elasticore-*-guide.md the guides of the ElastiCORE version in use, copied on every build
schema.yml generated
semantic_model.yml generated with ossie-export
context-map.md generated when a domain declares context:

The guides (Korean) are copied into blueprint/ on every build, so a developer or an AI assistant reads the grammar of exactly the version the project uses.

The generated code​

With namespace: base: com.acme.shop the hexagonal layout fills these packages:

PackageHolds
domain.modelentities, enums, value objects, invariant listeners
domain.event / domain.service / domain.repositorydomain events / domain services / repository ports
applicationXxxCoreService (regenerated) and XxxService (yours)
application.dtoDTOs, search DTOs, the mapper
application.port.in / application.port.outuse cases (inbound ports) / query ports and port: interfaces
adapter.in.webREST controllers and the domain's XxxApiErrors
infrastructure.persistenceSpring Data repositories and the repository adapters

Any key written next to base wins. The layered, DDD and hexagonal presets are on Architectures; every namespace key is on env.yml settings.

Who owns a file - read its first lines​

The generator decides how to treat a file by its first lines.

Top of the fileOwnerWhat happens on the next generation
//ecd:... onlyThe generatorRewritten to follow the DSL. If someone edited it, it is skipped - SKIP(user-modified; -Pforce to overwrite) - and stops following the DSL
//ecd:... and a preserved block // !---------- ... // ------------!The generator, except the blockThe code in the block survives regeneration
//ecd:..., then // Initially generated by ElastiCORE; no longer managed - do not remove this line.You (generate-once)Never edited: regenerated to follow the DSL (REGENERATED(owned, never edited)). Edited: yours, left alone (SKIP(user-owned))
No ElastiCORE headerYouLeft alone (SKIP(no ElastiCORE header - yours) if it sits where a generated file would go)

A first line looks like this:

//ecd:914651935H20261002205859_V3.0
// Initially generated by ElastiCORE; no longer managed - do not remove this line.
package io.elasticore.sample.petstore.domain.model;

The //ecd: line carries a content hash: a file you edited is recognised by it and never overwritten.

Which files are generate-once​

Generated once, then yoursRegenerated every time
XxxService (the extension service)XxxCoreService
XxxControllerDTOs, search DTOs, the mapper, Q
XxxApiErrors (the error answers)entities, XxxBase, events, invariants
Xxx behaviour class of a split DDD rootrepositories, ports, adapters, use cases
XxxDomainService, XxxProcessManager, XxxFactoryXxxDomainServiceBase, XxxProcessManagerBase

Files generated without an //ecd: line and rewritten on every generation - never edit them: blueprint/schema.yml, blueprint/semantic_model.yml, blueprint/context-map.md, the copied guides, and src/main/resources/i18n/<domain>-messages.properties (a translation goes in a file of yours beside it, such as <domain>-messages_ko.properties).

What the generator still does for files you own​

  • The constructor of an extension service - when the core service's constructor changes (say, after switching to hexagonal), a file with nothing but the constructor is rewritten; otherwise the generator warns with the new super(...) call.
  • Table annotations of a split root (@Entity, @Table, @DynamicUpdate, @Audited) are kept in step with the DSL, leaving your other annotations and the body alone.
  • Files the DSL no longer produces are deleted at the end of a run that generated every domain (REMOVED(the DSL no longer produces it)) - only when nobody edited them; an edited one is kept, with a warning.

More on regenerating safely: Regenerating safely.