Skip to content

Base profile & modeling

This page describes how to model applications using the Base platform.

It focuses on:

  • simple types
  • REST modeling
  • method types
  • pseudocode for sequence diagrams
  • layers
  • how the model maps to OpenAPI + diagram artefacts

Release baseline

This page targets JoinedWorkz 1.3.80. Its model fragments and release-specific generator boundaries were source- and syntax-checked by 2026-07-26. Exact built output paths belong to the separately verified Base example.


1. Simple types

Provided by the common-base model Base.cmn:

  • String, Integer, Long, Boolean
  • Date, Time, Timestamp
  • semantic helper types like Id

Used across all higher‑level platforms.


2. REST modeling with resources

Example:

cmn
resource /hello as Greeting {
    read sayHello()
}

2.1 Method types

Base provides:

Raw method types:

  • get → GET
  • post → POST
  • put → PUT
  • patch → PATCH
  • delete → DELETE

Opinionated (CRUD):

  • create → POST
  • read → GET
  • update → PUT
  • query → GET with optional pagination

Release 1.3.80 contains both a raw and an opinionated delete declaration with the same name. Their defaults are not uniquely addressable. For a Base-only model, define a uniquely named DELETE method type instead of relying on delete() defaults. SpringBoot users can use deleteEntity.

Example:

cmn
resource /customers as Customer[] by id {
    create()
    read readCustomer()
    update()
    query()
}

3. Types

Basic:

cmn
type Greeting {
    message*: String
}

Complex types show up in datatype diagrams (hierarchy, references).


4. Pseudocode (optional)

CMN includes pseudocode syntax inside provided component resources. Diagram generation uses this model content to create sequence diagrams:

This is an independent Greeting follow-on, not part of the minimal one-model Quickstart.

cmn
component GreetingBackend {
    provide /hello subPackage='greeting.v1' controller="GreetingV1Controller" {

        read {
            if 'is morning' {
                [[ return 'Good Morning' ]]
            } else 'is evening' {
                [[ return 'Good Evening' ]]
            } else {
                [[ return 'Hello']]
            }
        }
    }
}

5. Layers

Layers can be defined:

cmn
core package com.example.demo
platform Base
cmn
api package com.example.demo.api
platform Base

The layer is available to profiles and generators, but its meaning is facility- and generator-specific. The Base diagram and OpenAPI generators in release 1.3.80 do not derive routing or diagram organisation from it. Tag-aware Java generators can use it as a source tag; see the multi-module outlet guide.


6. Summary

The Base facility allows you to:

  1. define types
  2. define REST resources
  3. use method types
  4. model processes
  5. generate OpenAPI and diagrams