Flexbase Solution Structure
The second project in presentation layer is the Messages, that consists of all commands, and events for the application. The commands are the instructions that are given by the front-end API to get executed as an asynchronous process in the command handlers. Example for a command can be AddCustomer command raised for adding a customer. Commands are always meant to be executed only once.
As a result, the command handlers raise the events and are again processed by the subscribers. After the command is executed, it can raise an event, for example CustomerAdded after the customer is saved in the database. This can be used by other processes in different subscribers after further refinement. There can be many subscribers subscribing to a single event.