Another Term For Getters And Setters?

Discussion in 'Mac Programming' started by Darkroom, Jun 13, 2010.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    i can never remember what is the other term for getters and setters. what is it?
     
  2. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
  3. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
  4. ritsard macrumors regular

    ritsard

    Joined:
    Jun 18, 2009
    Location:
    SF Bay Area, CA
  5. macsmurf macrumors 65816

    macsmurf

    Joined:
    Aug 3, 2007
    #5
    No. You should probably look that up. :)
     
  6. Branskins macrumors 65816

    Joined:
    Dec 8, 2008
  7. Sydde macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #7
    Well, I know pointers and setters are hunting dogs, maybe getters should be renamed fetchers?
     
  8. ritsard macrumors regular

    ritsard

    Joined:
    Jun 18, 2009
    Location:
    SF Bay Area, CA
    #8
    hahaha alrighty... sorry for the mistake. but setting up an iVar as a property and synthesizing it should provide you the setters and getters hehehe thats what I was thinking.
     
  9. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #9
    Retrievers.
     
  10. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #10
    I know they're often useful and unavoidable, but when i was being taught OOP they were supposed to be scary. At the time the context was that you had a private/protected variable (if it was public, it would just be accessed directly... not good design, but this was the context we were given) that could be set using a public mutator. To me this seemed like nonsense, if you are letting the variable be set with a public method, why not just make the member public?

    Obviously encapsulation, being able to change private variable names, types, etc. in the future, having a standard interface, etc. is the answer, but in this particular course those things were more ephemeral.

    -Lee
     

Share This Page