Dos and Don'ts
- 1
Service
per use-case, services are throw away implementations Services
callCommands
- no logic in Services, no calling other servicesCommands
implement parts of use-cases and are thus re-usable- Subclass
ResourceQuery
andOrderQuery
when implementing use-case specific querying - One Transaction at a time - no TX in TX
- Commands are added to TXs and performed on close:
tx.addCommand(Command)
- Use
tx.flush() and as late as possible in your TX
tx.commitOnClose()
- Only access
ElementMap
s if really no other way, mostly usetx.get*By()
,tx.findBy()
and queries - if a specific get is missing, then add the method toStrolchTransaction
and send a pull request!