Memory concerns

G

Guest

I am creating an app which has multiple forms. Currently I am creating
global structures and using that to store the values between forms. I am
concerned about how much resources that may take. Is this a decent way to
pass values or is that a better practice for passing values between forms?

Opinions ?
 
J

John Roberts

Do you really mean 'structures'. Structs, I understand, are passed by value
by default which is probably not what you want. Objects are passed by
reference and so there is no particular memory overhead in passing them
between forms without needing to use anything 'global'. I doubt anyone would
object to you using the singleton pattern as an alternative.

- John
 
G

Guest

Thanks John...Yeah I did mean structure, but I am thinking that I should
start using struct in the future(using vb.net, planning to start doing
projects in c#).

Singleton Pattern...added it to the list of reading. It seems as though
the reading list grows faster then the read list.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top