Quarkus BCE Backend Workflow
Scope & Directory Boundary
- STRICT BOUNDARY: Operate ONLY inside
backend/. Never touchfrontend/files. - Architecture: Strict Adam Bien BCE pattern (
com.app.<domain>.{boundary, control, entity}). - Tech Stack: Quarkus, Jakarta EE (
jakarta.*ONLY—neverjavax.*ororg.springframework.*).
2-Phase Execution Gate
Phase 1: Contract & Spine (STOP FOR HUMAN REVIEW)
entity: Create/update immutable Javarecordpayloads (with@NotNull,@NotBlank,@Schema) and JPA/Panache entities inside..<domain>.entity. Zero dependencies oncontrolorboundary.boundary: Create/update JAX-RS@Pathresource signatures (@Transactional,@RolesAllowed,@Operation) inside..<domain>.boundary.- Tests: Create/update failing JUnit
@QuarkusTestor unit test stubs inbackend/src/test/java/..<domain>/boundary/. - PAUSE: Show the diff of
entity,boundary, and tests to the user. Wait for approval before writingcontrolimplementation.
Phase 2: Implementation & Schema Export
control: Implement business logic inside..<domain>.control(@ApplicationScoped). Never call another domain'scontroldirectly; always go through itsboundary.- Verify & Export Contract: Run inside
backend/:./mvnw test
Java 25 LTS Language & JVM Rules (Mandatory)
Target Java 25 LTS exclusively (<maven.compiler.release>25</maven.compiler.release>). Never write legacy Java 8/11/17 boilerplate:
- Exhaustive Switch & Record Deconstruction (
control&entity):- Model domain outcomes and state machines using
sealed interface+recordimplementations inentity. - In
control, process them using exhaustiveswitchexpressions with record pattern deconstruction and guardedwhenclauses (e.g.,case PaidOrder(var id, var total) when total > 1000 -> ...). - NEVER include a
defaultbranch on asealed interfaceswitch so the Java 25 compiler enforces exhaustiveness when new states are added.
- Model domain outcomes and state machines using
- Flexible Constructor Bodies (JEP 513):
- Perform fail-fast validation and data normalization directly inside constructors before calling
super(...)orthis(...)rather than creating bloated static helper methods.
- Perform fail-fast validation and data normalization directly inside constructors before calling
- Unnamed Variables (
_):- Always use
_for unused lambda parameters, ignored exception variables, or unused deconstructed record components (e.g.,case Order(var id, _, _)).
- Always use
- Virtual Threads & Scoped Values (JEP 506):
- For blocking I/O endpoints in Quarkus
boundary, prefer@RunOnVirtualThreadover reactiveUni<T>chains unless streaming is required. - Never use
ThreadLocal; always use Java 25ScopedValue<T>if contextual state must be passed within a thread scope.
- For blocking I/O endpoints in Quarkus
- Modern Collections & Stream Gatherers (JEP 485):
- Use
SequencedCollectionmethods (.getFirst(),.getLast(),.reversed()) instead of index mathlist.get(list.size() - 1). - Use
Stream.gather(Gatherers.windowFixed(...))instead of manual chunking loops.
- Use
- No Preview Flags Unless Requested:
- Stick to finalized Java 25 LTS features (do not enable
--enable-previewfor JEP 507 primitive patterns or JEP 505 structured concurrency unless explicitly asked).
- Stick to finalized Java 25 LTS features (do not enable