The following is a simple list of do’s and don’ts:
Service
per use-case, should mostly delegate to Commands
.Commands
implement use-cases or parts of it, and are thus reusable.ResourceSearch
, OrderSearch
and ActivitySearch
when implementing use-case specific search - this allows privilege checking.tx.addCommand(Command)
and then tx.commitOnClose()
tx.flush()
if you need to perform first some work and then as late as possible call tx.commitOnClose()
ElementMaps
if really no other way, mostly use tx.get*By()
, tx.findBy()
and searches - if a specific get is missing, then add the method to StrolchTransaction
and send a pull request!tx.stream*()
methods to iterate over all elements, if you don’t want to use a search.StrolchElementToJsonVisitor
.ParameterBag
with the id relations
to the object and then StringParameters
with the value being the ID, the UOM set to the type of element being referenced and the Interpretation set to the class type being referenced.