Using Just Enough CQRS: A Group of Products
Explore how to implement just enough CQRS by adding a catalog read model in Golang's event sourcing architecture. Understand how to handle key product events, implement repository interfaces, and adapt command handlers for asynchronous event processing.
We'll cover the following...
A group of products is called a catalog
Adding the read model for the catalog will be handled in a very similar fashion to the mall read model. We will not be going over each part in the same detail but will instead provide CatalogRepository, the list of interesting events, some of which are new, and an itemized list of the changes.
The CatalogRepository interface
This is the CatalogRepository interface:
The events, existing and new ones, mean we have ended up with more modification-making methods than ones performing queries. We are focused on projecting the events into the read ...