Results 1 to 5 of 5

Thread: [RESOLVED] The difference of passing data

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    17

    Resolved [RESOLVED] The difference of passing data

    Just wondering what's the difference of usage of passing data by parameters with passing data through class properties ??


    Thanks...
    Last edited by zero cool; Sep 14th, 2005 at 02:53 AM. Reason: Object should be class properties

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: The difference of passing data

    A property could be considered some inherent trait of the object, while method arguments are just the data required by that method. The two overlap when you are talking about constructor arguments, but that's a special case.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    17

    Re: The difference of passing data

    Still dont get you...

    Do you mind posting some example of the differennt usage of those two ??

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: The difference of passing data

    Let's say you are talking about a hypothetical Person class. The Person class might have properties like Name, Age, Height, etc. These are attibutes inherent to a Person object. The Person class might also have a Walk method that takes as arguments a distance and a direction. The distance and direction arguments are the data necessary to execute the Walk method, but they are not actually attributes of the Person object that is doing the walking.

    There can also be another type of overlap between properties and methods, like the Visible property of a Form and its Hide and Show methods. Hide and Show set the Visible property to False and True respectively. There are no arguments in this case though. Basically, a property is something an object HAS and a method is something it DOES, with the method arguments being the information it needs to do that thing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    17

    Re: The difference of passing data

    Cool... Thanks a lot

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