Re: Q: how do you generate get/set methods?
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.