DynamoDB with Kotlin and Spring Boot (Part 2) About a month ago I published a short article about Kotlin, Spring Boot and DynamoDB. The post shows a basic setup for DynamoDB with Kotlin and Spring Boot. However, it doesn’t show a lot of aspects related to typical database implementations such as auditing or migrations. To fill this gap, I prepared an example project […]
DynamoDB with Kotlin and Spring Boot (Part 1) During the last week I implemented my first persistence layer with DynamoDB using Spring Boot and Kotlin. As I stumbled over a couple of obstacles, I decided to summarize what I did and how my final implementation looked like. Dependencies The dependencies are pretty straight forward. I decided to use Spring Data for DynamoDB and […]
Event Sourcing with Kotlin Some weeks ago I published a demo project on GitHub showing a Domain Driven Design with Kotlin. You can find the original blog post right here. Now I took the approach one step further and added Event Sourcing to the demo. Here’s what I did. Event Sourcing The basic idea of Event Sourcing is to […]
Don’t depend on details – an example I recently read Clean Architecture by Robert C. Martin. The book gives a simple advice: don’t depend on details! For Uncle Bob details are things like the database or message broker. Your architecture shouldn’t depend on the actual used implementation of those details. Whether your are using Oracle, MySQL or DynamoDB, whether it’s ActiveMQ, Kinesis […]
find vs. get Three years ago I wrote a blog post with the provoking title “Don’t use Optionals for data repositories“. The post received a couple of critical comments and I had the feeling that I didn’t made my point clear. This week I stumbled over the same topic again, but from a slightly different point of view. […]
Testing @ConfigurationProperties in Spring Boot I recently worked on a library for using AWS Kinesis in Spring Boot. As many other libraries, this particular one provided a powerful configuration. To implement the configuration, we used Spring Boot’s @ConfigurationProperties (as described here). This article gives some insights on how we did our testing. You can find the source code on GitHub: […]
Object updater pattern in Kotlin Updating data is one of the most frequent use-cases in applications. But it might also be a painful task which results in a bunch of ugly code. I recently stumbled over a typical update scenario in a Domain-Driven-Design (DDD) application. In the following, I want to show an elegant solution implemented in Kotlin (a Java […]
Encapsulated modules and clean tests with Spring’s @Configuration Usually we use Spring’s @Configuration to define some special beans. A classic example is the definition of a data source: 1234567 @Beanpublic DataSource dataSource() { DataSource dataSource = new DataSource(); dataSource.setUsername(username); // ... and so on ... return dataSource;} However, we can also use Spring’s @Configuration to build better modules which helps us to writer cleaner tests. Let’s go through an example. An example Let’s assume we have an application which uses domain […]
DDD with Kotlin I recently made my first steps with Kotlin. After exploring the language for a couple of weeks, I tried to translate one of my favorite architectural patterns from my Java background to the Kotlin world – Domain Driven Design. Example project I’ve prepared an example project on GitHub showing some of the most important concepts […]
Self-made event dispatcher In my current project, we are using an event-based architecture in order to communicate between systems. The events are implemented as JMS messages, which we send over an ActiveMQ broker. Each system sends and listens to multiple events. While sending events is pretty easy, on the listener side we quickly ended up with a class […]