[Tutor] Design - getFoo and setFoo methods

alan.gauld@bt.com alan.gauld@bt.com
Sun, 19 May 2002 18:00:08 +0100


> I think it's still okay to just use classes to store only data,
> (if the overhead is not a problem), but it's not OO design, 

Absolutely. Let me clarify.
There is absolutely nothing to prevent us from wrapping some 
data up as a class and even accessing the members directly.
But its not Object ORIENTED design, its design using Objects.

Good OO design tries to build abstract frameworks which are 
implemented using concrete instances specialising the abstract
protocol of the framework to the specific problem at hand.

The best book to cover this IMHO is Robert Martin's 
"OOD using Booch" but be warned it's quite heavy going.

> just preferring obj.member syntax to dict[member]. IOW it's now a
> matter of syntax, not design. Design is the same as in a
> dictionary.

Yes, and in Python its all dictionaries under the covers anyhow!

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld