Results 1 to 3 of 3

Thread: pass data to class or form

  1. #1

    Thread Starter
    Addicted Member CoMMiE's Avatar
    Join Date
    Jul 2000
    Location
    Malaysia, Kuala Lumpur
    Posts
    179

    pass data to class or form

    Hi

    I have some data that needs to be pass to another form in order to do some operation, my question is should i pass the data to the form directly, or should i pass the data to a class and have the form acess the data trough properties of the class?


    Thanks!

  2. #2
    New Member
    Join Date
    Aug 2000
    Location
    Lancaster, UK
    Posts
    8
    Why not pass the new form an object that is an instance of a class that contains the data

  3. #3
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    I think this is up to what kind of information it is, the amount of data and such.

    If it is information from many controls on the 1st form I would pass the form to the constructor of the second form to get a reference to the complete form. But if it is 1 or 2 things you might as well pass just those things to the second form.

    If its not information in the form but rather information in another object created from the first form I would pass the object instead.

    If it is a s--tload of data it might be good to serialize it somehow and then get it back when you really need it to minimize memory usage and such.

    If you elaborate a bit about your situation and what data we are talking about it might be easier to give a good recommendation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width