Hi Laurens,
These are valid questions, unfortunately there is no single answer. I like the way you are thinking on the subject.
It's all depending on your requirements. If you do not run into response time issues I wouldn't bother too much. Otherwise here are some of my thoughts on your question.
In cases where it's no problem to not present the latest state of an entity you could think of periodically synching your app with SAP, e.g. the customers-organizational details do not change a lot, having them available at signin maybe makes the signin a tiny bit faster.
But then suppose you want to always start with the list of a customers open orders...How many open orders does a customre typically have...Only a few: no problem to get them from your oData service….A lot: hmmm maybe things start to slow down. But then how to solve this….
Well, I gave it some more thought. I think I'll do the following:
- When entities are successfully committed to the database I'll call the relevant odata service to create this specific entity (and get some SAP number in return). When it is a change, will call the change of course.
- When lists are requested I'll call the odata service for retrieval and update the mendix db accordingly. Will show the newly fetched data,
- When details are requested, could do the same thing regarding odata retrieval, but most of it is already done using the list retrieval.
- I could try to subscribe to the relevant SAP service to receive data when specific entities in SAP are new/updated/changed.
What do you think?
All the best!
Laurens