Event sourcing: making it functional (3)

Posted on January 12, 2017 · 1 min read · tagged with: #domain driven design #event sourcing

TL;DR

We’re on our journey to move from event sourcing oriented on the aggregates to a more functional approach. In the first entry, we went through some of the DDD building blocks. In the second, we defined an interface of the aggregate that we’ll work with. Before, going to the event sourced approached, let’s go through the aggregate’s implementation, somehow related to the Blue Book approach, without event sourcing.

All entries in this series:

Payment aggregate!

Let’s dive straight into the code

paymentapi

We can see that a payment is issued for a user, with a specified payment method and a given amount of money. Yes, it’s simplistic, but bear with me, and follow its implementation for a while.

The other method is responsible for receiving the gateway response and applying it onto the aggregate. The status and the description are updated accordingly.

So far so good? In the next entry we’ll make this aggregate event sourced!


Comments

There's a mistake in the line containing the IF statement :) I'm pretty sure, that's not the operator you intended to use.

by Maciek Misztal at 2017-02-07 23:28:21 +0000