Fetch Status Messages

Fetch Status Messages

Old forum URL: forums.lhotka.net/forums/t/1962.aspx


lotrij posted on Wednesday, December 13, 2006

Hey,

In the application that I'm working on the fetches consist of executing a bunch of SQL statements.  Some of these can take a while to run, so we were thinking that providing the user with an overall status of each fetch would be a nice feature (something like a message just before and just after each statement runs).

I was wondering if anyone has considered this before?  Is there a way to get a message from the server version of the business object back to the client application midfetch?

 

Thanks,

Jonathan

twistedstream replied on Wednesday, December 13, 2006

Jonathan,

This really is more of a UI design issue than that of your business objects.  Theoretically any operation that hits the database could be take a bit of time to execute.  In the world of UI, anything that takes more than a second (especially in a WinForms UI) can annoy the user since it freezes up the main UI thread, making the application unresponsive.

A good approach would be to implement the Asynchronous Programming Model pattern in your UI code.  It uses a delegate on the client-side to invoke any method on its own thread so you don't tie up the main UI thread.  You can then display an hour glass or some kind of status bar.

Now this approach is easy to implement in a WinForms app (which I'm assuming is what you're building).  If you're app is ASP.NET, then things get a little more complex.  You can use APM but then you need some kind of callback mechanism from the browser to check the status of the request; Ajax works well here.  Another approach is to use something like this HTML Busy Box, which throws up a IFRAME with a "please wait" message while the long-running request executes.

~pete

Bayu replied on Wednesday, December 13, 2006

I agree with twistedstream that it is easiest, and usually sufficient, to improve on your UI.

In most cases it is simply not worth the extra effort to implement advanced notification schemes.

Everyone who once copied a bunch of files in Windows Explorer knows how terribly unreliable progressbars can be even in multi-million dollar software product like MS Windows. The good news here is that they have set the standard and paved the way for us: users kind of 'expect' progressbars and the likes to be not too reliable. So in most cases it should be sufficient to avoid a UI-freeze as twistedstream suggests, and your users will be ok with it.


Bayu

Copyright (c) Marimer LLC