cqrs and mediatr

CQRS on ASP.net Core and the mediator pattern

From my experience, organizing a project, especially anything medium to large in size is always challenging. One of the ways that I found more success in doing so it’s implementing it using CQRS – Command Query Responsibility Segregation.

Due to the natural separation between the query and commands, organizing each and all the files related to a given command, like the value objects and validations give a clear idea of the functionality of the application and help multiple people to work on the project at the same time, as it’s easy to break in parts that can be worked in parallel.

I will be showing on this article how to configure an asp.net core project to use the mediator pattern to implement a simple CQRS on your project. Continue reading “CQRS on ASP.net Core and the mediator pattern”

Review: domain-driven design distilled, Vaughn Vernon

Domain-Driven Design Distilled

The book starts with an interesting definition of design, paraphrasing Steve Jobs:

Design is not just what it looks like and feels like. Design is how it works.

And from there he defines the principles of Domain-Driven Design in areas that affect the strategic design and the tactical design of an application, being strategic the areas related to business drivers and concerns and tactical related with implementation.

Read more >

Helping your asp.net core web API behave!

Behaving API

We all have been around a couple of asp.net web API’s and it’s safe to safe that you can get productive pretty quickly with it, especially if you deploying it to an azure web app or already have an IIS to deploy to!

Sometimes also you inherit an API when you join a new project and the outlook doesn’t look too good. Endpoints that do not perform, different return status code for model validation and even more disparate information for exceptions and so on. 

The API is behaving badly! [slap on the hand!!!] I’ll share with you 3 approaches that helped me on the past to improve the API, giving you a quick way to identify slow endpoints, validating models and handling exceptions without need to change the controllers, relying on middlewares and on a global filter to achieve so.

You can find the full source code on this GitHub repo! 

behaving not being too slow!

This one is pretty handy if due it’s implementation on a middleware. If you try to put a timer/stopwatch inside your controller and you have one or more filters associated with the method, and your problem is on the filter itself, then you out on the cold.

Continue reading “Helping your ASP.NET Core API to behave”

Book Review: Clean architecture, by Robert martin

Buy Clean Architecture Book at Easons

I’ve just finished the excellent “Clean Architecture: A Craftsman’s Guide to Software Structure and Design” by the famous “Uncle Bob” Martin.

Still a very relevant book for 2020 with timeless principles of software development and architecture!

SOLID Principles

You probably saw a hundred or more implementation of the 5 solid principles:

  1. Single responsibility
  2. Open/Close
  3. Liskov substitution
  4. Interface segregation
  5. Dependency Inversion

What the book highlights is not only what they are, but also why and when would you use them. It’s easy to see why teams that adopted those principles became more productive with better collaboration between the team members.

Continue reading “Review: Clean Architecture”