Using a single accessor for setting/getting all your attributes is a bad idea because you can't easily do any validation or implement behavior specific to a particular attribute.
Say, for example, that you have an Employee class and you want to double check that an employee's salary isn't being set to a negative value or you want to update his benefits eligibility when his full_time attribute is set to true.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Class attribute get/set approach flaws?
by sauoq
in thread Class attribute get/set approach flaws?
by radiantmatrix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |