Appearance
SpringBoot profile and canonical modeling
This page explains how to model for the SpringBoot platform so that you get the target architecture described in the target platform design.
1. Layer model in CMN
Use:
core– domain types and servicesapi– request/response DTOs + resourcesbackend– components, configuration
2. Special role of the api layer
API types = external DTOs
Core types = domain types
The platform generates:
- controllers using API types
- handlers using domain types
- mapping between them via MapStruct
3. Modeling domain vs API view
Define domain entity:
cmn
type<entity> Customer {
internalId**: Id
firstName*: Name
lastName*: Name
email: String(255)
}Define API view:
cmn
type CustomerView {
...Customer exclude internalId
}Use view in resource.
4. Handler‑aware modeling
Attach handler to resource methods or method types.
CRUD helper method types exist:
- createEntity
- readEntity
- updateEntity
- queryEntities
- deleteEntity
5. Outlet routing by layer
Route core and api to different modules:
properties
outlet.generatedJavaSource.api.directory=../webapp/src/generated/java6. Glue library and package overrides
Use:
properties
override-package.org.iworkz.core=...7. Putting it together
- Model domain in
core - Model API in
api - Add handlers or CRUD helpers
- Configure outlets
- Generate
