@radicaltools/mcp 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-Z7THA3L5.js → chunk-2SZDTOYJ.js} +65 -33
- package/dist/{elkLayout-TAUBPPVN.js → elkLayout-VYJDCCIT.js} +1 -1
- package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
- package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
- package/dist/hub-catalogue/concern/concern-api-evolution.radical +449 -210
- package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
- package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
- package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
- package/dist/hub-catalogue/concern/concern-architecture-style.radical +287 -131
- package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
- package/dist/hub-catalogue/concern/concern-authentication.radical +247 -37
- package/dist/hub-catalogue/concern/concern-authorization.radical +311 -89
- package/dist/hub-catalogue/concern/concern-availability.radical +287 -63
- package/dist/hub-catalogue/concern/concern-backend-stack.radical +300 -381
- package/dist/hub-catalogue/concern/concern-backup-recovery.radical +385 -129
- package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
- package/dist/hub-catalogue/concern/concern-capacity.radical +194 -81
- package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
- package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
- package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
- package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
- package/dist/hub-catalogue/concern/concern-communication-style.radical +473 -167
- package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
- package/dist/hub-catalogue/concern/concern-data-consistency.radical +339 -308
- package/dist/hub-catalogue/concern/concern-data-store.radical +480 -158
- package/dist/hub-catalogue/concern/concern-decomposition.radical +260 -85
- package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
- package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
- package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
- package/dist/hub-catalogue/concern/concern-deployment.radical +343 -92
- package/dist/hub-catalogue/concern/concern-encryption.radical +339 -76
- package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
- package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
- package/dist/hub-catalogue/concern/concern-frontend-stack.radical +467 -160
- package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
- package/dist/hub-catalogue/concern/concern-infrastructure.radical +1300 -268
- package/dist/hub-catalogue/concern/concern-integration-resilience.radical +88 -51
- package/dist/hub-catalogue/concern/concern-messaging.radical +173 -140
- package/dist/hub-catalogue/concern/concern-module-boundaries.radical +162 -159
- package/dist/hub-catalogue/concern/concern-observability.radical +224 -275
- package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
- package/dist/hub-catalogue/concern/concern-personal-data.radical +637 -122
- package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
- package/dist/hub-catalogue/concern/concern-rate-limiting.radical +433 -141
- package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
- package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
- package/dist/hub-catalogue/concern/concern-secrets.radical +332 -74
- package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
- package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
- package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
- package/dist/hub-catalogue/concern/concern-supply-chain.radical +257 -183
- package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
- package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
- package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +271 -137
- package/dist/hub-catalogue/concern/concern-test-strategy.radical +243 -224
- package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
- package/dist/index.js +1001 -230
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "concern-architecture-style",
|
|
4
4
|
"category": "concern",
|
|
5
5
|
"name": "Architecture style",
|
|
6
|
-
"description": "The structure inside one deployable: layers, ports and adapters, clean rings or vertical slices; where the business logic lives; whether reads and writes are separated; and how far the domain stays independent of the framework.",
|
|
6
|
+
"description": "The structure inside one deployable: layers, ports and adapters, clean rings or vertical slices; where the business logic lives; whether reads and writes are separated; and how far the domain stays independent of the framework. The snippets are for the JVM (ArchUnit, jMolecules, JaCoCo); each tool line names the .NET, TypeScript and Python equivalent.",
|
|
7
7
|
"tags": [
|
|
8
8
|
"architecture",
|
|
9
9
|
"layered",
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"title": "Martin Fowler: AnemicDomainModel",
|
|
47
47
|
"url": "https://martinfowler.com/bliki/AnemicDomainModel.html"
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
"title": "Eric Evans: Domain-Driven Design (reference and summary)",
|
|
51
|
+
"url": "https://www.domainlanguage.com/ddd/"
|
|
52
|
+
},
|
|
49
53
|
{
|
|
50
54
|
"title": "Martin Fowler: CQRS",
|
|
51
55
|
"url": "https://martinfowler.com/bliki/CQRS.html"
|
|
@@ -54,6 +58,10 @@
|
|
|
54
58
|
"title": "microservices.io, Command Query Responsibility Segregation (CQRS)",
|
|
55
59
|
"url": "https://microservices.io/patterns/data/cqrs.html"
|
|
56
60
|
},
|
|
61
|
+
{
|
|
62
|
+
"title": "ISO/IEC 25010, Maintainability: modularity, testability",
|
|
63
|
+
"url": "https://iso25000.com/index.php/en/iso-25000-standards/iso-25010"
|
|
64
|
+
},
|
|
57
65
|
{
|
|
58
66
|
"title": "jMolecules: architecture and DDD concepts as code",
|
|
59
67
|
"url": "https://github.com/xmolecules/jmolecules"
|
|
@@ -79,12 +87,12 @@
|
|
|
79
87
|
{
|
|
80
88
|
"value": "hexagonal",
|
|
81
89
|
"label": "ports and adapters (hexagonal)",
|
|
82
|
-
"description": "A core with the use cases and domain rules and no framework, database or transport in it; it declares ports, and adapters for HTTP, the database and messaging implement them. Pick it when the business rules are the valuable part and must be tested without infrastructure, or when the database, broker or transport is likely to change."
|
|
90
|
+
"description": "A core with the use cases and domain rules and no framework, database or transport in it; it declares ports, and adapters for HTTP, the database and messaging implement them. Pick it when the business rules are the valuable part and must be tested without infrastructure, or when the database, broker or transport is likely to change. Goes with a domain kept plain of framework annotations."
|
|
83
91
|
},
|
|
84
92
|
{
|
|
85
93
|
"value": "clean",
|
|
86
94
|
"label": "clean or onion rings",
|
|
87
|
-
"description": "Concentric rings (entities, use cases, interface adapters, frameworks and drivers) with every source dependency pointing inwards and one class per use case. Pick it for a large, long-lived domain with many use cases and several delivery channels (web, API, jobs, messaging), where the extra mapping pays for itself."
|
|
95
|
+
"description": "Concentric rings (entities, use cases, interface adapters, frameworks and drivers) with every source dependency pointing inwards and one class per use case. Pick it for a large, long-lived domain with many use cases and several delivery channels (web, API, jobs, messaging), where the extra mapping pays for itself. Goes with a domain kept plain of framework annotations."
|
|
88
96
|
},
|
|
89
97
|
{
|
|
90
98
|
"value": "slices",
|
|
@@ -140,18 +148,18 @@
|
|
|
140
148
|
"key": "FRAMEWORK",
|
|
141
149
|
"title": "Framework",
|
|
142
150
|
"label": "How far does the domain code stay independent of the framework?",
|
|
143
|
-
"hint": "Annotations from the ORM and the validation library in domain classes save mapping code, and tie the domain to those libraries and their upgrades.",
|
|
151
|
+
"hint": "Annotations from the ORM and the validation library in domain classes save mapping code, and tie the domain to those libraries and their upgrades. Only layers and vertical slices admit them: ports and adapters and clean rings keep their core plain.",
|
|
144
152
|
"defaultValue": "pure",
|
|
145
153
|
"options": [
|
|
146
154
|
{
|
|
147
155
|
"value": "pure",
|
|
148
|
-
"label": "
|
|
149
|
-
"description": "Domain classes import nothing but the language and the
|
|
156
|
+
"label": "plain language, no framework annotations",
|
|
157
|
+
"description": "Domain classes import nothing but the language, the domain itself and the jMolecules role annotations; persistence and transport models live in adapters with explicit mapping. Pick it with ports and adapters or clean rings, a domain expected to outlive the framework, or several persistence or delivery technologies."
|
|
150
158
|
},
|
|
151
159
|
{
|
|
152
160
|
"value": "annotations",
|
|
153
161
|
"label": "mapping and validation annotations allowed",
|
|
154
|
-
"description": "Domain classes may carry ORM mapping and validation annotations (Jakarta Persistence
|
|
162
|
+
"description": "Domain classes may carry ORM mapping and validation annotations (Jakarta Persistence and Bean Validation; EF Core attributes on .NET) but call no framework service, transaction, HTTP or messaging API. Pick it to save mapping code when the ORM is a settled choice and the domain is mapped one to one to tables; not with ports and adapters or clean rings, whose core imports no framework."
|
|
155
163
|
}
|
|
156
164
|
]
|
|
157
165
|
},
|
|
@@ -178,7 +186,7 @@
|
|
|
178
186
|
"y": 0,
|
|
179
187
|
"kind": "brief",
|
|
180
188
|
"source": "Hub concern pack: Architecture style",
|
|
181
|
-
"description": "Each deployable holds code several people change every week. Where a business rule, a query, a framework call or a mapping goes should follow from a decided structure, not from whoever wrote it first: then the rules can be tested without starting a database, a change of framework or database stays in one place, a new feature has an obvious home, and reads and writes each get the shape they need. The structure has to hold as the code grows, so the build checks it."
|
|
189
|
+
"description": "Each deployable holds code several people change every week. Where a business rule, a query, a framework call or a mapping goes should follow from a decided structure, not from whoever wrote it first: then the rules can be tested without starting a database, a change of framework or database stays in one place, a new feature has an obvious home, and reads and writes each get the shape they need. The structure has to hold as the code grows, so the build checks it. Every rule below assumes one package layout under com.example.shop: `domain` holds the domain model (`domain.model`) and domain services (`domain.service`); `application` holds the use cases or transaction scripts and the ports (`application.port.in`, `application.port.out`); `adapter.web`, `adapter.persistence`, `adapter.messaging` and `adapter.jobs` hold the adapters, which are also the presentation and data-access layers; `features.<name>` is one vertical slice; `query` holds read models (in a slice, `features.<name>.query`). Test classes are left out of the rules."
|
|
182
190
|
},
|
|
183
191
|
{
|
|
184
192
|
"id": "req-layers",
|
|
@@ -202,7 +210,7 @@
|
|
|
202
210
|
"x": 260,
|
|
203
211
|
"y": 130,
|
|
204
212
|
"ears_type": "ubiquitous",
|
|
205
|
-
"action": "keep the core free of framework, database, messaging and HTTP imports, let adapters reach it only through the ports it declares, and let no adapter use another adapter",
|
|
213
|
+
"action": "keep the core (domain and application) free of framework-service, database-driver, messaging and HTTP imports, let adapters reach it only through the ports it declares, and let no adapter use another adapter",
|
|
206
214
|
"rationale": "The application is driven and drives the outside world only through ports, so each side can be replaced or tested alone (Cockburn, Hexagonal architecture).",
|
|
207
215
|
"hubWhen": {
|
|
208
216
|
"STYLE": [
|
|
@@ -217,7 +225,7 @@
|
|
|
217
225
|
"x": 260,
|
|
218
226
|
"y": 260,
|
|
219
227
|
"ears_type": "ubiquitous",
|
|
220
|
-
"action": "point every source dependency inwards (
|
|
228
|
+
"action": "point every source dependency inwards (adapters, then application services, then domain services, then the domain model), with 0 outward dependencies and each use case as one interactor class in application.usecase implementing an input boundary from application.port.in",
|
|
221
229
|
"rationale": "The dependency rule is what makes the inner rings independent of the UI, the database and the frameworks (Martin, The Clean Architecture).",
|
|
222
230
|
"hubWhen": {
|
|
223
231
|
"STYLE": [
|
|
@@ -232,7 +240,7 @@
|
|
|
232
240
|
"x": 260,
|
|
233
241
|
"y": 390,
|
|
234
242
|
"ears_type": "ubiquitous",
|
|
235
|
-
"action": "keep each feature's endpoint, handler, validation and data access in its own slice, with 0 dependencies from one slice on another and
|
|
243
|
+
"action": "keep each feature's endpoint, handler, validation and data access in its own slice under features, with 0 dependencies from one slice on another and 0 dependencies from the common domain folder on any slice",
|
|
236
244
|
"rationale": "Coupling is minimised between slices and maximised within one, so a change to a feature stays in its slice (Bogard, Vertical Slice Architecture).",
|
|
237
245
|
"hubWhen": {
|
|
238
246
|
"STYLE": [
|
|
@@ -247,27 +255,22 @@
|
|
|
247
255
|
"x": 260,
|
|
248
256
|
"y": 520,
|
|
249
257
|
"ears_type": "ubiquitous",
|
|
250
|
-
"action": "test the business rules with unit tests that start no database, broker or web server and cover at least {{DOMAIN_COVERAGE}}% of the lines of
|
|
251
|
-
"rationale": "Rules that can only be tested through the infrastructure are tested slowly and rarely; testability is part of maintainability (ISO/IEC 25010)."
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
"x": 260,
|
|
258
|
-
"y": 650,
|
|
259
|
-
"ears_type": "ubiquitous",
|
|
260
|
-
"action": "make every operation either a command that changes state and returns at most an identifier or a result code, or a query that returns data and changes nothing",
|
|
261
|
-
"rationale": "An operation that both answers and changes cannot be retried, cached or reasoned about safely (command–query separation, Meyer; Fowler, CQRS)."
|
|
258
|
+
"action": "test the business rules with unit tests that start no database, broker or web server and cover at least {{DOMAIN_COVERAGE}}% of the lines of every domain package",
|
|
259
|
+
"rationale": "Rules that can only be tested through the infrastructure are tested slowly and rarely; testability is part of maintainability (ISO/IEC 25010).",
|
|
260
|
+
"hubWhen": {
|
|
261
|
+
"LOGIC": [
|
|
262
|
+
"rich"
|
|
263
|
+
]
|
|
264
|
+
}
|
|
262
265
|
},
|
|
263
266
|
{
|
|
264
267
|
"id": "req-aggregates",
|
|
265
268
|
"type": "requirement",
|
|
266
269
|
"label": "Aggregates guard invariants",
|
|
267
270
|
"x": 260,
|
|
268
|
-
"y":
|
|
271
|
+
"y": 650,
|
|
269
272
|
"ears_type": "ubiquitous",
|
|
270
|
-
"action": "enforce every invariant inside the aggregate it belongs to, change an aggregate's state only through its methods (0 public setters on domain classes), and
|
|
273
|
+
"action": "enforce every invariant inside the aggregate it belongs to, change an aggregate's state only through its methods (0 public setters on domain classes), and refer from one aggregate to another by identifier only (0 object references between aggregates)",
|
|
271
274
|
"rationale": "Rules kept with the data they protect hold in every use case; logic in services over data-only objects is the anemic domain model (Fowler, AnemicDomainModel; Evans, Domain-Driven Design).",
|
|
272
275
|
"hubWhen": {
|
|
273
276
|
"LOGIC": [
|
|
@@ -280,9 +283,9 @@
|
|
|
280
283
|
"type": "requirement",
|
|
281
284
|
"label": "One script per use case",
|
|
282
285
|
"x": 260,
|
|
283
|
-
"y":
|
|
286
|
+
"y": 780,
|
|
284
287
|
"ears_type": "ubiquitous",
|
|
285
|
-
"action": "put each use case's business logic in one transaction script that runs in one transaction, with 0 business rules in controllers, views or database triggers and 0 calls from one script to another",
|
|
288
|
+
"action": "put each use case's business logic in one transaction script (a class named *Script) that runs in one transaction, with 0 business rules in controllers, views or database triggers and 0 calls from one script to another",
|
|
286
289
|
"rationale": "A transaction script is simplest when each procedure stands alone; scripts calling each other become a domain model without its protections (Fowler, Transaction Script).",
|
|
287
290
|
"hubWhen": {
|
|
288
291
|
"LOGIC": [
|
|
@@ -290,6 +293,21 @@
|
|
|
290
293
|
]
|
|
291
294
|
}
|
|
292
295
|
},
|
|
296
|
+
{
|
|
297
|
+
"id": "req-one-model",
|
|
298
|
+
"type": "requirement",
|
|
299
|
+
"label": "One model serves both",
|
|
300
|
+
"x": 260,
|
|
301
|
+
"y": 910,
|
|
302
|
+
"ears_type": "ubiquitous",
|
|
303
|
+
"action": "serve queries and commands from the one model, with 0 read-model packages or projections in the deployable, and let a query change nothing",
|
|
304
|
+
"rationale": "A read side that appears without a decision is the second model with none of its benefits; keeping it out until decided keeps the code to one shape (Fowler, CQRS).",
|
|
305
|
+
"hubWhen": {
|
|
306
|
+
"CQRS": [
|
|
307
|
+
"none"
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
},
|
|
293
311
|
{
|
|
294
312
|
"id": "req-read-models",
|
|
295
313
|
"type": "requirement",
|
|
@@ -297,7 +315,7 @@
|
|
|
297
315
|
"x": 260,
|
|
298
316
|
"y": 1040,
|
|
299
317
|
"ears_type": "ubiquitous",
|
|
300
|
-
"action": "serve every query from a read model shaped for the screen or API that uses it, with 0 queries loading aggregates or using the write side's repositories",
|
|
318
|
+
"action": "serve every query from a read model in the query package shaped for the screen or API that uses it, with 0 queries loading aggregates or using the write side's repositories and 0 commands reading a read model to decide",
|
|
301
319
|
"rationale": "Separating the read side lets each model take the shape its job needs (Fowler, CQRS; microservices.io, CQRS).",
|
|
302
320
|
"hubWhen": {
|
|
303
321
|
"CQRS": [
|
|
@@ -322,14 +340,29 @@
|
|
|
322
340
|
]
|
|
323
341
|
}
|
|
324
342
|
},
|
|
343
|
+
{
|
|
344
|
+
"id": "req-rebuild",
|
|
345
|
+
"type": "requirement",
|
|
346
|
+
"label": "Projections can be rebuilt",
|
|
347
|
+
"x": 260,
|
|
348
|
+
"y": 1300,
|
|
349
|
+
"ears_type": "ubiquitous",
|
|
350
|
+
"action": "keep every projection rebuildable from the retained events alone, so that a read model cleared and replayed from the start of the stream equals the one built as the events arrived",
|
|
351
|
+
"rationale": "A read store that cannot be rebuilt is a second source of truth; replay is what makes it disposable (Fowler, CQRS; microservices.io, CQRS).",
|
|
352
|
+
"hubWhen": {
|
|
353
|
+
"CQRS": [
|
|
354
|
+
"store"
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
},
|
|
325
358
|
{
|
|
326
359
|
"id": "req-pure",
|
|
327
360
|
"type": "requirement",
|
|
328
361
|
"label": "Domain imports no framework",
|
|
329
362
|
"x": 260,
|
|
330
|
-
"y":
|
|
363
|
+
"y": 1430,
|
|
331
364
|
"ears_type": "ubiquitous",
|
|
332
|
-
"action": "keep the domain code free of framework, ORM, serialisation and validation-library imports and annotations, with 0 such imports, so that a framework upgrade changes no domain file",
|
|
365
|
+
"action": "keep the domain code free of framework, ORM, serialisation and validation-library imports and annotations, with 0 such imports (the jMolecules role annotations excepted), so that a framework upgrade changes no domain file",
|
|
333
366
|
"rationale": "A domain tied to no framework outlives framework upgrades and is tested as plain code (Martin, The Clean Architecture; Cockburn, Hexagonal architecture).",
|
|
334
367
|
"hubWhen": {
|
|
335
368
|
"FRAMEWORK": [
|
|
@@ -342,9 +375,9 @@
|
|
|
342
375
|
"type": "requirement",
|
|
343
376
|
"label": "Only mapping annotations",
|
|
344
377
|
"x": 260,
|
|
345
|
-
"y":
|
|
378
|
+
"y": 1560,
|
|
346
379
|
"ears_type": "ubiquitous",
|
|
347
|
-
"action": "allow in the domain code only
|
|
380
|
+
"action": "allow in the domain code only Jakarta Persistence and Bean Validation annotations (and the jMolecules role annotations), with 0 uses of framework services, transactions, HTTP or messaging APIs",
|
|
348
381
|
"rationale": "Mapping annotations are declarations the domain can live with; calls into the framework make the domain depend on its runtime (jMolecules, architecture concepts as code).",
|
|
349
382
|
"hubWhen": {
|
|
350
383
|
"FRAMEWORK": [
|
|
@@ -359,8 +392,8 @@
|
|
|
359
392
|
"x": 520,
|
|
360
393
|
"y": 0,
|
|
361
394
|
"given": "the layer rules",
|
|
362
|
-
"when": "data-access code imports a presentation type",
|
|
363
|
-
"then": "the rule check reports
|
|
395
|
+
"when": "data-access code imports a presentation type, or a service imports a Spring MVC type",
|
|
396
|
+
"then": "the rule check reports both and the build fails",
|
|
364
397
|
"hubWhen": {
|
|
365
398
|
"STYLE": [
|
|
366
399
|
"layered"
|
|
@@ -374,7 +407,7 @@
|
|
|
374
407
|
"x": 520,
|
|
375
408
|
"y": 130,
|
|
376
409
|
"given": "the core with its ports and the web and persistence adapters",
|
|
377
|
-
"when": "the web adapter calls the persistence adapter directly, or the core imports a
|
|
410
|
+
"when": "the web adapter calls the persistence adapter directly, or the core imports a Spring class",
|
|
378
411
|
"then": "the rule check reports both and the build fails",
|
|
379
412
|
"hubWhen": {
|
|
380
413
|
"STYLE": [
|
|
@@ -388,9 +421,9 @@
|
|
|
388
421
|
"label": "Outward dependency refused",
|
|
389
422
|
"x": 520,
|
|
390
423
|
"y": 260,
|
|
391
|
-
"given": "the
|
|
392
|
-
"when": "a use case imports a controller or an
|
|
393
|
-
"then": "the rule check reports
|
|
424
|
+
"given": "the rings",
|
|
425
|
+
"when": "a use case imports a controller, or an interactor is added that implements no input boundary",
|
|
426
|
+
"then": "the rule check reports both and the build fails",
|
|
394
427
|
"hubWhen": {
|
|
395
428
|
"STYLE": [
|
|
396
429
|
"clean"
|
|
@@ -420,24 +453,19 @@
|
|
|
420
453
|
"y": 520,
|
|
421
454
|
"given": "a build agent with no database, broker or container runtime",
|
|
422
455
|
"when": "the domain unit tests run",
|
|
423
|
-
"then": "they all pass and cover at least {{DOMAIN_COVERAGE}}% of the domain
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
"x": 520,
|
|
430
|
-
"y": 650,
|
|
431
|
-
"given": "a snapshot of the stores",
|
|
432
|
-
"when": "every query of the deployable runs",
|
|
433
|
-
"then": "the stores are unchanged"
|
|
456
|
+
"then": "they all pass and cover at least {{DOMAIN_COVERAGE}}% of the lines of every domain package",
|
|
457
|
+
"hubWhen": {
|
|
458
|
+
"LOGIC": [
|
|
459
|
+
"rich"
|
|
460
|
+
]
|
|
461
|
+
}
|
|
434
462
|
},
|
|
435
463
|
{
|
|
436
464
|
"id": "sc-aggregates",
|
|
437
465
|
"type": "scenario",
|
|
438
466
|
"label": "Invariant cannot be bypassed",
|
|
439
467
|
"x": 520,
|
|
440
|
-
"y":
|
|
468
|
+
"y": 650,
|
|
441
469
|
"given": "an order whose total may not exceed its credit limit",
|
|
442
470
|
"when": "a use case adds a line that passes the limit, and another tries to set the total directly",
|
|
443
471
|
"then": "the first is refused by the order itself and the second does not compile",
|
|
@@ -452,7 +480,7 @@
|
|
|
452
480
|
"type": "scenario",
|
|
453
481
|
"label": "Script stands alone",
|
|
454
482
|
"x": 520,
|
|
455
|
-
"y":
|
|
483
|
+
"y": 780,
|
|
456
484
|
"given": "the scripts for placing and for cancelling an order",
|
|
457
485
|
"when": "the rule check runs",
|
|
458
486
|
"then": "each script is called only from entry points, runs in a transaction, and calls no other script",
|
|
@@ -462,6 +490,21 @@
|
|
|
462
490
|
]
|
|
463
491
|
}
|
|
464
492
|
},
|
|
493
|
+
{
|
|
494
|
+
"id": "sc-one-model",
|
|
495
|
+
"type": "scenario",
|
|
496
|
+
"label": "Read side arrives undecided",
|
|
497
|
+
"x": 520,
|
|
498
|
+
"y": 910,
|
|
499
|
+
"given": "the one-model rule",
|
|
500
|
+
"when": "a change adds a query package with read models",
|
|
501
|
+
"then": "the rule check reports it and the build fails until a new decision separates reads and writes",
|
|
502
|
+
"hubWhen": {
|
|
503
|
+
"CQRS": [
|
|
504
|
+
"none"
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
},
|
|
465
508
|
{
|
|
466
509
|
"id": "sc-read-models",
|
|
467
510
|
"type": "scenario",
|
|
@@ -493,12 +536,27 @@
|
|
|
493
536
|
]
|
|
494
537
|
}
|
|
495
538
|
},
|
|
539
|
+
{
|
|
540
|
+
"id": "sc-rebuild",
|
|
541
|
+
"type": "scenario",
|
|
542
|
+
"label": "Projection rebuilt",
|
|
543
|
+
"x": 520,
|
|
544
|
+
"y": 1300,
|
|
545
|
+
"given": "an order summary read model built from events",
|
|
546
|
+
"when": "it is cleared and the projection replays the stream from the start",
|
|
547
|
+
"then": "the rebuilt read model equals the one built incrementally",
|
|
548
|
+
"hubWhen": {
|
|
549
|
+
"CQRS": [
|
|
550
|
+
"store"
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
},
|
|
496
554
|
{
|
|
497
555
|
"id": "sc-pure",
|
|
498
556
|
"type": "scenario",
|
|
499
557
|
"label": "Framework upgrade",
|
|
500
558
|
"x": 520,
|
|
501
|
-
"y":
|
|
559
|
+
"y": 1430,
|
|
502
560
|
"given": "the domain code",
|
|
503
561
|
"when": "the rule check runs, and later the framework is upgraded a major version",
|
|
504
562
|
"then": "the check finds 0 framework imports and the upgrade changes no domain file",
|
|
@@ -513,7 +571,7 @@
|
|
|
513
571
|
"type": "scenario",
|
|
514
572
|
"label": "Framework call refused",
|
|
515
573
|
"x": 520,
|
|
516
|
-
"y":
|
|
574
|
+
"y": 1560,
|
|
517
575
|
"given": "a domain entity with mapping annotations",
|
|
518
576
|
"when": "a change makes it call a repository or publish through the framework's event bus",
|
|
519
577
|
"then": "the rule check reports it and the build fails",
|
|
@@ -533,7 +591,7 @@
|
|
|
533
591
|
"status": "accepted",
|
|
534
592
|
"date": "",
|
|
535
593
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
536
|
-
"decision": "Inside the deployable the code is cut into three layers, presentation, business logic and data access, each depending only on the one below; SQL stays in data access and HTTP and user-interface types stay in presentation. Business rules: {{LOGIC}}. Reads and writes: {{CQRS}}. Domain code and the framework: {{FRAMEWORK}}. The rules are checked in the build
|
|
594
|
+
"decision": "Inside the deployable the code is cut into three layers, presentation (adapter.web, adapter.jobs), business logic (application, domain) and data access (adapter.persistence, adapter.messaging), each depending only on the one below; SQL stays in data access and HTTP and user-interface types stay in presentation. Business rules: {{LOGIC}}. Reads and writes: {{CQRS}}. Domain code and the framework: {{FRAMEWORK}}. The rules are checked in the build with ArchUnit's layeredArchitecture(); NetArchTest on .NET, dependency-cruiser or eslint-plugin-boundaries for TypeScript and import-linter's layers contract for Python express the same rules, as a unit test in the existing test runner.",
|
|
537
595
|
"consequences": "• Simple to explain and matches most web frameworks, so new people find their way at once.\n• Business logic depends on data access, so its tests need a database or mocks of the data layer.\n• A feature cuts across all three layers; with many features the layers grow wide and features blur inside them.\n• Moving to ports and adapters later means inverting the dependency between business logic and data access.",
|
|
538
596
|
"alternatives": "1. Ports and adapters: business logic without infrastructure, at the cost of ports and mapping code.\n2. Vertical slices: a feature in one place instead of three layers, with some duplication.\n3. No explicit structure: fastest for a prototype, and the most expensive to untangle later.",
|
|
539
597
|
"hubWhen": {
|
|
@@ -552,7 +610,7 @@
|
|
|
552
610
|
"status": "accepted",
|
|
553
611
|
"date": "",
|
|
554
612
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
555
|
-
"decision": "Inside the deployable the code has a core (domain
|
|
613
|
+
"decision": "Inside the deployable the code has a core (domain and application) that imports no framework service, database driver, messaging or HTTP library; the core declares driving ports (application.port.in, the use cases it offers) and driven ports (application.port.out: repositories, publishers, clients it needs), and the adapters outside it implement them. Dependencies point into the core only and adapters do not use each other. Business rules: {{LOGIC}}. Reads and writes: {{CQRS}}. Domain code and the framework: {{FRAMEWORK}}. The rules are checked in the build with jMolecules' hexagonal annotations and JMoleculesArchitectureRules.ensureHexagonal() (ArchUnit); NetArchTest on .NET, dependency-cruiser for TypeScript and import-linter for Python express the same rules.",
|
|
556
614
|
"consequences": "• The core is tested in milliseconds without infrastructure, and an adapter is replaced without touching it.\n• More code: ports, adapters and the mapping between core objects and persistence or transport models.\n• Framework conveniences that reach into the core (transactions, ORM lazy loading, validation by annotation) move to adapters or are given up.\n• It says nothing about cutting the core by domain: with several domains, combine it with modules (Module boundaries).",
|
|
557
615
|
"alternatives": "1. Layers: less code and closer to the framework, but business logic depends on data access.\n2. Clean or onion rings: the same inward rule with more named rings and one class per use case.\n3. Vertical slices: less mapping, but no common core the slices are tested against.",
|
|
558
616
|
"hubWhen": {
|
|
@@ -571,7 +629,7 @@
|
|
|
571
629
|
"status": "accepted",
|
|
572
630
|
"date": "",
|
|
573
631
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
574
|
-
"decision": "Inside the deployable the code is cut into
|
|
632
|
+
"decision": "Inside the deployable the code is cut into rings: the domain model (domain.model, the entities), domain services (domain.service), application services (application: one interactor class per use case in application.usecase, each implementing an input boundary from application.port.in and calling output boundaries from application.port.out) and the adapters (adapter.web, adapter.persistence, adapter.messaging, adapter.jobs: controllers, presenters, gateways and the framework wiring). Every source dependency points inwards; data crosses a boundary as simple structures, never as ORM entities or HTTP requests. Business rules: {{LOGIC}}. Reads and writes: {{CQRS}}. Domain code and the framework: {{FRAMEWORK}}. The rules are checked in the build with ArchUnit's onionArchitecture(); NetArchTest on .NET, dependency-cruiser for TypeScript and import-linter's layers contract for Python express the same rules.",
|
|
575
633
|
"consequences": "• Use cases read as the list of what the system does, each testable alone with fake gateways.\n• The most mapping code of the options: request, response and persistence models at every boundary.\n• Delivery channels (web, API, jobs, messages) reuse the same use cases.\n• Too much ceremony for a domain with few rules; the rings must earn their keep.",
|
|
576
634
|
"alternatives": "1. Ports and adapters: the same inward rule with fewer named rings.\n2. Layers: less mapping, but the business layer depends on data access.\n3. Vertical slices: each request self-contained, with less structure shared between them.",
|
|
577
635
|
"hubWhen": {
|
|
@@ -590,7 +648,7 @@
|
|
|
590
648
|
"status": "accepted",
|
|
591
649
|
"date": "",
|
|
592
650
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
593
|
-
"decision": "Inside the deployable the code is cut by feature: one slice per request (a command or a query) holding its endpoint, request and response types, validation, handler and data access. Slices do not use each other; code moves to the common domain folder only when a second slice really needs it. Requests go through
|
|
651
|
+
"decision": "Inside the deployable the code is cut by feature: one slice per request (a command or a query) under features.<name>, holding its endpoint, request and response types, validation, handler and data access. Slices do not use each other; code moves to the common domain folder only when a second slice really needs it, and the domain folder knows no slice. Requests go through the framework's routing with one handler class per request (Spring MVC on the JVM, MediatR or Wolverine on .NET, a plain handler map in TypeScript). Business rules: {{LOGIC}}. Reads and writes: {{CQRS}}. Domain code and the framework: {{FRAMEWORK}}. The rules are checked in the build with ArchUnit's slices().should().notDependOnEachOther(); NetArchTest on .NET and dependency-cruiser for TypeScript express the same rule.",
|
|
594
652
|
"consequences": "• A new or changed feature touches one folder, so changes are small and reviews focused.\n• Each slice may pick the simplest data access for its job (raw SQL for a report, the ORM for a command).\n• Some duplication between slices is accepted; rules needed by several slices must be noticed and moved to the domain.\n• Without discipline the common folder becomes a hidden layer.",
|
|
595
653
|
"alternatives": "1. Layers: shared technical structure, but every feature crosses every layer.\n2. Ports and adapters: a shared, infrastructure-free core, at the cost of ports and mapping.\n3. Clean rings: use cases as classes too, with full rings around them.",
|
|
596
654
|
"hubWhen": {
|
|
@@ -609,7 +667,7 @@
|
|
|
609
667
|
"status": "accepted",
|
|
610
668
|
"date": "",
|
|
611
669
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
612
|
-
"decision": "Business rules live in a rich domain model: aggregates and entities carry behaviour, protect their invariants and change state only through their methods; value objects replace primitive types for money, quantities and identifiers; an aggregate refers to another only by identifier; one transaction changes one aggregate, and changes to others follow from domain events. Use cases (or handlers) load an aggregate, call it and save it, and hold no rules themselves.
|
|
670
|
+
"decision": "Business rules live in a rich domain model: aggregates and entities carry behaviour, protect their invariants and change state only through their methods; value objects replace primitive types for money, quantities and identifiers; an aggregate refers to another only by identifier; one transaction changes one aggregate, and changes to others follow from domain events. Use cases (or handlers) load an aggregate, call it and save it, and hold no rules themselves. The domain is tested by unit tests that start no infrastructure and cover at least {{DOMAIN_COVERAGE}}% of the lines of every domain package. jMolecules annotations (@AggregateRoot, @Entity, @ValueObject) mark the roles and its ArchUnit rules check them; on .NET and in TypeScript the same rules are written as architecture tests over naming conventions.",
|
|
613
671
|
"consequences": "• A rule is written once and holds in every use case that changes the data.\n• Domain tests are plain unit tests of objects, without mocks of repositories.\n• Mapping to the database takes care (aggregates as consistency boundaries, no lazy navigation between them).\n• Overkill for a domain that is mostly CRUD.",
|
|
614
672
|
"alternatives": "1. Transaction scripts: simpler for few rules, but a rule needed in two scripts gets copied.\n2. An anemic model with services: looks like a domain model but has the costs of both and the protections of neither.\n3. Rules in the database (constraints, procedures): enforced everywhere, but hard to test and to change.",
|
|
615
673
|
"hubWhen": {
|
|
@@ -628,8 +686,8 @@
|
|
|
628
686
|
"status": "accepted",
|
|
629
687
|
"date": "",
|
|
630
688
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
631
|
-
"decision": "Business rules live in transaction scripts: each use case is one procedure (an application
|
|
632
|
-
"consequences": "• The simplest code for a domain close to CRUD: one place per use case, easy to follow.\n• A rule needed by several use cases has to be noticed and extracted, or it is copied and drifts.\n• Tests of a script
|
|
689
|
+
"decision": "Business rules live in transaction scripts: each use case is one procedure in a class named *Script (an application service or a request handler) that validates, reads, decides and writes in one transaction over simple data objects. Scripts are called only from entry points (controllers, message listeners, jobs) and never call each other; a rule needed by two scripts moves into a small function both call. Tests of a script exercise its data access: through fakes of the ports with ports and adapters or clean rings, against a containerised database otherwise. When rules start being copied between scripts, this decision is revisited in favour of a domain model.",
|
|
690
|
+
"consequences": "• The simplest code for a domain close to CRUD: one place per use case, easy to follow.\n• A rule needed by several use cases has to be noticed and extracted, or it is copied and drifts.\n• Tests of a script need its data access, as fakes or a container, so they are slower than tests of a domain object.\n• Moving to a domain model later is a refactoring per script, not a rewrite.",
|
|
633
691
|
"alternatives": "1. A rich domain model: rules kept with the data in every use case, at the cost of modelling and mapping.\n2. Table module: one class per table with the rules about it; fits record-set frameworks.\n3. Rules in stored procedures: close to the data, hard to test and version.",
|
|
634
692
|
"hubWhen": {
|
|
635
693
|
"LOGIC": [
|
|
@@ -637,17 +695,36 @@
|
|
|
637
695
|
]
|
|
638
696
|
}
|
|
639
697
|
},
|
|
698
|
+
{
|
|
699
|
+
"id": "adr-one-model",
|
|
700
|
+
"type": "adr",
|
|
701
|
+
"label": "One model for reads and writes",
|
|
702
|
+
"x": 780,
|
|
703
|
+
"y": 780,
|
|
704
|
+
"concern": "architecture-style",
|
|
705
|
+
"status": "accepted",
|
|
706
|
+
"date": "",
|
|
707
|
+
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
708
|
+
"decision": "Reads and writes share one model: queries load the same entities or data objects the commands change, through the same repositories, and the presentation code shapes them for the screen. A query changes nothing. A screen that needs a join or projection the model cannot give gets a query method or SQL of its own in data access, recorded as the exception. This decision is revisited when reads outnumber writes by orders of magnitude, screens need projections the model should not carry, or reads must scale apart from writes.",
|
|
709
|
+
"consequences": "• The least code: one model, one set of repositories, no projections to run.\n• Screens are shaped like the entities; joins and projections beyond them need the recorded exceptions.\n• Read load hits the write model's tables and indexes; scaling reads apart later means a replica or a separate read store.\n• With a rich domain model, loading an aggregate to show a list is wasteful; the exceptions grow with the number of list screens.",
|
|
710
|
+
"alternatives": "1. Separate read models on the same database: screens get their shape, reads stay fresh, two models to keep.\n2. A separate read store updated by events: reads scale apart, at the cost of staleness and projections to run.\n3. A database read replica: more read capacity without a second model, same shape.",
|
|
711
|
+
"hubWhen": {
|
|
712
|
+
"CQRS": [
|
|
713
|
+
"none"
|
|
714
|
+
]
|
|
715
|
+
}
|
|
716
|
+
},
|
|
640
717
|
{
|
|
641
718
|
"id": "adr-read-models",
|
|
642
719
|
"type": "adr",
|
|
643
720
|
"label": "Separate read models",
|
|
644
721
|
"x": 780,
|
|
645
|
-
"y":
|
|
722
|
+
"y": 910,
|
|
646
723
|
"concern": "architecture-style",
|
|
647
724
|
"status": "accepted",
|
|
648
725
|
"date": "",
|
|
649
726
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
650
|
-
"decision": "Commands go through the domain model; queries go through read models of their own (query objects with SQL, database views, or jOOQ, Dapper or Kysely queries) shaped for the screen or API that uses them, on the same database, so they are up to date at once. Queries never load aggregates or use the write side's repositories, and the write side never reads the read models to decide.",
|
|
727
|
+
"decision": "Commands go through the domain model; queries go through read models of their own in the query package (query objects with SQL, database views, or jOOQ, Dapper or Kysely queries) shaped for the screen or API that uses them, on the same database, so they are up to date at once. Queries never load aggregates or use the write side's repositories, and the write side never reads the read models to decide.",
|
|
651
728
|
"consequences": "• Screens get exactly the joins and projections they need without bending the domain model.\n• Reads are consistent with writes at once, since both use one database.\n• Two models to change when a field is added that both sides need.\n• Read and write load still share one database; scaling them apart needs a separate store.",
|
|
652
729
|
"alternatives": "1. One model for both: less code, while reads look like the entities.\n2. A separate read store updated by events: scales reads apart, at the cost of staleness and projections to run.",
|
|
653
730
|
"hubWhen": {
|
|
@@ -661,12 +738,12 @@
|
|
|
661
738
|
"type": "adr",
|
|
662
739
|
"label": "A separate read store",
|
|
663
740
|
"x": 780,
|
|
664
|
-
"y":
|
|
741
|
+
"y": 1040,
|
|
665
742
|
"concern": "architecture-style",
|
|
666
743
|
"status": "accepted",
|
|
667
744
|
"date": "",
|
|
668
745
|
"context": "This deployable holds code that keeps changing, and its inner structure decides where each piece of that code goes. The forces: business rules mixed with HTTP handlers, SQL and framework calls can only be tested by starting everything, and change whenever the framework does; a structure with more rings and mappings than the domain needs is ceremony that slows every feature; a feature cut across technical layers touches every layer, while a feature kept in one slice may duplicate what its neighbours do; reads and writes often want different shapes, and forcing both through one model makes either the screens or the rules awkward; and a rule that lives only in a diagram is broken by the first deadline.",
|
|
669
|
-
"decision": "Commands change the write store through the domain model and publish events from it (through an outbox,
|
|
746
|
+
"decision": "Commands change the write store through the domain model and publish events from it (through an outbox, as the Data consistency pack decides); projections in the query package consume them and update a read store chosen for the queries (Elasticsearch or OpenSearch for search, a document store or denormalised tables for screens, a columnar store for dashboards). Read models lag by at most {{READ_LAG_SECONDS}} seconds at the 99th percentile, and the client that made a change reads its own write (it is served from the command's response or waits for the projection's version). Every projection can be rebuilt by clearing its read model and replaying the stream from the start; a test proves it.",
|
|
670
747
|
"consequences": "• Reads scale and pick their technology apart from writes.\n• Readers see data up to {{READ_LAG_SECONDS}} seconds old; screens have to be designed for that.\n• Projections are more code to run, watch and rebuild; their lag is an operational metric.\n• The events become a contract between the write and the read side.",
|
|
671
748
|
"alternatives": "1. Separate read models on the same database: fresh reads, but shared load.\n2. One model for both: the least code while reads and writes look alike.\n3. A database read replica: scales reads without projections, but keeps the write model's shape.",
|
|
672
749
|
"hubWhen": {
|
|
@@ -681,9 +758,12 @@
|
|
|
681
758
|
"label": "Layers call downwards",
|
|
682
759
|
"x": 1040,
|
|
683
760
|
"y": 0,
|
|
684
|
-
"
|
|
685
|
-
"
|
|
686
|
-
"
|
|
761
|
+
"characteristic": "maintainability",
|
|
762
|
+
"scope": "atomic",
|
|
763
|
+
"cadence": "triggered",
|
|
764
|
+
"trigger": "pull-request",
|
|
765
|
+
"invocation": "automated",
|
|
766
|
+
"description": "An ArchUnit test declares the three layers and which may access which, forbids web types in the business layer and SQL outside data access; it runs with the unit tests and fails on any violation.\n\nThreshold: 0 layer violations: no layer is accessed by a layer above the one it serves, 0 Spring MVC or servlet types in the business layer, 0 SQL or JDBC types outside data access\n\nTool: ArchUnit (JUnit 5); for .NET: NetArchTest; for TypeScript: dependency-cruiser; for Python: import-linter layers contract\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass LayerRulesTest {\n @ArchTest\n static final ArchRule layers = layeredArchitecture().consideringAllDependencies()\n .layer(\"Presentation\").definedBy(\"..adapter.web..\", \"..adapter.jobs..\")\n .layer(\"Business\").definedBy(\"..application..\", \"..domain..\")\n .layer(\"DataAccess\").definedBy(\"..adapter.persistence..\", \"..adapter.messaging..\")\n .whereLayer(\"Presentation\").mayNotBeAccessedByAnyLayer()\n .whereLayer(\"Business\").mayOnlyBeAccessedByLayers(\"Presentation\")\n .whereLayer(\"DataAccess\").mayOnlyBeAccessedByLayers(\"Business\")\n .withOptionalLayers(true);\n\n @ArchTest\n static final ArchRule noWebInBusiness = noClasses().that().resideInAnyPackage(\"..application..\", \"..domain..\")\n .should().dependOnClassesThat().resideInAnyPackage(\"org.springframework.web..\", \"jakarta.servlet..\");\n\n @ArchTest\n static final ArchRule sqlOnlyInDataAccess = noClasses().that().resideOutsideOfPackage(\"..adapter.persistence..\")\n .should().dependOnClassesThat().resideInAnyPackage(\"java.sql..\", \"javax.sql..\", \"org.springframework.jdbc..\", \"org.jooq..\", \"org.hibernate..\");\n}\n```",
|
|
687
767
|
"hubWhen": {
|
|
688
768
|
"STYLE": [
|
|
689
769
|
"layered"
|
|
@@ -696,9 +776,12 @@
|
|
|
696
776
|
"label": "Ports and adapters hold",
|
|
697
777
|
"x": 1040,
|
|
698
778
|
"y": 130,
|
|
699
|
-
"
|
|
700
|
-
"
|
|
701
|
-
"
|
|
779
|
+
"characteristic": "maintainability",
|
|
780
|
+
"scope": "atomic",
|
|
781
|
+
"cadence": "triggered",
|
|
782
|
+
"trigger": "pull-request",
|
|
783
|
+
"invocation": "automated",
|
|
784
|
+
"description": "Each package names its role in package-info.java with jMolecules' hexagonal annotations; JMoleculesArchitectureRules.ensureHexagonal() derives the allowed dependencies from them and fails the test on any other, and a second rule keeps the core free of adapters and framework services (whether persistence annotations may appear in the domain is the FRAMEWORK decision, checked by its own rule).\n\nThreshold: 0 violations of the hexagonal rules: the core depends on no adapter and no framework service, adapters reach the core only through ports and do not use each other\n\nTool: jMolecules ArchUnit rules (jmolecules-archunit with ArchUnit, JUnit 5); for .NET: NetArchTest; for TypeScript: dependency-cruiser; for Python: import-linter\n\n```java\n// package-info.java of each package names its role (org.jmolecules.architecture.hexagonal):\n// @Application package com.example.shop.application;\n// @PrimaryPort package com.example.shop.application.port.in;\n// @SecondaryPort package com.example.shop.application.port.out;\n// @PrimaryAdapter package com.example.shop.adapter.web;\n// @SecondaryAdapter package com.example.shop.adapter.persistence;\n\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass HexagonalRulesTest {\n @ArchTest\n static final ArchRule hexagonal = JMoleculesArchitectureRules.ensureHexagonal();\n\n @ArchTest\n static final ArchRule coreIsPlain = noClasses().that().resideInAnyPackage(\"..domain..\", \"..application..\")\n .should().dependOnClassesThat().resideInAnyPackage(\n \"..adapter..\", \"org.springframework..\", \"jakarta.servlet..\", \"jakarta.transaction..\", \"jakarta.jms..\")\n .because(\"ADR Ports and adapters: the core imports no adapter and no framework service\");\n}\n```",
|
|
702
785
|
"hubWhen": {
|
|
703
786
|
"STYLE": [
|
|
704
787
|
"hexagonal"
|
|
@@ -711,9 +794,12 @@
|
|
|
711
794
|
"label": "Rings depend inwards",
|
|
712
795
|
"x": 1040,
|
|
713
796
|
"y": 260,
|
|
714
|
-
"
|
|
715
|
-
"
|
|
716
|
-
"
|
|
797
|
+
"characteristic": "maintainability",
|
|
798
|
+
"scope": "atomic",
|
|
799
|
+
"cadence": "triggered",
|
|
800
|
+
"trigger": "pull-request",
|
|
801
|
+
"invocation": "automated",
|
|
802
|
+
"description": "ArchUnit's onionArchitecture() declares the rings and fails the test on any dependency pointing outwards; a second rule requires every class in application.usecase to implement an interface from application.port.in, so a use case cannot be reached except through its boundary.\n\nThreshold: 0 dependencies from an inner ring to an outer one; 100% of the interactor classes implement an input boundary\n\nTool: ArchUnit (JUnit 5); for .NET: NetArchTest; for TypeScript: dependency-cruiser; for Python: import-linter layers contract\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass RingRulesTest {\n @ArchTest\n static final ArchRule rings = onionArchitecture()\n .domainModels(\"..domain.model..\")\n .domainServices(\"..domain.service..\")\n .applicationServices(\"..application..\")\n .adapter(\"web\", \"..adapter.web..\")\n .adapter(\"persistence\", \"..adapter.persistence..\")\n .adapter(\"messaging\", \"..adapter.messaging..\")\n .adapter(\"jobs\", \"..adapter.jobs..\")\n .withOptionalLayers(true);\n\n @ArchTest\n static final ArchRule oneInteractorPerUseCase = classes().that().resideInAPackage(\"..application.usecase..\")\n .and().areNotInterfaces()\n .should().implement(JavaClass.Predicates.resideInAPackage(\"..application.port.in..\"))\n .because(\"ADR Clean architecture rings: a use case is reached only through its input boundary\");\n}\n```",
|
|
717
803
|
"hubWhen": {
|
|
718
804
|
"STYLE": [
|
|
719
805
|
"clean"
|
|
@@ -726,9 +812,12 @@
|
|
|
726
812
|
"label": "Slices independent",
|
|
727
813
|
"x": 1040,
|
|
728
814
|
"y": 390,
|
|
729
|
-
"
|
|
730
|
-
"
|
|
731
|
-
"
|
|
815
|
+
"characteristic": "maintainability",
|
|
816
|
+
"scope": "atomic",
|
|
817
|
+
"cadence": "triggered",
|
|
818
|
+
"trigger": "pull-request",
|
|
819
|
+
"invocation": "automated",
|
|
820
|
+
"description": "ArchUnit finds the slices (the packages under features) and checks that none depends on another, and that the common domain folder depends on no slice; it runs with the unit tests.\n\nThreshold: 0 dependencies from one feature slice on another; 0 dependencies from the domain folder on a slice\n\nTool: ArchUnit (JUnit 5); for .NET: NetArchTest over the Features namespaces; for TypeScript: dependency-cruiser\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass SliceRulesTest {\n @ArchTest\n static final ArchRule slicesStandAlone = slices().matching(\"..features.(*)..\").should().notDependOnEachOther();\n\n @ArchTest\n static final ArchRule domainKnowsNoSlice = noClasses().that().resideInAPackage(\"..domain..\")\n .should().dependOnClassesThat().resideInAPackage(\"..features..\")\n .because(\"ADR Vertical slices: the common domain folder serves the slices and knows none of them\");\n}\n```",
|
|
732
821
|
"hubWhen": {
|
|
733
822
|
"STYLE": [
|
|
734
823
|
"slices"
|
|
@@ -741,9 +830,17 @@
|
|
|
741
830
|
"label": "Domain tested alone",
|
|
742
831
|
"x": 1040,
|
|
743
832
|
"y": 520,
|
|
744
|
-
"
|
|
745
|
-
"
|
|
746
|
-
"
|
|
833
|
+
"characteristic": "maintainability",
|
|
834
|
+
"scope": "atomic",
|
|
835
|
+
"cadence": "triggered",
|
|
836
|
+
"trigger": "pull-request",
|
|
837
|
+
"invocation": "automated",
|
|
838
|
+
"description": "A Gradle task runs only the tests of the domain packages and a JaCoCo verification task checks their line coverage per domain package; CI runs the task on a runner without Docker, so a domain test that starts a container fails there.\n\nThreshold: The domain unit tests pass on a runner with no database, broker or container runtime and cover at least {{DOMAIN_COVERAGE}}% of the lines of every domain package\n\nTool: Gradle with JaCoCo (JUnit 5), on a CI runner without Docker; for .NET: coverlet with a threshold on the Domain project; for TypeScript: Vitest coverage thresholds per glob (Vitest 3.2 or later for test.projects)\n\n```kotlin\n// build.gradle.kts — CI runs `./gradlew domainTest` on a runner without Docker\nval domainTest by tasks.registering(Test::class) {\n useJUnitPlatform()\n filter { includeTestsMatching(\"com.example.shop.domain.*\") }\n finalizedBy(\"domainCoverage\")\n}\n\ntasks.register<JacocoCoverageVerification>(\"domainCoverage\") {\n executionData(domainTest.get())\n sourceSets(sourceSets.main.get())\n violationRules {\n rule {\n element = \"PACKAGE\"\n includes = listOf(\"com.example.shop.domain.*\")\n limit {\n counter = \"LINE\"\n value = \"COVEREDRATIO\"\n minimum = ({{DOMAIN_COVERAGE}} / 100.0).toBigDecimal()\n }\n }\n }\n}\n```",
|
|
839
|
+
"hubWhen": {
|
|
840
|
+
"LOGIC": [
|
|
841
|
+
"rich"
|
|
842
|
+
]
|
|
843
|
+
}
|
|
747
844
|
},
|
|
748
845
|
{
|
|
749
846
|
"id": "ff-pure",
|
|
@@ -751,9 +848,12 @@
|
|
|
751
848
|
"label": "Domain imports no framework",
|
|
752
849
|
"x": 1040,
|
|
753
850
|
"y": 650,
|
|
754
|
-
"
|
|
755
|
-
"
|
|
756
|
-
"
|
|
851
|
+
"characteristic": "maintainability",
|
|
852
|
+
"scope": "atomic",
|
|
853
|
+
"cadence": "triggered",
|
|
854
|
+
"trigger": "pull-request",
|
|
855
|
+
"invocation": "automated",
|
|
856
|
+
"description": "An ArchUnit rule lets domain classes depend only on the language, the domain and jMolecules (annotation types count as dependencies); the build fails on any other dependency.\n\nThreshold: 0 dependencies of domain classes outside the language, the domain itself and the jMolecules role annotations\n\nTool: ArchUnit (JUnit 5); for TypeScript: a dependency-cruiser rule from src/domain to node_modules; for .NET: NetArchTest HaveDependencyOnAny over the Domain namespace\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass DomainPurityTest {\n @ArchTest\n static final ArchRule domainIsPlain = classes().that().resideInAPackage(\"..domain..\")\n .should().onlyDependOnClassesThat().resideInAnyPackage(\"..domain..\", \"java..\", \"kotlin..\", \"org.jmolecules..\")\n .because(\"ADR: the domain imports no framework; jMolecules annotations only name the roles\");\n}\n```",
|
|
757
857
|
"hubWhen": {
|
|
758
858
|
"FRAMEWORK": [
|
|
759
859
|
"pure"
|
|
@@ -766,9 +866,12 @@
|
|
|
766
866
|
"label": "Only mapping annotations",
|
|
767
867
|
"x": 1040,
|
|
768
868
|
"y": 780,
|
|
769
|
-
"
|
|
770
|
-
"
|
|
771
|
-
"
|
|
869
|
+
"characteristic": "maintainability",
|
|
870
|
+
"scope": "atomic",
|
|
871
|
+
"cadence": "triggered",
|
|
872
|
+
"trigger": "pull-request",
|
|
873
|
+
"invocation": "automated",
|
|
874
|
+
"description": "An ArchUnit rule allows the domain the mapping and validation annotations and nothing else of the framework; a call into Spring, a transaction API or a messaging client fails the build.\n\nThreshold: 0 dependencies of domain classes outside the language, the domain, jMolecules, Jakarta Persistence and Bean Validation\n\nTool: ArchUnit (JUnit 5); for .NET: NetArchTest allowing only the EF Core and DataAnnotations namespaces\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass DomainAnnotationsTest {\n @ArchTest\n static final ArchRule onlyMapping = classes().that().resideInAPackage(\"..domain..\")\n .should().onlyDependOnClassesThat().resideInAnyPackage(\n \"..domain..\", \"java..\", \"kotlin..\", \"org.jmolecules..\", \"jakarta.persistence..\", \"jakarta.validation..\")\n .because(\"ADR: mapping and validation annotations only, no framework services\");\n}\n```",
|
|
772
875
|
"hubWhen": {
|
|
773
876
|
"FRAMEWORK": [
|
|
774
877
|
"annotations"
|
|
@@ -781,9 +884,12 @@
|
|
|
781
884
|
"label": "Aggregates guard their state",
|
|
782
885
|
"x": 1040,
|
|
783
886
|
"y": 910,
|
|
784
|
-
"
|
|
785
|
-
"
|
|
786
|
-
"
|
|
887
|
+
"characteristic": "maintainability",
|
|
888
|
+
"scope": "atomic",
|
|
889
|
+
"cadence": "triggered",
|
|
890
|
+
"trigger": "pull-request",
|
|
891
|
+
"invocation": "automated",
|
|
892
|
+
"description": "Aggregates, entities and value objects are marked with jMolecules annotations; JMoleculesDddRules.all() checks that aggregates refer to each other only by identifier and entities belong to one aggregate, and a second rule forbids public setters in the domain.\n\nThreshold: 0 public setters on domain classes and 0 violations of the jMolecules DDD rules (aggregates referenced by identifier only, entities inside one aggregate)\n\nTool: jMolecules DDD rules (jmolecules-archunit with ArchUnit, JUnit 5); for .NET and TypeScript: an architecture test over the naming conventions of aggregates and identifiers\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass DomainModelRulesTest {\n @ArchTest\n static final ArchRule ddd = JMoleculesDddRules.all();\n\n @ArchTest\n static final ArchRule noSetters = methods().that().areDeclaredInClassesThat().resideInAPackage(\"..domain..\")\n .and().haveNameMatching(\"set[A-Z].*\")\n .should().notBePublic()\n .because(\"ADR A rich domain model: state changes through behaviour\");\n}\n```",
|
|
787
893
|
"hubWhen": {
|
|
788
894
|
"LOGIC": [
|
|
789
895
|
"rich"
|
|
@@ -796,24 +902,48 @@
|
|
|
796
902
|
"label": "Scripts stand alone",
|
|
797
903
|
"x": 1040,
|
|
798
904
|
"y": 1040,
|
|
799
|
-
"
|
|
800
|
-
"
|
|
801
|
-
"
|
|
905
|
+
"characteristic": "maintainability",
|
|
906
|
+
"scope": "atomic",
|
|
907
|
+
"cadence": "triggered",
|
|
908
|
+
"trigger": "pull-request",
|
|
909
|
+
"invocation": "automated",
|
|
910
|
+
"description": "ArchUnit rules over the classes named *Script: a script is used only by entry points and application code (never by another script), and every public method of a script is transactional.\n\nThreshold: 0 scripts depended on by another script; 100% of public script methods annotated @Transactional\n\nTool: ArchUnit (JUnit 5); for .NET: NetArchTest over classes named *Script; for TypeScript: dependency-cruiser between *Script files\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass ScriptRulesTest {\n @ArchTest\n static final ArchRule calledOnlyFromEntryPoints = classes().that().haveSimpleNameEndingWith(\"Script\")\n .should().onlyHaveDependentClassesThat().resideInAnyPackage(\"..adapter..\", \"..application..\", \"..features..\");\n\n @ArchTest\n static final ArchRule noScriptCallsAnother = noClasses().that().haveSimpleNameEndingWith(\"Script\")\n .should().dependOnClassesThat().haveSimpleNameEndingWith(\"Script\");\n\n @ArchTest\n static final ArchRule oneTransactionEach = methods().that().arePublic()\n .and().areDeclaredInClassesThat().haveSimpleNameEndingWith(\"Script\")\n .should().beAnnotatedWith(Transactional.class);\n}\n```",
|
|
802
911
|
"hubWhen": {
|
|
803
912
|
"LOGIC": [
|
|
804
913
|
"scripts"
|
|
805
914
|
]
|
|
806
915
|
}
|
|
807
916
|
},
|
|
917
|
+
{
|
|
918
|
+
"id": "ff-one-model",
|
|
919
|
+
"type": "fitness-fn",
|
|
920
|
+
"label": "No read side without a decision",
|
|
921
|
+
"x": 1040,
|
|
922
|
+
"y": 1170,
|
|
923
|
+
"characteristic": "maintainability",
|
|
924
|
+
"scope": "atomic",
|
|
925
|
+
"cadence": "triggered",
|
|
926
|
+
"trigger": "pull-request",
|
|
927
|
+
"invocation": "automated",
|
|
928
|
+
"description": "An ArchUnit rule fails the build when a query package or a projection class appears, which would mean a read side arrived without its decision.\n\nThreshold: 0 classes in a query package and 0 projections in the deployable\n\nTool: ArchUnit (JUnit 5); for TypeScript: a dependency-cruiser rule forbidding src/query; for .NET: NetArchTest over a Query namespace\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass OneModelRulesTest {\n @ArchTest\n static final ArchRule noReadSide = noClasses().should().resideInAPackage(\"..query..\")\n .orShould().haveSimpleNameEndingWith(\"Projection\")\n .because(\"ADR One model for reads and writes: supersede it before adding read models or projections\");\n}\n```",
|
|
929
|
+
"hubWhen": {
|
|
930
|
+
"CQRS": [
|
|
931
|
+
"none"
|
|
932
|
+
]
|
|
933
|
+
}
|
|
934
|
+
},
|
|
808
935
|
{
|
|
809
936
|
"id": "ff-read-models",
|
|
810
937
|
"type": "fitness-fn",
|
|
811
938
|
"label": "Queries skip the write side",
|
|
812
939
|
"x": 1040,
|
|
813
|
-
"y":
|
|
814
|
-
"
|
|
815
|
-
"
|
|
816
|
-
"
|
|
940
|
+
"y": 1300,
|
|
941
|
+
"characteristic": "maintainability",
|
|
942
|
+
"scope": "atomic",
|
|
943
|
+
"cadence": "triggered",
|
|
944
|
+
"trigger": "pull-request",
|
|
945
|
+
"invocation": "automated",
|
|
946
|
+
"description": "ArchUnit rules keep the two sides apart: the query package (or a slice's query package) may not use the domain model, the use cases or the write side's repositories, and the write side may not read the read models.\n\nThreshold: 0 dependencies from the query package on the domain, the application or the persistence adapter, and 0 from the write side on the query package\n\nTool: ArchUnit (JUnit 5); for .NET: NetArchTest over the Query and Domain namespaces; for TypeScript: dependency-cruiser between src/query and src/domain\n\n```java\n@AnalyzeClasses(packages = \"com.example.shop\", importOptions = ImportOption.DoNotIncludeTests.class)\nclass CqrsRulesTest {\n @ArchTest\n static final ArchRule queriesSkipWriteSide = noClasses().that().resideInAPackage(\"..query..\")\n .should().dependOnClassesThat().resideInAnyPackage(\"..domain..\", \"..application..\", \"..adapter.persistence..\")\n .because(\"ADR: queries read their read models, never aggregates or the write side's repositories\");\n\n @ArchTest\n static final ArchRule writeSideSkipsReadModels = noClasses().that()\n .resideInAnyPackage(\"..domain..\", \"..application..\", \"..features..\").and().resideOutsideOfPackage(\"..query..\")\n .should().dependOnClassesThat().resideInAPackage(\"..query..\");\n}\n```",
|
|
817
947
|
"hubWhen": {
|
|
818
948
|
"CQRS": [
|
|
819
949
|
"models",
|
|
@@ -826,10 +956,30 @@
|
|
|
826
956
|
"type": "fitness-fn",
|
|
827
957
|
"label": "Read store lag bounded",
|
|
828
958
|
"x": 1040,
|
|
829
|
-
"y":
|
|
830
|
-
"
|
|
831
|
-
"
|
|
832
|
-
"
|
|
959
|
+
"y": 1430,
|
|
960
|
+
"characteristic": "performance-efficiency",
|
|
961
|
+
"scope": "atomic",
|
|
962
|
+
"cadence": "continual",
|
|
963
|
+
"invocation": "automated",
|
|
964
|
+
"description": "Each projection records, for every event it applies, the seconds between the event's commit and the read store update as a histogram projection_lag_seconds labelled with the projection; an alert fires when the 99th percentile passes the limit.\n\nThreshold: 99th percentile of projection lag at most {{READ_LAG_SECONDS}} seconds over 10 minutes\n\nTool: Prometheus alerting rule (the histogram is exported by the projections with Micrometer)\n\n```yaml\ngroups:\n - name: read-models\n rules:\n - alert: ReadModelLagging\n expr: |\n histogram_quantile(0.99, sum by (le, projection) (rate(projection_lag_seconds_bucket[10m]))) > {{READ_LAG_SECONDS}}\n for: 10m\n labels: { severity: page }\n annotations:\n summary: \"Projection {{ $labels.projection }} lags more than {{READ_LAG_SECONDS}} s (ADR A separate read store)\"\n```",
|
|
965
|
+
"hubWhen": {
|
|
966
|
+
"CQRS": [
|
|
967
|
+
"store"
|
|
968
|
+
]
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"id": "ff-projection-rebuild",
|
|
973
|
+
"type": "fitness-fn",
|
|
974
|
+
"label": "Projection rebuilt from the stream",
|
|
975
|
+
"x": 1040,
|
|
976
|
+
"y": 1560,
|
|
977
|
+
"characteristic": "reliability",
|
|
978
|
+
"scope": "atomic",
|
|
979
|
+
"cadence": "triggered",
|
|
980
|
+
"trigger": "pull-request",
|
|
981
|
+
"invocation": "automated",
|
|
982
|
+
"description": "An integration test starts the broker in a container, places an order and waits for the read model, then clears the read store, seeks the projection's consumer group to the start and waits for the rebuild; the two read models must be equal. One such test per projection.\n\nThreshold: For every projection, the read model cleared and replayed from the start of the stream equals the one built as the events arrived\n\nTool: Testcontainers (Kafka) with Spring Boot and Awaitility (JUnit 5); for TypeScript: the same test with @testcontainers/kafka and Vitest\n\n```java\n@SpringBootTest\n@Testcontainers\nclass OrderSummaryProjectionRebuildTest {\n @Container @ServiceConnection\n static KafkaContainer kafka = new KafkaContainer(\"apache/kafka:3.9.0\");\n\n @Autowired PlaceOrderUseCase placeOrder;\n @Autowired OrderSummaryReadStore readStore; // the read model\n @Autowired OrderSummaryProjection projection; // its consumer, with a consumer group of its own\n\n @Test\n void rebuildEqualsIncrementalBuild() {\n var id = placeOrder.place(new PlaceOrder(CUSTOMER, LINES));\n await().atMost(Duration.ofSeconds({{READ_LAG_SECONDS}})).until(() -> readStore.find(id).isPresent());\n var built = readStore.find(id).orElseThrow();\n\n readStore.clear();\n projection.seekToBeginning(); // resets the consumer group's offsets to the start of the topic\n await().atMost(Duration.ofSeconds(30)).until(() -> readStore.find(id).isPresent());\n assertEquals(built, readStore.find(id).orElseThrow());\n }\n}\n```",
|
|
833
983
|
"hubWhen": {
|
|
834
984
|
"CQRS": [
|
|
835
985
|
"store"
|
|
@@ -868,12 +1018,6 @@
|
|
|
868
1018
|
"targetId": "need",
|
|
869
1019
|
"relationType": "derives"
|
|
870
1020
|
},
|
|
871
|
-
{
|
|
872
|
-
"id": "req-cqs--derives--need",
|
|
873
|
-
"sourceId": "req-cqs",
|
|
874
|
-
"targetId": "need",
|
|
875
|
-
"relationType": "derives"
|
|
876
|
-
},
|
|
877
1021
|
{
|
|
878
1022
|
"id": "req-aggregates--derives--need",
|
|
879
1023
|
"sourceId": "req-aggregates",
|
|
@@ -886,6 +1030,12 @@
|
|
|
886
1030
|
"targetId": "need",
|
|
887
1031
|
"relationType": "derives"
|
|
888
1032
|
},
|
|
1033
|
+
{
|
|
1034
|
+
"id": "req-one-model--derives--need",
|
|
1035
|
+
"sourceId": "req-one-model",
|
|
1036
|
+
"targetId": "need",
|
|
1037
|
+
"relationType": "derives"
|
|
1038
|
+
},
|
|
889
1039
|
{
|
|
890
1040
|
"id": "req-read-models--derives--need",
|
|
891
1041
|
"sourceId": "req-read-models",
|
|
@@ -898,6 +1048,12 @@
|
|
|
898
1048
|
"targetId": "need",
|
|
899
1049
|
"relationType": "derives"
|
|
900
1050
|
},
|
|
1051
|
+
{
|
|
1052
|
+
"id": "req-rebuild--derives--need",
|
|
1053
|
+
"sourceId": "req-rebuild",
|
|
1054
|
+
"targetId": "need",
|
|
1055
|
+
"relationType": "derives"
|
|
1056
|
+
},
|
|
901
1057
|
{
|
|
902
1058
|
"id": "req-pure--derives--need",
|
|
903
1059
|
"sourceId": "req-pure",
|
|
@@ -940,12 +1096,6 @@
|
|
|
940
1096
|
"targetId": "req-domain-tests",
|
|
941
1097
|
"relationType": "verifies"
|
|
942
1098
|
},
|
|
943
|
-
{
|
|
944
|
-
"id": "sc-cqs--verifies--req-cqs",
|
|
945
|
-
"sourceId": "sc-cqs",
|
|
946
|
-
"targetId": "req-cqs",
|
|
947
|
-
"relationType": "verifies"
|
|
948
|
-
},
|
|
949
1099
|
{
|
|
950
1100
|
"id": "sc-aggregates--verifies--req-aggregates",
|
|
951
1101
|
"sourceId": "sc-aggregates",
|
|
@@ -958,6 +1108,12 @@
|
|
|
958
1108
|
"targetId": "req-scripts",
|
|
959
1109
|
"relationType": "verifies"
|
|
960
1110
|
},
|
|
1111
|
+
{
|
|
1112
|
+
"id": "sc-one-model--verifies--req-one-model",
|
|
1113
|
+
"sourceId": "sc-one-model",
|
|
1114
|
+
"targetId": "req-one-model",
|
|
1115
|
+
"relationType": "verifies"
|
|
1116
|
+
},
|
|
961
1117
|
{
|
|
962
1118
|
"id": "sc-read-models--verifies--req-read-models",
|
|
963
1119
|
"sourceId": "sc-read-models",
|
|
@@ -970,6 +1126,12 @@
|
|
|
970
1126
|
"targetId": "req-read-lag",
|
|
971
1127
|
"relationType": "verifies"
|
|
972
1128
|
},
|
|
1129
|
+
{
|
|
1130
|
+
"id": "sc-rebuild--verifies--req-rebuild",
|
|
1131
|
+
"sourceId": "sc-rebuild",
|
|
1132
|
+
"targetId": "req-rebuild",
|
|
1133
|
+
"relationType": "verifies"
|
|
1134
|
+
},
|
|
973
1135
|
{
|
|
974
1136
|
"id": "sc-pure--verifies--req-pure",
|
|
975
1137
|
"sourceId": "sc-pure",
|
|
@@ -1007,27 +1169,9 @@
|
|
|
1007
1169
|
"relationType": "implements"
|
|
1008
1170
|
},
|
|
1009
1171
|
{
|
|
1010
|
-
"id": "ff-domain-tests--implements--adr-
|
|
1011
|
-
"sourceId": "ff-domain-tests",
|
|
1012
|
-
"targetId": "adr-layered",
|
|
1013
|
-
"relationType": "implements"
|
|
1014
|
-
},
|
|
1015
|
-
{
|
|
1016
|
-
"id": "ff-domain-tests--implements--adr-hexagonal",
|
|
1172
|
+
"id": "ff-domain-tests--implements--adr-rich-domain",
|
|
1017
1173
|
"sourceId": "ff-domain-tests",
|
|
1018
|
-
"targetId": "adr-
|
|
1019
|
-
"relationType": "implements"
|
|
1020
|
-
},
|
|
1021
|
-
{
|
|
1022
|
-
"id": "ff-domain-tests--implements--adr-clean",
|
|
1023
|
-
"sourceId": "ff-domain-tests",
|
|
1024
|
-
"targetId": "adr-clean",
|
|
1025
|
-
"relationType": "implements"
|
|
1026
|
-
},
|
|
1027
|
-
{
|
|
1028
|
-
"id": "ff-domain-tests--implements--adr-slices",
|
|
1029
|
-
"sourceId": "ff-domain-tests",
|
|
1030
|
-
"targetId": "adr-slices",
|
|
1174
|
+
"targetId": "adr-rich-domain",
|
|
1031
1175
|
"relationType": "implements"
|
|
1032
1176
|
},
|
|
1033
1177
|
{
|
|
@@ -1090,6 +1234,12 @@
|
|
|
1090
1234
|
"targetId": "adr-transaction-scripts",
|
|
1091
1235
|
"relationType": "implements"
|
|
1092
1236
|
},
|
|
1237
|
+
{
|
|
1238
|
+
"id": "ff-one-model--implements--adr-one-model",
|
|
1239
|
+
"sourceId": "ff-one-model",
|
|
1240
|
+
"targetId": "adr-one-model",
|
|
1241
|
+
"relationType": "implements"
|
|
1242
|
+
},
|
|
1093
1243
|
{
|
|
1094
1244
|
"id": "ff-read-models--implements--adr-read-models",
|
|
1095
1245
|
"sourceId": "ff-read-models",
|
|
@@ -1107,6 +1257,12 @@
|
|
|
1107
1257
|
"sourceId": "ff-read-lag",
|
|
1108
1258
|
"targetId": "adr-read-store",
|
|
1109
1259
|
"relationType": "implements"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"id": "ff-projection-rebuild--implements--adr-read-store",
|
|
1263
|
+
"sourceId": "ff-projection-rebuild",
|
|
1264
|
+
"targetId": "adr-read-store",
|
|
1265
|
+
"relationType": "implements"
|
|
1110
1266
|
}
|
|
1111
1267
|
]
|
|
1112
1268
|
}
|