Patterns and Practices for Building a Better Web API Architecture

By Joseph Woodward

Talk Abstract:

We've all worked with a n-tier and we all know the unbearable pains associated with them. Controllers fatter than Thomas the Tank Engine's Fat Controller, repositories that quickly become a dumping ground for data access with zero cohesion and arbitrary services that make the SOLID principles cry. All of these violations make for a codebase that's hard to maintain, tough to evolve and a terror to work with.

In this talk we'll look at an alternative architectural approach utilising such concepts as the Command/Query Responsibility Segregation pattern to better isolate and decouple our business logic from our framework whilst separating our read models from our write models. Whilst on our journey we'll stop and take a look at libraries such as MediatR and Brighter that enable such an architectural pattern. We'll also look at how this separation can lead to organising our API into feature folders for a better project structure and the additional benefits that come with such a concept.

We'll also look at how we can utilise pipelining features in MediatR and Brighter to introduce cross-cutting concerns such as monitoring, metrics gathering, logging and caching to our API.

About Joseph Woodward

Joseph is a .NET focused software engineer working at Just Eat, organiser of .NET South West and open-source contributor. His loves include programming, sharing knowledge, learning, growing, community, open-source software, speaking and blogging.