Load on demand

  • Thread starter Thread starter freddyboy
  • Start date Start date
F

freddyboy

Hi

I'm looking for a magazine article about load on demand , i have seen
it very recently (last month or so) but i don't recall which magazine.

the article is about load on demand

the problem we have is that our application takes a lot of time to load
(80 seconds) because it loads all the forms and data at the start up .

the article showed how to load the required information for the first
form and would load the rest in a lower priority thread.

but when calling a new form this would become the high priority info to
retreave

not sur if i'm clear enough

any help would be appreciated on load on demand and let me know if you
recall the magazine name and date

thanks
 
Hi freddyboy,

Don't know the magazine, sorry...

It's hard to conclude the best solution based on the limited
information provided, but you might be doing more in the "GUI" thread
than what is normally adviced. Usually, long running tasks like
fetching data from database/web serivice should be done in a separate
thread. This might, however, force you alter your code a bit and to use
the Control.Invoke method, becuase you cannot alter/access controls
created in the GUI thread from a different thread. The good side of
this is that your application will look more responsive, and you can
use progressbars for better user experience. Highly recommendable...

You can also delay the fechting of data and initial form setup until
the first time it's showed. Example: Recently we did an application,
where the user could open the main form with one or many tabs on it.
Each tab had to load a lot of data. Instead of fetching all the data
for all tabs at form load, we delayed it until the user clicks a tab
for the first time (making it visible). Very efficient. You should look
at the VisibleChanged event. The user might see the form flicker a
little the first time.

I hope this helps...

Christer
 
Thanks Christer

Your application is like ours a form with tabs

I would have done the retrieval on the tab change also but since i'm
new here and they decided that everything should be loaded at start up
with a splash screen (I hate this behavior )

now we want only the basic information loaded at start up and load the
other tabs in the background so when the user changes tab it will
already be loaded.

thats what the article was about loading data in the backgroud and
changing the priority if the user chooses a tab not already loaded.

I will take a look at your suggestion though
 
Back
Top