- Call the accession method from the UI.
Pros:
...
...
...
Cons:
- Usually such business logic is supposed to be on server side
2 1. Initiate the accession from inventory by making a request to remote-storage module
Pros:
- Not so complicated
- The action is initiated by server
Cons:
- Will affect performance of Inventory
- Adding partly related business logic to inventory will make the code more complicatedThere will be still logic on UI about showing the message. So comparing with 1. option, the logic will be kind of duplicated on server and UI
3 2. Inventory will send Kafka messages to the topic with ids of changed items/holdings along with the attributes, which are changed.
Remote-storage module will subscribe to these notifications and check if the location was changed to the remote one. For this checking it will need to go to database (or cache this info for some reasonable time or use some cache eviction policy).
Pros:
- No remote-storage related business logic in Inventory
- It could be the common mechanism, as the same Kafka topic cab Event-sourcing from inventory provide decoupling of services and could be beneficial in many future use cases. For instance It could be used for search updates notifications (but worth mentioning, that search won't need the changed attributes info)Event-sourcing from inventory provide decoupling of services and could be beneficial in many future use cases, see: Search
Cons:
- Really more More complicated than other options
- Location information caching in policy is not clear
- There will be still logic on UI about showing the message. So comparing with 1. option, the logic will be kind of duplicated on server and UI
4 3. Use database triggers as @Tod Olson suggested in the doc to add the item to the queue, if the location is changed to remote.
Pros:
...
- Accession by button cannot be implemented in such case
- Business logic in the database
- Completely different approach will be for Caisoft
Rejected:
Call the accession method from the UI. was rejected because it cannot provide the same mechanism for changes of location from UI and changes that are applied automatically (e.g. data-import)
Pros:
UI have all the necessary dataUI still needs to show the popup, so the business logic for getting this info will be still on UI. The last remaining action would be to make one call to remote-storage module.It will be better for performance because in such case server won't need to verify, that the location is remote on every save action and then call another service if it has remote flag.
Cons:
Usually such business logic is supposed to be on server side