Project: Vertical Slice Architecture
Context: We are getting tired of layering, and we got asked to rebuild our small demo shop using Vertical Slice Architecture.
Here is an updated diagram that shows how the project is conceptually organized:
Each vertical box is a use case (or slice), while each horizontal arrow is a crosscutting concern or some shared components. This is a small project, so the data access code (DbContext
) and the Product
model are shared between all use cases. That sharing has nothing to do with Vertical Slice Architecture, but as a tiny project, it is hard to split it up more. I'll go into more detail at the end of the section.
Here are the actors:
ProductsController
is the web API entry point to manage products.StocksController
is the web API entry point to manage inventory (add or remove stocks).AddStocks
,RemoveStocks
, andListAllProducts...