Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-05-23 13:39:13

"Edward Diener" <eddielee_at_[hidden]> writes:

>> If you are making designs that would normally have a lot of getters
>> and setters, it suggests that they may have an insufficient level of
>> abstraction. Of course, that isn't neccessarily the case -- but it
>> does seem to be the rule in my code. I personally don't have a need
>> for this facility and I don't think I want a library that would
>> encourage that style.
> I don't see what getters and setters have to do with levels of
> abstraction. Needless to say I see nothing wrong with the style
> that uses properties, but since you didn't say what bothers you
> about that style I can't answer for why you don't like it. Care to
> explain ?

When classes have a lot of getters and setters or, equivalently,
exposed properties that are just reflections of underlying data
members, they usually represent just a collection of exposed data
values rather than a higher level of abstraction.

I haven't read through this to see if I agree with any of the points
being made, but you can read an article on the subject here:

and a pretty comprehensive discussion here:

To the extent to which properties (which I *do* think have a place in
good software) are just syntactic sugar for getters/setters, the same
arguments apply.

You can of course make up your own mind about this stuff ;-)

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at