From: Kevin A. <al...@se...> - 2001-09-02 17:46:24
|
> From: Patrick K. O'Brien > > So far we have focused on exposing as many attributes as possible through > dot syntax. At some point, however, we need to focus on which attributes > *should* be exposed. To help us all keep in mind the fact that good OO > design would have us limit the amount of exposure we give to an > object, I'd > like to start a discussion by recommending the following article by Allen > Holub. If you like this one, he has several others on his website. Let me > know what you think about this article on "What Is An Object" and what it > might mean for PythonCard: > > http://www.holub.com/goodies/what_is_an_object.html This is a good start for object-oriented issues, but I'm sure a lot of the OOP gurus lurking on the list can suggest some other ones. A lot of this article focuses on problems that arise due to the use of explicit types such as using an int versus a float which is always a problem with static typed languages like C. While we have some of these issues ourselves, Python reduces a lot of the type worries. For example, it is legal to specify a backgroundColor or foregroundColor as an rgb tuple (0, 0, 255), a named string "blue" or a hex string "#0000FF". Frankly, that makes a lot of OO programmers cringe, but I think it is easier for the user (programmer). Obviously, there are still exposed types there, and in C++ and Java you could do something like that too to support multiple argument types, so I guess my point isn't as relevant as it looked when I started this paragraph. :) Ah, now that feels like the OOP discussions I'm used to. The other part of the article hints at model-view-controller issues, but then goes in a direction that I find simply stupid, which is that every class has to know how to "draw yourself in this window" That is simply not doable, let alone maintainable, there are too many possibilities, so again you end up with a system that doesn't work except within extremely limited possibilities. ka |