How to create a command

All changes to a domain is made with a command. There is no alternative. Even when you write something like :

  Book.Copies = 2;

a command is emitted by Hyperstore.

Basic commands like add or remove an entity/relationship and change a property value are called primitives commands and has the only commands availables when you instanciate a new store.

Based on the CQRS pattern, you can create your own business command to manipulate your domain. Every command must have a command handler to execute the code logic associated with the command.

Hyperstore allows you to create a command handler by domain. Then you can have different behavior depending of the context (the domain). See How to declare a command handler for that.

Create a command

All commands must extend AbtractDomainCommand.


Last edited Apr 30, 2014 at 12:03 PM by Zenasoft, version 5