YAGNI! (Think twice before choosing ES and at least 10 times before choosing CQRS - Anyone with experience ever)
- Single value table on command side with index
- Implementable as service or sth. like that
- Use ProcessManager for creating ES-external entities
- Will not be able to replay because of constraints -> Only save identifiers, no FK constraints!
- e.g. Calculation of prices (-> Use shared logic container/model ?)
- What's needed first? If you need more output you need more vent details. You can't think of any required event detail beforehand. -> 1. Output, 2. Event, 3. Command, 4. Aggregate Root & Handler, 5. Projection. Hint: The more event details you have the easier your projections will be.
- Events may get more properties over time -> old events miss arguments but are still historically valid
- Solution 1 (works probably always): New events for new properties. Create a new Event class that holds all new properties. -> Clear version border
- Solution 2 (only specific use cases): Provide defaults in the database (attention if properties are serialized!) and add the new property to the event.
- Solution 3 (only specifc cases): Make the constructor argument optional with a default value that makes sense.