New to OO concepts - re-usability

Chris Lopeman lopemanc at swbell.net
Wed Feb 21 09:13:36 EST 2001


Actually much of what you have talked about here is simply covered under different
topics.  Mostly it is referred to as polymorphism.  This is one of the three basic
concepts behind OO.  Another subtopic that touches on this is "inheritance based on
behavior".  While much inheritance is based on data (and this is how people are
usually taught) the more advanced you become you will learn how to recognize where
inheritance should take place based on behavior.

Chris Lopeman
Object Link Inc.

Thomas Gagne wrote:

> 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