Layered
The layered reading generates the classic Spring Boot layers: entity, DTO, mapper, repository,
XxxCoreService + XxxService, controller - for every entity marked @expose (or @service
without a controller).
| Bundle | When |
|---|---|
jpa-springboot | architecture = 'layered', Java - the same output as 2.x (apart from the 2.x bug fixes the history lists), checked on every pull request |
jpa-springboot-v3 | the same with -Pv3: only the imports in use, class annotations written by rules, access checks, the write-path checks and problem+json answers of the v3 bundles |
jpa-springboot-kt | language = 'kotlin' |
Package layout
The reference project elasticore-template names every package in its env.yml:
blueprint/content/env.yml (elasticore-template)
namespace:
entity: io.elasticore.blueprint.domain.content.entity
dto: io.elasticore.blueprint.domain.content.dto
enumeration: io.elasticore.blueprint.domain.content.enums
repository: io.elasticore.blueprint.domain.content.repository
service: io.elasticore.blueprint.domain.content.service
control: io.elasticore.blueprint.domain.content.controller
port: io.elasticore.blueprint.domain.content.port
entity/ JPA entity + Q class (Specification metadata)
dto/ DTO, KeyDTO, SrchDTO, Mapper
repository/ Spring Data JPA repository
service/ CoreService (managed) + Service (yours)
controller/ REST controller
enums/ enum classes
What the 2.x-compatible output does not do
jpa-springboot keeps the 2.x output, so the 3.0 domain rules are not in it: @access, @owner and
@password are not enforced - the generator warns ... which the selected rules do not enforce -
and states:, @compute and @snapshot are not generated. Kotlin's jpa-springboot-kt enforces
@access, @owner and @password, not states:, @compute or @snapshot. For those, use
DDD or hexagonal.
When to choose it
- A 2.x project upgraded to 3.0 that wants the rule engine with the output it already has.
- Plain CRUD where aggregates, sealed roots and ports add nothing.
Samples
elasticore-template- the 2.x reference project; its generated sources are the golden files of the compatibility checks.elasticore-template-kt- Kotlin,language = 'kotlin'; most of its domains combinejpa-springboot-ktwith DDD rules inenv.yml(rules: [jpa-springboot-kt, ddd-aggregate, ddd-reference, ddd-value-object-kt]), itsshopdomain useshexagonal-springboot-kt.