CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 40

Threaded View

  1. #14
    Join Date
    Aug 2000
    Location
    High on a hill in the Ohio valley
    Posts
    711

    Re: What's with all the Get/Set lines?

    Quote Originally Posted by TheCPUWizard
    The reasons for using properties, and ALWAYS keeping data private, is that it gives you the flexability to change the internal representation without effecting your clients. It also provides "hooks" for intercepting all read/write accesses.
    I'm sure you had some specific examples in mind as you were providing this broad and generalized statement. ? And it could be that your examples are not applicable to my scenarios but I'm willing to see if they are.
    In the past i did most of my hooking after the var is assigned a value so I'm not sure of the benefit of before its assigned. Seem like 6-to-1 1/2 dozen to the other.

    Quote Originally Posted by TheCPUWizard
    There is (almost) nevery a reason to have data members directly exposed.
    The words "quick", "easy", "full access" don't come to mind here?
    Last edited by alan93; June 21st, 2007 at 09:49 AM.

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

Featured