New to OO concepts - re-usability

Thomas Gagne tgagne at ix.netcom.com
Tue Feb 20 22:38:24 EST 2001


I just had an interesting conversation today with my brother who is learning
programming from scratch.  He's learning Smalltalk, and was watching me debug a
program I'm working on and we visited the subject of reuse.

One of the things I learned recently (over in comp.lang.python, I think) was
that it is as important to reuse idioms as it is to reuse code.  By designing
your classes to work within the idioms of the language you're using your
program ultimately reuses more, and becomes more reusable (and more easily
factored) itself.

For instance, I could create all kinds of classes with their own protocol for
doing something, or I could endow them with behaviors that make them great
collection citizens.  In Smalltalk, that would be thinking of how using do:,
select:, collect:, detect:, and inject:into: on collection containing my
objects would be either easier or more useful.

Long-time Smalltalkers, and apparently Python programmers, may have already had
this drilled into their heads.  I don't remember reading anything about
designing software to work well within the idiom of any language in any of the
books I've read.  Maybe others have?

x wrote:

> Hi,
>
> I have been reading up on the OO environment, focusing on the use of UML to
> speed up creation of objects, or even to create superior designs of objects.
>
> Its great. Everyone is creating their reusable objects, no efforts are being
> wasted, these huge libraries are being built....are they?
>
> Does everyone create their own libraries, with a little sharing when
> requested, or is there some huge repository of objects available to all and
> sundry where the benefits of mankind's OO efforts are being stored nice and
> neat... you know, like the Human Genome project?
>
> I'm curious to know.
>
> Thanks
>
> Michael
> michael.wijtenburg at iafrica.com

--
.tom






More information about the Python-list mailing list