“Building Microservices” by Sam Newman – book review

TD DR: Mandatory book for every developer who wants to work with microservices. Microservices architecture is a trend in a modern software, which is currently implemented across our whole IT industry. Unfortunately, people started applying microservices without any greater understanding how they should do it. It ended with massive collapses and posts like “The death of microservice madness”. To avoid such problems… Continue reading

Dapper – JSON type custom mapper

Let’s assume that we have such read model:

And we want store Category and FieldValues in the table, as JSON string.  How to handle JSON serialization and deserialization in Dapper? TypeHandlers TypeHandlers are an option in Dapper to serialize / deserialize objects during saving and querying the database. First, we define an implementation of ITypeHandler interface:

SetValue method… Continue reading

Dapper – many to many relation in a single request

During my CQRS journey, I implemented many-to-many data querying, in the single database request. I achieved getting all products with associated entities at the same time. To achieve the same, we need to define a temporary table to store all first-level entities:

Then insert first-level entities into this table:

With such temporary table, we are able… Continue reading

CQRS – Third step – Synchronous read model

This post series is driven by my lightning talk about how to introduce CQRS to your project. I thought that would be good to explain this topic further for people who won’t be attending my presentation. I will write about: splitting code to commands and queries introducing simple read model creating read model synchronously creating read model asynchronously with SignalR… Continue reading

Angular – resolving route data

In angular 1 resolving data into a route and using them in controllers was really straightforward. Below injecting orders into ordersController.

In angular 2 / 4 / 5 it’s quite more complicated. First, you need to create resolver:

Then you need to register your resolver in AppModule:

And add resolver in routes:

Continue reading