S++Core systems, human-reviewable
ENGLISH EDITION · OCTOBER 15, 2026
ContentsComplete book

Chapter 7 — Queries, Calculations, Validations and Ordinary Updates

© 2026 S++ project contributors. All rights reserved. Book copyright.

Non-quantum atomic services retrieve, derive, judge and persist business facts. Their separation prevents hidden side effects and makes a scenario's dependencies inspectable.

Query: Confirm Existing Facts

A built-in query completes required participant facts through APP/PHY mappings. An absent participant is not the same as an unavailable source. Queries may overlap only when their inputs are ready and their in-memory completion ranges do not conflict; the scheduling rules appear in Part II and Appendix B.

Calculation: Derive Prepared Results

A calculation uses facts already present and writes derived results, such as quantity × agreedUnitPrice or an order subtotal. It does not access repositories, perform validation, save facts or start a scenario. The explicit exception to the atomic no-call rule is calculation-to-calculation reuse.

Calculation call graphs must be acyclic, including indirect calls. Loops over lines are permitted, but an iterative formula must still have a termination rule. A scenario obtains missing facts and validates business preconditions before invoking calculations that require them.

Validation: Control Execution

A validation judges eligibility or consistency without changing participant facts. A failed validation stops its enclosing execution scope: directly in a transaction block it causes rollback; inside a nested serial block it ends that block. breakTransaction explicitly rolls back from any depth. The caller's scenario structure therefore matters to the meaning of rejection.

Validations do not call other validations or scenarios. Calculations derive amounts; validations decide whether the prepared conditions permit continuation.

Ordinary Update: Save Complete Facts

Ordinary updates are built-in; application authors do not supply their implementations. They persist descriptive properties or status using facts prepared by earlier queries, calculations and quantum results. They do not conceal additional business queries or calculations.

Within a transaction boundary, the generated plan places quantum transactions before ordinary saves. When further preparation is needed after settlement, a serial phase completes it before the relevant save. Independent, fully prepared saves can then run concurrently. This intra-transaction freedom must not be confused with conflict protection between separate requests updating the same record.

Scenario: The Only General Composition Layer

Atomic services keep one responsibility; scenarios combine them and express dependencies, serial groups, transactional boundaries and completion. An order-payment scenario can query roles, validate terms, calculate the due amount, perform quantum settlement and then save the order and receipt. The ordinary save cannot start before its inputs exist.

These constraints let readers locate business decisions and side effects. Language-level forms are specified in Chapters 15–17; dependency analysis, concurrency and deployment are developed in Part II.


Part Contents · Full Book Contents · Previous Chapter · Next Chapter