large info structure? [message #56127] |
Tue, 02 October 2007 08:10  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
Hi,
I'm writing a widget application which will serve as a data analysis
platform for scientific image data. The idea is that after loading
the image, there are many different types of analysis that the user
may wish to run on it, and this application will support them all.
There will be an 'Analysis' dropdown menu, for instance, with several
options. I also want to make it easy to add new analysis methods to
the program.
I've finished writing the front end and now I'm in the process of
adding some analysis. What I'm noticing is that the info structure
that gets passed around between event handlers is getting to be very
large. Mine is up to 130 variables, at the moment.
Does anyone have a strategy to suggest for dealing with this type of
situation? I'm worried that this info data will spiral out of
control. I was thinking that I could break down the info data into a
bunch of smaller structures, and hold pointers to each of those
structures in one higher level info structure..
thanks,
Mark
|
|
|
|
|
Re: large info structure? [message #56177 is a reply to message #56127] |
Thu, 04 October 2007 19:44   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
markb77@gmail.com writes:
> It isn't the actual size of the info structure that I'm worried about,
> it's the sheer number of entries in it. I tend to get lost in pages
> and pages of variables...
I've written a couple of what I consider to be fairly
big applications, but I don't remember pages and pages
of variables. Much closer to 100 than to 1000, certainly.
Although, I just counted 90 in PSConfig, which is the
last big program I wrote before I learned how to write
with objects in a sensible way. Maybe 1000 is not far
out of the ballpark. :-(
Cheers,
David
P.S. Let's just say, if I were to write PSConfig over, I'm
certain it wouldn't have anywhere close to 90 variables in
the info structure. And I second JD's call to get rid of the
NO_COPY keyword. There are MUCH better ways to pass information
around in widget programs!
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: large info structure? [message #56386 is a reply to message #56127] |
Wed, 24 October 2007 11:06  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
markb77@gmail.com schrieb:
> Hi,
>
> I'm writing a widget application which will serve as a data analysis
> platform for scientific image data. The idea is that after loading
> the image, there are many different types of analysis that the user
> may wish to run on it, and this application will support them all.
> There will be an 'Analysis' dropdown menu, for instance, with several
> options. I also want to make it easy to add new analysis methods to
> the program.
>
> I've finished writing the front end and now I'm in the process of
> adding some analysis. What I'm noticing is that the info structure
> that gets passed around between event handlers is getting to be very
> large. Mine is up to 130 variables, at the moment.
>
> Does anyone have a strategy to suggest for dealing with this type of
> situation? I'm worried that this info data will spiral out of
> control. I was thinking that I could break down the info data into a
> bunch of smaller structures, and hold pointers to each of those
> structures in one higher level info structure..
>
> thanks,
> Mark
>
Hi
lots of comments already. I am not sure if you know uname and that you
can get quite everything back you added to widget elements. So the
question is why do you like to duplicate this data?
cheers
Reimar
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFHH4ma5aOc3Q9hk/kRAgxKAKCLR7KRJNXsL/46lxrN3Qt1xZFTSgCf U4xu
IvrwWeTiGfyvXczNSM1HSpw=
=f0F/
-----END PGP SIGNATURE-----
|
|
|