Opinions about code places

wildfire1982

Regular
Joined
Oct 23, 2003
Messages
50
Location
Southampton
Hello folks,

I am currently making a program thats going to be doin quite a bit of number crunching. Basically its going to be predicting results of an experiment. So i am having an array which stores more arrays to get information about the ingredients to the experiment. I have a choice here and this is where im stuck.

I currently have a very pretty calculating dialog which was intended to do all of the number crunching. When this has finished calculating, it will give all of the results to a new form where it will be displayed graphically. Now do I

a) store the array in a module or class and let the new results form calculate everything

or

b) store the array locally in the calculating form and have it draw the graph before the form has loaded.

Any thoughts would be appreciated. I cant seem to go anywhere until I have decided and... I cant decide!

Predicament.

Cheers folks

Chris
 
Storing the data in it's own class will probably give you more flexability. If you require different ways of charting / displaying the data you can simply add new forms and get them all to reference the class rather than combining the calculation and output code in one place.
 
good point. ok, heres another one to think about. Really what i would like to do is let the user wait with the calculating screen rather than with a slowly completing form as it loads. What about if i were to use the data stored in the array of arrays to calculate in the "calculating" form and then have that output to an array in a class which is suitable for displaying things graphically. Would that be worth it? or is there any other alternatives that i havent thought about?
 
You could also investigate using multiple threads - the class could do the calculations in the background and the forms could show the results as they were generated - it may be a pain if the user changes something but it would be better for them if they could see it going wrong, fix and restart early on rather than having to wait for the entire process to finish before they know there was a problem.
 
Back
Top