News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Alex Netkachov's Blog:
Are setters evil?
June 17, 2008 @ 09:36:03

Alex Netkachov has posted his own response to this opinion on the Typical Programmer on getters and setters in object-oriented applications.

"Do not use getters and setters" looks like a hastily advise, but its meaning is very important and it is "do not break encapsulation", which moves us to the question what the encapsulation is.

He notes that encapsulation is, in essence, hiding parts of the code away so that the user/other coders only see a little bit of the magic that happens. He argues that getters and setters are a valid part of the encapsulation process and that designing a good, easy to use system almost requires them.

0 comments voice your opinion now!
setter getter object oriented programming encapsulation


blog comments powered by Disqus

Similar Posts

David Walsh's Blog: Using PHP Generic Objects To Organize Your Code

Derick Rethans: Xdebug 2.3: Enhanced xdebug_debug_zval()

DevShed: Polymorphism, Design Patterns, and PHP Programming

Jani Hartikainen's Blog: Base classes in OOP programming languages

DevShed: Loading XML Strings with simpleXML in PHP 5


Community Events

Don't see your event here?
Let us know!


introduction php7 yii2 composer laravel api part2 symfony application example testing community framework language interview podcast opinion list series project

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework