in reply to Re^2: The Accessor Heresy
in thread The Accessor Heresy
Let's put it another way: If you expose your attributes through the use of accessors, you have coupled your client to your implementation. Yes, you can have fake accessors like your Area accessor, and that can be a powerful tool. But, I think it's a poor way to have people think about your object.
I strongly urge you to take a look at Ruby's Array, Hash, String, and File classes. That is the standard I am now holding myself to when it comes to class design.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: The Accessor Heresy
by Roy Johnson (Monsignor) on Nov 28, 2005 at 19:34 UTC |