2009年5月29日星期五

[fw-mvc] get and set accessors

Probably more of a general coding debate, but...

What's your opinion on the pros and cons of using get and set
accessors? What's the Zend Framework strategy on this? Do you have a
preference one way or the other?

Any examples you can give that support your opinion would be great.

Here's one article suggesting that "getter and setter methods are
evil". It's written toward Java, but it seems like the debate easily
applies to PHP / ZF.
http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html.
Do you agree with what the author says?

-Ed

没有评论: