Skip to content

Commit d9bbd7c

Browse files
sant0sodrotbohm
authored andcommitted
GH-540 - Improve reference documentation.
1 parent 6b839cf commit d9bbd7c

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

src/docs/antora/modules/ROOT/pages/events.adoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class OrderManagement(val events: ApplicationEventPublisher, val dependency: Ord
8989
----
9090
======
9191
92-
Note, how, instead of depending on the other application module's Spring bean, we use Spring's `ApplicationEventPublisher` to publish a domain event, once we have completed the state transitions on the primary aggregate.
92+
Note how, instead of depending on the other application module's Spring bean, we use Spring's `ApplicationEventPublisher` to publish a domain event once we have completed the state transitions on the primary aggregate.
9393
For a more aggregate-driven approach to event publication, see https://docs.spring.io/spring-data/data-commons/docs/current/reference/html/#core.domain-events[Spring Data's application event publication mechanism] for details.
9494
As event publication happens synchronously by default, the transactional semantics of the overall arrangement stay the same as in the example above.
9595
Both for the good, as we get to a very simple consistency model (either both the status change of the order _and_ the inventory update succeed or none of them does), but also for the bad as more triggered related functionality will widen the transaction boundary and potentially cause the entire transaction to fail, even if the functionality that is causing the error is not crucial.
@@ -164,7 +164,7 @@ class InventoryManagement {
164164
----
165165
======
166166
167-
To ease the declaration of what is supposed to describe the default way of integrating modules via events, Spring Modulith provides `@ApplicationModuleListener` to shortcut the declaration
167+
To ease the declaration of what is supposed to describe the default way of integrating modules via events, Spring Modulith provides `@ApplicationModuleListener` as a shortcut.
168168
169169
.An application module listener
170170
[tabs]
@@ -241,8 +241,8 @@ Using the transactional event publication log requires a combination of artifact
241241
Event publications may need to be managed in a variety of ways during the runtime of an application.
242242
Incomplete publications might have to be re-submitted to the corresponding listeners after a given amount of time.
243243
Completed publications on the other hand, will likely have to be purged from the database or moved into an archive store.
244-
As the needs for that kind of housekeeping strongly vary from application to application, Spring Modulith offers API to deal with both kinds of publications.
245-
That API is available through the `spring-modulith-events-api` artifact, that you can add to your application:
244+
As the needs for that kind of housekeeping strongly vary from application to application, Spring Modulith offers an API to deal with both kinds of publications.
245+
That API is available through the `spring-modulith-events-api` artifact that you can add to your application:
246246
247247
.Using Spring Modulith Events API artifact
248248
[tabs]
@@ -268,10 +268,10 @@ dependencies {
268268
----
269269
======
270270
271-
This artifact contains two primary abstractions, that are available to application code as Spring Beans:
271+
This artifact contains two primary abstractions that are available to application code as Spring Beans:
272272
273-
* `CompletedEventPublications` -- This interface allows accessing all completed event publications, and provides API to immediately purge all of them from the database or the completed publications older that a given duration (for example, 1 minute).
274-
* `IncompleteEventPublications`-- This interface allows accessing all incomplete event publications to resubmit either the ones matching a given predicate or older than a given `Duration` relative to the original publishing date.
273+
* `CompletedEventPublications` -- This interface allows accessing all completed event publications, and provides an API to immediately purge all of them from the database or the completed publications older that a given duration (for example, 1 minute).
274+
* `IncompleteEventPublications` -- This interface allows accessing all incomplete event publications to resubmit either the ones matching a given predicate or older than a given `Duration` relative to the original publishing date.
275275
276276
[[publication-registry.publication-repositories]]
277277
=== Event Publication Repositories
@@ -330,7 +330,7 @@ To find out how to use other ways of selecting events for externalization, or cu
330330
|Kafka
331331
|`spring-modulith-events-kafka`
332332
|Uses Spring Kafka for the interaction with the broker.
333-
The logical routing key will be used as
333+
The logical routing key will be used as Kafka's topic and message key.
334334
335335
|AMQP
336336
|`spring-modulith-events-amqp`
@@ -365,7 +365,7 @@ The event externalization performs three steps on each application event publish
365365
By default, only event types located within a Spring Boot auto-configuration package and annotated with one of the supported `@Externalized` annotations are selected for externalization.
366366
2. _Mapping the event (optional)_ -- By default, the event is serialized to JSON using the Jackson `ObjectMapper` present in the application and published as is.
367367
The mapping step allows developers to either customize the representation or even completely replace the original event with a representation suitable for external parties.
368-
Note, that the mapping step precedes the actual serialization of the to be published object.
368+
Note that the mapping step precedes the actual serialization of the to be published object.
369369
3. _Determining a routing target_ -- Message broker clients need a logical target to publish the message to.
370370
The target usually identifies physical infrastructure (a topic, exchange, or queue depending on the broker) and is often statically derived from the event type.
371371
Unless defined in the `@Externalized` annotation specifically, Spring Modulith uses the application-local type name as target.
@@ -408,7 +408,7 @@ class CustomerCreated {
408408
----
409409
======
410410
411-
The `CustomerCreated` event exposes the lastname of the customer via an accessor method.
411+
The `CustomerCreated` event exposes the last name of the customer via an accessor method.
412412
That method is then used via the ``#this.getLastname()`` expression in key expression following the `::` delimiter of the target declaration.
413413
414414
If the key calculation becomes more involved, it is advisable to rather delegate that into a Spring bean that takes the event as argument:
@@ -483,7 +483,7 @@ This step fundamentally disables the application base package filter as we only
483483
Convenience methods to easily select events by type, by packages, packages and annotation exist.
484484
Also, a shortcut to define selection and routing in one step.
485485
<3> We define a mapping step for `SomeEvent` instances.
486-
Note, that the routing will still be determined by the original event instance, unless you additionally call `….routeMapped()` on the router.
486+
Note that the routing will still be determined by the original event instance, unless you additionally call `….routeMapped()` on the router.
487487
<4> We finally determine a routing key by defining a method handle to extract a value of the event instance.
488488
Alternatively, a full `RoutingKey` can be produced for individual events by using the general `route(…)` method on the `Router` instance returned from the previous call.
489489
@@ -536,7 +536,7 @@ class OrderIntegrationTests {
536536
----
537537
======
538538
539-
Note, how `PublishedEvents` exposes API to select events matching a certain criteria.
539+
Note how `PublishedEvents` exposes an API to select events matching a certain criteria.
540540
The verification is concluded by an AssertJ assertion that verifies the number of elements expected.
541541
If you are using AssertJ for those assertions anyway, you can also use `AssertablePublishedEvents` as test method parameter type and use the fluent assertion APIs provided through that.
542542
@@ -579,4 +579,4 @@ class OrderIntegrationTests {
579579
----
580580
======
581581
582-
Note, how the type returned by the `assertThat(…)` expression allows to define constraints on the published events directly.
582+
Note how the type returned by the `assertThat(…)` expression allows to define constraints on the published events directly.

src/docs/antora/modules/ROOT/pages/fundamentals.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ In such an arrangement, the `order` package is considered an API package.
6969
Code from other application modules is allowed to refer to types within that.
7070
`order.internal`, just as any other sub-package of the application module base package, is considered an _internal_ one.
7171
Code within those must not be referred to from other modules.
72-
Note, how `SomethingOrderInternal` is a public type, likely because `OrderManagement` depends on it.
72+
Note how `SomethingOrderInternal` is a public type, likely because `OrderManagement` depends on it.
7373
This unfortunately means that it can also be referred to from other packages such as the `inventory` one.
7474
In this case, the Java compiler is not of much use to prevent these illegal references.
7575

@@ -287,7 +287,7 @@ For modules without explicitly described dependencies, both the application modu
287287
=== Customizing Module Detection
288288

289289
If the default application module model does not work for your application, the detection of the modules can be customized by providing an implementation of `ApplicationModuleDetectionStrategy`.
290-
That interface exposes a single method `Stream<JavaPackage> getModuleBasePackages(JavaPackage)` and will be called with the package, the Spring Boot application class resides in.
290+
That interface exposes a single method `Stream<JavaPackage> getModuleBasePackages(JavaPackage)` and will be called with the package the Spring Boot application class resides in.
291291
You can then inspect the packages residing within that and select the ones to be considered application module base packages based on a naming convention or the like.
292292

293293
Assume you declare a custom `ApplicationModuleDetectionStrategy` implementation like this:

src/docs/antora/modules/ROOT/pages/runtime.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ class MyInitializer : ApplicationModuleInitializer {
103103
}
104104
----
105105
======
106-
Note, that the `ApplicationModuleInitializer` beans will only be invoked if the `spring-modulith-runtime` JAR is on the classpath (see xref:runtime.adoc#setup[Setting up Runtime Support for Application Modules]) as that pulls in the dependencies that are needed to topologically sort the initializers according to the application module structure.
106+
Note that the `ApplicationModuleInitializer` beans will only be invoked if the `spring-modulith-runtime` JAR is on the classpath (see xref:runtime.adoc#setup[Setting up Runtime Support for Application Modules]) as that pulls in the dependencies that are needed to topologically sort the initializers according to the application module structure.

src/docs/antora/modules/ROOT/pages/testing.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
= Integration Testing Application Modules
33

44
Spring Modulith allows to run integration tests bootstrapping individual application modules in isolation or combination with others.
5-
To achieve this, place JUnit test class in an application module package or any sub-package of that and annotate it with `@ApplicationModuleTest`:
5+
To achieve this, place a JUnit test class in an application module package or any sub-package of that and annotate it with `@ApplicationModuleTest`:
66

77
.A application module integration test class
88
[tabs]
@@ -156,7 +156,7 @@ The test definition itself usually follows the following skeleton:
156156
3. The definition of some expected outcome, such as another application event being fired that matches some criteria or some state change of the module that can be detected by invoking exposed components.
157157
4. Optional, additional verifications made on the received event or observed, changed state.
158158

159-
`Scenario` exposes API to define these steps and guide you through the definition.
159+
`Scenario` exposes an API to define these steps and guide you through the definition.
160160

161161
.Defining a stimulus as starting point of the `Scenario`
162162
[tabs]

src/docs/antora/modules/ROOT/pages/verification.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ ApplicationModules.of(Application::class).verify()
2121
======
2222
The verification includes the following rules:
2323

24-
* _No cycles on the application module level_ -- the dependencies between modules have to form directed, acyclic graph.
25-
* _Efferent module access via API packages only_ -- All references to types that reside in application module internal packages are rejected.
24+
* _No cycles on the application module level_ -- the dependencies between modules have to form a directed acyclic graph.
25+
* _Efferent module access via API packages only_ -- all references to types that reside in application module internal packages are rejected.
2626
See xref:fundamentals.adoc#modules.advanced[Advanced Application Modules] for details.
27-
* _Explicitly allowed application module dependencies only_ (optional) -- An application module can optionally define allowed dependencies via `@ApplicationModule(allowedDependencies = …)`.
27+
* _Explicitly allowed application module dependencies only_ (optional) -- an application module can optionally define allowed dependencies via `@ApplicationModule(allowedDependencies = …)`.
2828
If those are configured, dependencies to other application modules are rejected.
2929
See xref:fundamentals.adoc#modules.explicit-dependencies[Explicit Application Module Dependencies] and xref:fundamentals.adoc#modules.named-interfaces[Named Interfaces] for details.
3030

0 commit comments

Comments
 (0)