Hi,
In my opinion (which is a very modest one compared to some of the geniuses
that roam around in this list) you should validate and automatically convert
the value if it's of the expected type but out of range (less than 0 gets
converted to 0 and more than 100 gets converted to 100).
The OO motivation behind using setter (and getters) is that it enforces the
notion that nobody should be able to manipulate the state of the object
except the object itself. If you follow this design principal as well as a
handful of others, you will keep your code low-coupled, less likely to be
2 matches
Mail list logo