Private vs. Protected Members/Properties
So it’s been a while since I last posted anything and I just found this interesting page with an algorithm for choosing the correct scope for a class member/property - figured I’d share it for anyone interested:
— see: Michiel “El Muerte” Hendriks for more…Pretty much every object oriented programming language let’s you set the visibility of object members. Usually it defaults to public. That means everybody can access that member. Of course often you don’t want to [allow] other objects to access certain parts of your object. This is where private or protected come in to play.
Popularity: 100%
Trackback · Comments Off · Edit This
ICQ Status