Catalog of Python Patterns? [LONG!]

Gordon Scott gordon.scott at peregrine.com
Thu Apr 4 11:15:24 EST 2002


There IS a separate Smalltalk companion book to DP (but different authors).
I'm currently using in it a class I'm taking.  It describes implementations
of the 23 GoF patterns in Smalltalk, utilizing it's dynamic aspects that 
are sometimes much different than DP's C++ implementations and probably
more applicable to python.

If you're interested in patterns for Python it's probably at least worth
a trip to the bookstore to flip through...if you can find it. Might be a
special order item..
 

-----Original Message-----
From: jimd at vega.starshine.org [mailto:jimd at vega.starshine.org]
Sent: Thursday, April 04, 2002 1:03 AM
To: python-list at python.org
Subject: Re: Catalog of Python Patterns? [LONG!]


In article <mailman.1017886389.26908.python-list at python.org>, Delaney, 
Timothy wrote:

>> From: Paul Rubin [mailto:phr-n2002a at nightsong.com]
>> jimd at vega.starshine.org (Jim Dennis) writes:

>>>  At a minimum it should list each of the 23 GoF patterns, and
>>>  at least one minimal Python implementation of that pattern.

>> Yucch, I've never been a fan of that book, it seems too cultish to me.

> More importantly, many of the patterns are not applicable to Python.
_Design
> Patterns_ comes from a C/C++ point of view ... there is also _Design
> Patterns for Smalltalk_ (or something along those lines) which is
apparently
> much more applicable.

 Actually the GoF book has some C++ and some Smalltalk examples.  They
 aren't separate.

> It is useful to *know* the GoF patterns, but it is important not to be a
> slave to them.

>Tim Delaney

 I agree that the book has somewhat of a cult following, and I'm
 naturally wary of cults.  I also agree that one should not be a 
 slave to fashion, and that some of the hype of "patterns" (and
 XP, and ...) is "fashion" more than practical.

 However, I'm trying to understand them well enough to distinguish
 which parts of useful versus cosmetic.

 I disagree (with one followup that's not quoted herein) that
 patterns are not applicable to Python.  The author of that comment
 claimed that GoF was a C++ specific book (which is untrue, as I 
 point out above).  Python is much more like Smalltalk than C++,
 and the GoF specific chose it because it is a dynamic language
 --- for its contrast to C++ and its ilk.

 As I pointed out in my post, Python employs several patterns in
 its core and standard libraries.  Every class is a Factory, the
 Bastion module returns Proxy objects, we see Iterators all over
 the place, etc.  So I still want to see more.


-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list