This project is read-only.

Notifying clients of BE changes to lookup tables

Apr 12, 2013 at 6:12 PM
I have an app that has a large number of lookup tables. These don't change often, but they do change. I could just download them once, as needed, and then refresh them the next time the user logs in. Or I could refresh them each time (but this then ads to the I/O overhead.

These are things like available colors, categories, credit card accepted, departments, territories, etc.

Is there a way to "push" an update out to the clients? Or notify them that one or more lookup tables should be refreshed? I was thinking of creating a service that simply returned a list of these lookup tables with the datetime of the last update. But didn't want to take the time if there was a better approach or if the CODE FW had something built in to handle it already.

Apr 26, 2013 at 6:36 PM
No, not really. In a SOA world, you don't usually have affinity in a way that allows outbound communications to the client. That is not to say of course that you couldn't implement something in addition.

I would probably do something like this: I would create a client-side object that you can use to get your lookup data. Maybe something like this:
public static class LookupHelper
    public static void List<Category> GetCurrentCategories()
So then this becomes your class to go to to retrieve categories, rather than directly from the service.

At that point, you can decide what your implementation of those categories should be. For instance, you can cache the categories local but every time before you access the categories you do a quick server ping to see what the latest update timestamp is on categories so you know whether you need to make the slower call that retrieves all categories. So that fulfills your minimum requirement. You could then do other things in addition. For instance, you could say that if you are on a LAN you could add some additional push mechanism that actually notifies the client so you don't have to poll before every call, which would make things more efficient if that option is available, yet your system would still function in scenarios where the push doesn't work.

All in all though, in most modern scenarios the pull is so fast that it is probably not worth jumping through all these hoops. But if you have one of those cases where you really need this, it is certainly possible to do it.