Icepush with many views from appfoundation

I have a question. I am using appfoundation for view management. I have many views and events. I currently have events that are fired and shown on certain views. I also have global events that should fire and show no matter what view the user is in. Currently i was creating a new IcePush() instance in each view. But what do i do about the global events? Should i move the IcePush() instance to the main layout view and then have each child view access the push instance. Or should i create a global push instance and and additional instance in the child view?


All that ICEPush does is wake-up the browser so that it calls back the server to pick up what you have changed.

The easiest setup is to extend Application with a push method, and call app.push(). This will wake up one browser (one HTTP session, actually)

So to rephrase your question, if you have changes inside your application that update a number of views, then all the interested views should be listening to that change. If it is a global event, then all the views subscribe. Use something like the BlackBoard add-on, or to manage these events from your application layer to your UI layer.

A word of advice: when you receive your event, you should start a thread to process it, especially if you have many users with many views. Otherwise, everything takes place in sequence, and you’re wasting the multiprocessing capabilities and thread interleaving capabilities of your computer.