• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Q: how do you generate get/set methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: how do you generate get/set methods?


  • Subject: Re: Q: how do you generate get/set methods?
  • From: Karl Goiser <email@hidden>
  • Date: Wed, 21 Jan 2004 12:01:29 +1100

Without wanting to act like a wet blanket, I would like to point out that one of the foundation principles of object oriented programming is 'encapsulation'. This is the idea that one object should not know about the internal state of another. This is a well established design principle and is fundamentally important in writing large, well behaved applications. For example, a driver of a vehicle is not, and probably should not be appraised of every piece of information a modern engine management system gathers.

Personally, I regard the automation of accessor method writing as counter this principle. Large numbers of accessor methods, to me, are an indication of poor design and a potential source of problems and unnecessary complexity. For example, if a method in object A needs to make many accessor calls to object B, that method may be better placed in object B - and reduce the need for the accessor methods.


Good programming everybody!


Karl
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Q: how do you generate get/set methods?
      • From: mmalcolm crawford <email@hidden>
    • Re: Q: how do you generate get/set methods?
      • From: Daniel Jalkut <email@hidden>
References: 
 >Q: how do you generate get/set methods? (From: Alexander Spohr <email@hidden>)
 >Re: Q: how do you generate get/set methods? (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: NSURLDownload step by step
  • Next by Date: Re: Authenthicate only once
  • Previous by thread: Re: Q: how do you generate get/set methods?
  • Next by thread: Re: Q: how do you generate get/set methods?
  • Index(es):
    • Date
    • Thread