Releases: fraktalio/fmodel
v3.7.0
Version 3.7.0 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.7.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.7.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.7.0/jar
Maven coordinates
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>domain</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-vanilla</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-arrow</artifactId>
<version>3.7.0</version>
</dependency>
- Reference guide
- Learn by example on the playground
- Read the blog
- Check the demos
- https://github.com/fraktalio/fmodel-spring-demo
- https://github.com/fraktalio/fmodel-ktor-demo
What's Changed
- Update gradle/actions action to v5 by @renovate[bot] in #368
- Update dependency com.google.devtools.ksp to v2.2.20-2.0.4 by @renovate[bot] in #369
- Update kotest to v6.0.4 by @renovate[bot] in #370
- Update dependency org.jetbrains.dokka to v2.1.0 by @renovate[bot] in #371
- Update dependency com.google.devtools.ksp to v2.3.0 by @renovate[bot] in #372
- Add iOS, watchOS and Linux (arm64) KMP Native targets by @n-hass in #375
- Update dependency org.jetbrains.kotlin.multiplatform to v2.2.21 by @renovate[bot] in #373
- Update actions/upload-artifact action to v5 by @renovate[bot] in #374
- Update dependency io.arrow-kt:arrow-core to v2.2.0 by @renovate[bot] in #376
- Update dependency com.google.devtools.ksp to v2.3.1 by @renovate[bot] in #377
- Update dependency com.google.devtools.ksp to v2.3.2 by @renovate[bot] in #378
- Update plugin vanniktech-mavenPublish to v0.35.0 by @renovate[bot] in #379
New Contributors
Full Changelog: v3.6.1...v3.7.0
v3.6.1
Version 3.6.1 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.6.1/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.6.1/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.6.1/jar
Maven coordinates
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>domain</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-vanilla</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-arrow</artifactId>
<version>3.6.1</version>
</dependency>
- Reference guide
- Learn by example on the playground
- Read the blog
- Check the demos
- https://github.com/fraktalio/fmodel-spring-demo
- https://github.com/fraktalio/fmodel-ktor-demo
What's Changed
- Update dependency org.jetbrains.dokka to v2 by @renovate[bot] in #339
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.10.1 by @renovate[bot] in #342
- Update plugin org.jetbrains.kotlinx.binary-compatibility-validator to v0.17.0 by @renovate[bot] in #343
- Update actions/upload-artifact action to v4.5.0 by @renovate[bot] in #340
- Replacing deprecated factory functions with recommended constructor-like function by @DomenicDev in #345
- Update actions/setup-java action to v4.6.0 by @renovate[bot] in #341
- Update dependency gradle to v8.12 by @renovate[bot] in #344
- Fix orchestrated/recursive state computation to ensure proper state updates by @DomenicDev in #347
- Update actions/upload-artifact action to v4.6.0 by @renovate[bot] in #346
- Update dependency gradle to v8.12.1 by @renovate[bot] in #348
- Update dependency io.arrow-kt:arrow-core to v2.0.1 by @renovate[bot] in #349
- Update dependency org.jetbrains.kotlin.multiplatform to v2.1.10 by @renovate[bot] in #350
- Update actions/setup-java action to v4.7.0 by @renovate[bot] in #351
- New Maven Central publishing mechanism by @idugalic in #363
- Update actions/checkout action to v5 by @renovate[bot] in #366
- Update plugin org.jetbrains.kotlinx.binary-compatibility-validator to v0.18.1 by @renovate[bot] in #361
- Update actions/setup-java action to v5 by @renovate[bot] in #367
- Update Gradle to v8.14.3 by @renovate[bot] in #355
- Update actions/upload-artifact action to v4.6.2 by @renovate[bot] in #354
Full Changelog: v3.6.0...v3.6.1
v3.6.0
Version 3.6.0 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.6.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.6.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.6.0/jar
Maven coordinates
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>domain</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-vanilla</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-arrow</artifactId>
<version>3.6.0</version>
</dependency>
- Reference guide
- Learn by example on the playground
- Read the blog
- Check the demos
- https://github.com/fraktalio/fmodel-spring-demo
- https://github.com/fraktalio/fmodel-ktor-demo
In this release, we have introduced a new component on the application layer EphemeralView:
A view that is built "on the fly" and not maintained/materialized.
Potential use cases include:
- Lightweight aggregation for ad-hoc analysis
- Development and prototyping read models
- Building strongly consistent read models
- Supporting the "read your own rights" guarantee
The main algorithm is as follows:
suspend fun <S, E, Q, EV> EV.handle(query: Q): S where EV : ViewStateComputation<S, E>, EV : EphemeralViewRepository<E, Q> =
query.fetchEvents().fold(initialState) { s, e -> evolve(s, e) }Events of type E are fetched based on a query Q, which are then used to build the respective view IView<S, E>. The result of that computation S is returned to the caller.
Thank you @DomenicDev for your contribution! You show that we can extend fmodel to better fit our specific requirements, by composing domain components in a different way. EphemeralView is a common use case, so we include it in the library. Looking forward to what is next? :)
The full release notes:
What's Changed
- Update dependency org.jetbrains.kotlin.multiplatform to v2 by @renovate in #294
- Update actions/checkout digest to a5ac7e5 by @renovate in #293
- Update kotest to v5.9.1 by @renovate in #297
- Update dependency io.kotest.multiplatform to v5.9.1 by @renovate in #296
- Update plugin org.jetbrains.kotlinx.binary-compatibility-validator to v0.15.1 by @renovate in #302
- Update dependency gradle to v8.9 by @renovate in #295
- Update actions/checkout action to v4.1.7 by @renovate in #298
- Update actions/checkout digest to 692973e by @renovate in #299
- Update gradle/gradle-build-action action to v3.4.2 by @renovate in #300
- Update actions/upload-artifact action to v4.3.4 by @renovate in #301
- Update gradle/gradle-build-action action to v3.5.0 by @renovate in #303
- Revert "Update gradle/gradle-build-action action to v3.5.0" by @idugalic in #305
- Revert "Update gradle/gradle-build-action action to v3.4.2" by @idugalic in #307
- Revert "Update dependency gradle to v8.9" by @idugalic in #308
- Update plugin org.jetbrains.kotlinx.binary-compatibility-validator to v0.16.0 by @renovate in #304
- Update gradle/gradle-build-action action to v3.5.0 by @renovate in #306
- Update dependency gradle to v8.9 by @renovate in #309
- Update plugin org.jetbrains.kotlinx.binary-compatibility-validator to v0.16.2 by @renovate in #311
- Update plugin org.jetbrains.kotlinx.binary-compatibility-validator to v0.16.3 by @renovate in #313
- Update actions/upload-artifact action to v4.3.6 by @renovate in #312
- Update gradle/actions action to v4 by @renovate in #314
- Update actions/setup-java action to v4.2.2 by @renovate in #315
- Update dependency org.jetbrains.kotlin.multiplatform to v2.0.10 by @renovate in #316
- Update dependency gradle to v8.10 by @renovate in #317
- Update actions/upload-artifact action to v4.4.3 by @renovate in #319
- Update dependency gradle to v8.10.2 by @renovate in #320
- Update actions/setup-java action to v4.4.0 by @renovate in #321
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.9.0 by @renovate in #323
- Update actions/checkout action to v4.2.1 by @renovate in #324
- Update actions/checkout digest to eef6144 by @renovate in #326
- Update dependency io.kotest.multiplatform to v6 by @renovate in #325
- Update dependency org.jetbrains.kotlin.multiplatform to v2.0.21 by @renovate in #318
- Update actions/checkout action to v4.2.2 by @renovate in #329
- Update actions/setup-java action to v4.5.0 by @renovate in #330
- Update dependency gradle to v8.11 by @renovate in #332
- Update dependency gradle to v8.11.1 by @renovate in #333
- Update dependency org.jetbrains.kotlin.multiplatform to v2.1.0 by @renovate in #335
- EphemeralView implementation by @DomenicDev in #338
- Update dependency io.arrow-kt:arrow-core to v2 by @renovate in #336
New Contributors
- @DomenicDev made their first contribution in #338
Full Changelog: v3.5.1...v3.6.0
v3.5.1
Version 3.5.1 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.5.1/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.5.1/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.5.1/jar
Maven coordinates
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>domain</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-vanilla</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-arrow</artifactId>
<version>3.5.1</version>
</dependency>
- Reference guide
- Learn by example on the playground
- Read the blog
- Check the demos
In this release, we have fixed the bug on the Event Sourced aggregate within the application module - #291. It is reproducible only in the orchestrating scenarios where you communicate two deciders back and forth, a couple of times.
The full release notes:
What's Changed
- Update gradle/gradle-build-action action to v2.6.1 by @renovate in #212
- Update actions/setup-java action to v3.12.0 by @renovate in #216
- Update gradle/gradle-build-action action to v2.7.0 by @renovate in #217
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.3 by @renovate in #218
- Update dependency gradle to v8.3 by @renovate in #219
- Update gradle/gradle-build-action action to v2.7.1 by @renovate in #220
- Update dependency org.jetbrains.kotlin.multiplatform to v1.9.10 by @renovate in #221
- Update actions/checkout action to v3.6.0 by @renovate in #222
- Update gradle/gradle-build-action action to v2.8.0 by @renovate in #223
- Update dependency org.jetbrains.dokka to v1.9.0 by @renovate in #224
- Update dependency io.kotest.multiplatform to v5.7.0 by @renovate in #225
- Update kotest to v5.7.0 by @renovate in #226
- Update dependency io.kotest.multiplatform to v5.7.1 by @renovate in #227
- Update kotest to v5.7.1 by @renovate in #228
- Update dependency io.kotest.multiplatform to v5.7.2 by @renovate in #230
- Update kotest to v5.7.2 by @renovate in #231
- Update dependency io.arrow-kt:arrow-core to v1.2.1 by @renovate in #232
- Update actions/checkout action to v4 by @renovate in #229
- Update actions/upload-artifact action to v3.1.3 by @renovate in #233
- Update actions/setup-java action to v3.13.0 by @renovate in #234
- Update actions/checkout action to v4.1.0 by @renovate in #236
- Update actions/checkout digest to 8ade135 by @renovate in #235
- Update gradle/gradle-build-action action to v2.8.1 by @renovate in #237
- Update gradle/gradle-build-action action to v2.9.0 by @renovate in #239
- Update dependency gradle to v8.4 by @renovate in #240
- Update dependency org.jetbrains.dokka to v1.9.10 by @renovate in #241
- Update actions/checkout action to v4.1.1 by @renovate in #242
- Update actions/checkout digest to b4ffde6 by @renovate in #243
- Update dependency io.kotest.multiplatform to v5.8.0 by @renovate in #246
- Update kotest to v5.8.0 by @renovate in #247
- Update dependency org.jetbrains.kotlin.multiplatform to v1.9.20 by @renovate in #245
- Conforming to new default hierarchy template for setting up multiplatform projects by @idugalic in #248
- Update dependency org.jetbrains.kotlin.multiplatform to v1.9.21 by @renovate in #252
- Support for handling event/command metadata - application layer by @idugalic in #250
- Update dependency gradle to v8.5 by @renovate in #254
- Update gradle/gradle-build-action action to v2.11.0 by @renovate in #253
- Update actions/setup-java action to v4 by @renovate in #255
- Update actions/upload-artifact action to v4 by @renovate in #256
- Update gradle/gradle-build-action action to v2.11.1 by @renovate in #257
- Update dependency org.jetbrains.kotlin.multiplatform to v1.9.22 by @renovate in #258
- Update actions/upload-artifact action to v4.1.0 by @renovate in #260
- Update actions/upload-artifact action to v4.2.0 by @renovate in #261
- Update actions/upload-artifact action to v4.3.0 by @renovate in #262
- Update gradle/gradle-build-action action to v2.12.0 by @renovate in #263
- Update plugin org.jetbrains.kotlinx.binary-compatibility-validator to v0.14.0 by @renovate in #264
- Update gradle/gradle-build-action action to v3 by @renovate in #265
- Update dependency gradle to v8.6 by @renovate in #266
- Update actions/upload-artifact action to v4.3.1 by @renovate in #267
- Update gradle/gradle-build-action action to v3.1.0 by @renovate in #268
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.8.0 by @renovate in #269
- Update dependency io.arrow-kt:arrow-core to v1.2.3 by @renovate in #270
- Update actions/setup-java action to v4.1.0 by @renovate in #271
- Update dependency org.jetbrains.dokka to v1.9.20 by @renovate in #272
- Update dependency org.jetbrains.kotlin.multiplatform to v1.9.23 by @renovate in #273
- Update dependency io.kotest.multiplatform to v5.8.1 by @renovate in #274
- Update kotest to v5.8.1 by @renovate in #275
- Update dependency gradle to v8.7 by @renovate in #277
- Update dependency io.arrow-kt:arrow-core to v1.2.4 by @renovate in #278
- Update actions/setup-java action to v4.2.1 by @renovate in #276
- Update gradle/gradle-build-action action to v3.3.0 by @renovate in #279
- Update actions/upload-artifact action to v4.3.3 by @renovate in #280
- Update gradle/gradle-build-action action to v3.3.2 by @renovate in #281
- Update actions/checkout action to v4.1.4 by @renovate in #283
- Update actions/checkout digest to 0ad4b8f by @renovate in #282
- Update dependency org.jetbrains.kotlin.multiplatform to v1.9.24 by @renovate in #284
- Update dependency io.kotest.multiplatform to v5.9.0 by @renovate in #287
- Update kotest to v5.9.0 by @renovate in #288
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.8.1 by @renovate in #289
- Update actions/checkout action to v4.1.5 by @renovate in #286
- Update actions/checkout action to v4.1.6 by @renovate in #290
- Application module: Fixing bug in event computation - orchestrated scenario by @idugalic in #291
Full Changelog: v3.5.0...v3.5.1
v3.5.0
Version 3.5.0 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.5.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.5.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.5.0/jar
Maven coordinates
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>domain</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-vanilla</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-arrow</artifactId>
<version>3.5.0</version>
</dependency>
- Reference guide
- Learn by example on the playground
- Read the blog
- Check the demos
In this release, we have upgraded the Kotlin Arrow library to 1.2.0. It is a breaking change for the application-arrow module/extension.
We have introduced and configured a binary compatibility validator into our build process.
The tool allows dumping binary API of a JVM part of a Kotlin library that is public in the sense of Kotlin visibilities and ensures that the public binary API wasn't changed in a way that makes this change binary incompatible.
We extended the case of using actor functions to parallelize the message handling processes. (available on JVM target only)
/**
* Extension function - Handles the flow of command messages of type [C] by concurrently distributing the load across finite number of actors/handlers
*
* @param commands [Flow] of Command messages of type [C]
* @param numberOfActors total number of actors/workers available for distributing the load. Minimum one.
* @param actorsCapacity capacity of the actors channel's buffer
* @param actorsStart actors coroutine start option
* @param actorsContext additional to [CoroutineScope.coroutineContext] context of the actor coroutines.
* @param partitionKey a function that calculates the partition key/routing key of command - commands with the same partition key will be handled with the same 'actor' to keep the ordering
* @return [Flow] of stored Events of type [E]
*
*/
fun <C, S, E> EventSourcingAggregate<C, S, E>.handleConcurrently(
commands: Flow<C>,
numberOfActors: Int = 100,
actorsCapacity: Int = Channel.BUFFERED,
actorsStart: CoroutineStart = CoroutineStart.LAZY,
actorsContext: CoroutineContext = EmptyCoroutineContext,
partitionKey: (C) -> Int
): Flow<E>Deprecating factory functions in favor of constructor-like functions.
What's Changed
- Update actions/checkout action to v3.5.0 by @renovate in #181
- Update actions/setup-java action to v3.11.0 by @renovate in #182
- Arrow KT upgraded to 1.2.0 - a step closer to 2.0.0 by @idugalic in #184
- Kotlin upgraded to 1.8.20 by @idugalic in #185
- Update dependency gradle to v8.1 by @renovate in #187
- Update actions/checkout action to v3.5.1 by @renovate in #186
- Update gradle/gradle-build-action action to v2.4.1 by @renovate in #188
- Update actions/checkout action to v3.5.2 by @renovate in #189
- Update gradle/gradle-build-action action to v2.4.2 by @renovate in #190
- Update dependency gradle to v8.1.1 by @renovate in #193
- Update kotest to v5.6.1 by @renovate in #192
- Update dependency org.jetbrains.kotlin.multiplatform to v1.8.21 by @renovate in #194
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.0 by @renovate in #195
- Deprecating factory functions in favour of constructor-like functions. by @idugalic in #196
- Update kotest to v5.6.2 by @renovate in #198
- Update dependency io.kotest.multiplatform to v5.6.2 by @renovate in #197
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.1 by @renovate in #199
- Properly propagating
ExperimentalCoroutinesApiby @idugalic in #200 - Promote ``@FlowPreview` API to stable/experimental by @idugalic in #201
- Update dependency org.jetbrains.dokka to v1.8.20 by @renovate in #203
- Update dependency org.jetbrains.kotlin.multiplatform to v1.8.22 by @renovate in #204
- Update actions/checkout action to v3.5.3 by @renovate in #205
- Update gradle/gradle-build-action action to v2.5.1 by @renovate in #206
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.7.2 by @renovate in #207
- Update dependency gradle to v8.2 by @renovate in #208
- Update dependency org.jetbrains.kotlin.multiplatform to v1.9.0 by @renovate in #209
- handling the messages concurrently and in parallel - actors by @idugalic in #210
- Update dependency gradle to v8.2.1 by @renovate in #211
- Update dependency io.arrow-kt:arrow-core to v1.2.0 by @renovate in #213
- Binary compatibility validator configured by @idugalic in #214
Full Changelog: v3.4.0...v3.5.0
v3.4.0
Version 3.4.0 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.4.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.4.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.4.0/jar
Maven coordinates
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>domain</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-vanilla</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-arrow</artifactId>
<version>3.4.0</version>
</dependency>
- Learn by example on the playground
- Read the blog
- Check the demos
New Native targets available
linuxX64()
mingwX64()
macosX64()
macosArm64()
tvos()
tvosSimulatorArm64()
watchosArm32()
watchosArm64()
watchosX86()
watchosX64()
watchosSimulatorArm64()
iosX64()
iosArm64()
iosArm32()
iosSimulatorArm64()
What's Changed
- Publish multiple (native) targets by @idugalic in #175
- Event (Locking) Repository simplified by @idugalic in #178
- Application interfaces simplified (unused methods deleted) by @idugalic in #172
- Nodejs - Apple Silicon build/config fixed by @idugalic in #176
- Update actions/checkout action to v3.3.0 by @renovate in #165
- Update actions/upload-artifact action to v3.1.2 by @renovate in #166
- Update dependency io.arrow-kt:arrow-core to v1.1.5 by @renovate in #167
- Update dependency org.jetbrains.kotlin.multiplatform to v1.8.10 by @renovate in #168
- Update kotest to v5.5.5 by @renovate in #170
- Update dependency io.kotest.multiplatform to v5.5.5 by @renovate in #169
- Update actions/setup-java action to v3.10.0 by @renovate in #171
- Update dependency gradle to v8.0.1 by @renovate in #173
- Update gradle/gradle-build-action action to v2.4.0 by @renovate in #177
- Update dependency gradle to v8.0.2 by @renovate in #179
- Update dependency org.jetbrains.dokka to v1.8.10 by @renovate in #180
Full Changelog: v3.3.0...v3.4.0
v3.3.0
Version 3.3.0 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.3.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.3.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.3.0/jar
Maven coordinates
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>domain</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-vanilla</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.fraktalio.fmodel</groupId>
<artifactId>application-arrow</artifactId>
<version>3.3.0</version>
</dependency>
- Learn by example on the playground
- Read the blog
- Check the demos
A convenient DSL (builder) for the domain components:
For example:
fun evenNumberDecider(): Decider<EvenNumberCommand?, EvenNumberState, EvenNumberEvent?> =
decider {
initialState {
evenNumberState {
descriptionString { "Initial state" }
valueInt { 0 }
}
}
decide { c, s ->
when (c) {
is AddEvenNumber -> flowOf(
evenNumberAdded {
description { c.description }
value { s.value + c.value }
}
)
is SubtractEvenNumber -> flowOf(
evenNumberSubtracted {
description { c.description }
value { s.value - c.value }
}
)
null -> emptyFlow()
}
}
evolve { s, e ->
when (e) {
is EvenNumberAdded ->
evenNumberState {
description { s.description + e.description }
value { e.value }
}
is EvenNumberSubtracted ->
evenNumberState {
description { s.description - e.description }
value { e.value }
}
null -> s
}
}
}Minimizing the API
_Decider<C, Si, So, Ei, Eo>is internal now_View<Si, So, E>is internal now
There was no true usage of this API, so we have chosen to make it internal, in favor of Decider<C, S, E> and View<S, E>.
Previously, Decider was just a type alias of _Decider, but these are different types actually and we want to promote that.
We hope to minimize the complexity of the API and make the right thing to do the easy thing to do.
What's Changed
- Update dependency io.arrow-kt:arrow-core to v1.1.3 by @renovate in #134
- Update gradle/gradle-build-action action to v2.3.1 by @renovate in #135
- Update actions/setup-java action to v3.5.1 by @renovate in #136
- Update kotest to v5.5.0 by @renovate in #139
- Update dependency org.jetbrains.kotlin.multiplatform to v1.7.20 by @renovate in #137
- Update gradle/gradle-build-action action to v2.3.2 by @renovate in #138
- Update actions/checkout action to v3.1.0 by @renovate in #140
- Update dependency io.kotest.multiplatform to v5.5.1 by @renovate in #141
- Update kotest to v5.5.1 by @renovate in #142
- Update dependency org.jetbrains.dokka to v1.7.20 by @renovate in #143
- A DSL/Builder for the domain components by @idugalic in #144
- Update actions/setup-java action to v3.6.0 by @renovate in #145
- Update actions/upload-artifact action to v3.1.1 by @renovate in #146
- Update dependency io.kotest.multiplatform to v5.5.2 by @renovate in #148
- Update kotest to v5.5.2 by @renovate in #149
- Update gradle/gradle-build-action action to v2.3.3 by @renovate in #147
- Update kotest to v5.5.3 by @renovate in #151
- Update dependency io.kotest.multiplatform to v5.5.3 by @renovate in #150
- Update dependency io.kotest.multiplatform to v5.5.4 by @renovate in #152
- Update kotest to v5.5.4 by @renovate in #153
- Update dependency org.jetbrains.kotlin.multiplatform to v1.7.21 by @renovate in #154
- Update dependency gradle to v7.6 by @renovate in #155
- Update dependency org.jetbrains.kotlin.multiplatform to v1.7.22 by @renovate in #156
- Update actions/setup-java action to v3.7.0 by @renovate in #157
- Update actions/setup-java action to v3.8.0 by @renovate in #158
- Update actions/checkout action to v3.2.0 by @renovate in #159
- Domain API minimized by @idugalic in #161
- Minimizing the public API of the Domain by @idugalic in #163
- Update dependency org.jetbrains.kotlin.multiplatform to v1.8.0 by @renovate in #162
Full Changelog: v3.2.0...v3.3.0
v3.2.0
Version 3.2.0 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.2.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.2.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.2.0/jar
Optimistic Locking
Optimistic locking, also referred to as optimistic concurrency control, allows multiple concurrent users to attempt to update the same resource.
There are two common ways to implement optimistic locking: version number and timestamp. The version number is generally considered to be a better option because the server clock can be inaccurate over time, but we do not want to restrict it to only one option, so we have the generic parameter V acting as a Version.
The optimistic locking mechanism is not leaking into the core Domain layer.
Application modules provide more interfaces and extensions, giving you additional options to compose your unique Domain components with Optimistic Locking formally in place, without changing the Domain components whatsoever.
example (state-stored aggregate / tradiotional)
stateStoredLockingAggregate(
decider = myDecider,
stateRepository = myLockingRepository
).handleOptimistically(myCommand)where myDecider is of type IDecider<C, S, E>, myLockingRepository is of type StateLockingRepository<C, S, V> and myCommand is of type C
example (event-sourced aggregate / event-driven)
eventSourcingLockingAggregate(
decider = myDecider,
stateRepository = myLockingRepository
).handleOptimistically(myCommand)where myDecider is of type IDecider<C, S, E>, myLockingRepository is of type EventLockingRepository<C, E, V> and myCommand is of type C
What's Changed
- Update gradle/gradle-build-action action to v2.2.0 by @renovate in #105
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.6.3 by @renovate in #104
- Update gradle/gradle-build-action action to v2.2.1 by @renovate in #109
- Update actions/setup-java action to v3.4.0 by @renovate in #110
- Update dependency org.jetbrains.dokka to v1.7.0 by @renovate in #108
- Update actions/setup-java action to v3.4.1 by @renovate in #113
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.6.4 by @renovate in #115
- Update dependency gradle to v7.5 by @renovate in #116
- Update kotest by @renovate in #112
- Update dependency org.jetbrains.dokka to v1.7.10 by @renovate in #114
- Update gradle/gradle-build-action action to v2.2.2 by @renovate in #118
- Update dependency org.jetbrains.kotlin.multiplatform to v1.7.10 by @renovate in #106
- Update dependency io.kotest.multiplatform to v5.4.1 by @renovate in #121
- Update kotest to v5.4.1 by @renovate in #122
- Update dependency gradle to v7.5.1 by @renovate in #123
- Update gradle/gradle-build-action action to v2.2.3 by @renovate in #126
- Update gradle/gradle-build-action action to v2.2.5 by @renovate in #127
- Update gradle/gradle-build-action action to v2.3.0 by @renovate in #128
Opt-Inpropagated correctly. by @idugalic in #129- Marking the
combinefunction asinfixby @idugalic in #130 - Publishing all native targets by Github Actions by @idugalic in #131
- Feature - optimistic locking by @idugalic in #133
- Update actions/setup-java action to v3.5.0 by @renovate in #132
Full Changelog: v3.1.0...v3.2.0
v3.1.0
Version 3.1.0 is a reactive and a multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
- https://search.maven.org/artifact/com.fraktalio.fmodel/domain/3.1.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-vanilla/3.1.0/jar
- https://search.maven.org/artifact/com.fraktalio.fmodel/application-arrow/3.1.0/jar
Experimental Actors (JVM only)
/**
* Extension function - Handles the flow of command messages of type [C] by concurrently distributing the load across finite number of actors/handlers
*
* @param commands [Flow] of Command messages of type [C]
* @param numberOfActors total number of actors/workers available for distributing the load
* @param actorsCapacity capacity of the actors channel's buffer
* @param actorsStart actors coroutine start option
* @param actorsContext additional to [CoroutineScope.coroutineContext] context of the actor coroutines.
* @param partitionKey a function that calculates the partition key/routing key of command - commands with the same partition key will be handled wit the same actor to keep the ordering
* @return [Flow] of stored Events of type [E]
*
* @author Иван Дугалић / Ivan Dugalic / @idugalic
*/
@ExperimentalContracts
@FlowPreview
fun <C, S, E> EventSourcingAggregate<C, S, E>.handleConcurrently(
commands: Flow<C>,
numberOfActors: Int = 100,
actorsCapacity: Int = Channel.BUFFERED,
actorsStart: CoroutineStart = CoroutineStart.LAZY,
actorsContext: CoroutineContext = EmptyCoroutineContext,
partitionKey: (C) -> Int
): Flow<E> = channelFlow {
val actors: List<SendChannel<C>> = (1..numberOfActors).map {
commandActor(channel, actorsCapacity, actorsStart, actorsContext) { handle(it) }
}
commands
.onCompletion {
actors.forEach {
it.close()
}
}
.collect {
val partition = partitionKey(it).absoluteValue % numberOfActors.coerceAtLeast(1)
actors[partition].send(it)
}
}
Arrow new Effect system
suspend fun C.fetchStateWithEffect(): Effect<Error, S?> =
effect {
try {
fetchState()
} catch (t: Throwable) {
shift(FetchingStateFailed(this@fetchStateWithEffect, t.nonFatalOrThrow()))
}
}What's Changed
- Configure Renovate by @renovate in #61
- Update plugin dokka to v1.6.10 by @renovate in #62
- Update io.kotest to v5.1.0 by @renovate in #63
- Update gradle/gradle-build-action action to v2.1.1 by @renovate in #66
- Update gradle/gradle-build-action action to v2.1.2 by @renovate in #67
- Update gradle/gradle-build-action action to v2.1.3 by @renovate in #68
- Update dependency gradle to v7.4 by @renovate in #69
- Kotlin Actors (experimental) - concurrently handling messages by @idugalic in #70
- Update actions/setup-java action to v3 by @renovate in #73
- Update actions/checkout action by @renovate in #74
- Update actions/upload-artifact action to v3 by @renovate in #75
- Update dependency gradle to v7.4.1 by @renovate in #77
- Update io.kotest to v5.2.1 by @renovate in #78
- Update gradle/gradle-build-action action to v2.1.4 by @renovate in #80
- Update gradle/gradle-build-action action to v2.1.5 by @renovate in #82
- Update plugin kotlin-multiplatform to v1.6.20 by @renovate in #85
- Update dependency gradle to v7.4.2 by @renovate in #83
- Update actions/setup-java action to v3.1.0 by @renovate in #84
- Update io.kotest to v5.2.3 by @renovate in #89
- Update actions/setup-java action to v3.1.1 by @renovate in #90
- Update plugin dokka to v1.6.20 by @renovate in #91
- Update dependency org.jetbrains.kotlinx:kotlinx-coroutines-core to v1.6.1 by @renovate in #86
- Update actions/checkout action to v3.0.2 by @renovate in #92
- Update plugin kotlin-multiplatform to v1.6.21 by @renovate in #93
- Update dependency io.arrow-kt:arrow-core to v1.1.2 by @renovate in #94
- Update plugin dokka to v1.6.21 by @renovate in #96
- Update actions/setup-java action to v3.2.0 by @renovate in #97
- Update kotest to v5.3.0 by @renovate in #101
- Update actions/setup-java action to v3.3.0 by @renovate in #100
- Update gradle/gradle-build-action action to v2.1.7 by @renovate in #102
- Update actions/upload-artifact action to v3.1.0 by @renovate in #103
- Arrow (from
eithertoEffect) by @idugalic in #95
Full Changelog: v3.0.0...v3.1.0
v3.0.0
Version 3.0.0 is a reactive and multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.
What's Changed
- A multiplatform support (jvm, js, native) included
- Switched from Spek to Kotest test framework
- Switched from Maven to Gradle
Tests example
class DeciderTest : FunSpec({
val evenDecider = evenNumberDecider()
val oddDecider = oddNumberDecider()
test("Event-sourced Decider - add even number") {
with(evenDecider) {
givenEvents(emptyList()) {
whenCommand(AddEvenNumber(Description("2"), NumberValue(2)))
} thenEvents listOf(EvenNumberAdded(Description("2"), NumberValue(2)))
}
}
test("Event-sourced Decider - given previous state, add even number") {
with(evenDecider) {
givenEvents(listOf(EvenNumberAdded(Description("2"), NumberValue(2)))) {
whenCommand(AddEvenNumber(Description("4"), NumberValue(4)))
} thenEvents listOf(EvenNumberAdded(Description("4"), NumberValue(4)))
}
}
})