On Thu, Nov 3, 2011 at 5:33 PM, Anthony Kong <anthony.hw.k...@gmail.com> wrote:
> Sorry to resurrect this topic. By google search the last discussion was in 
> 2003.
>
> I would like to find out what is the current prevailing view or consensus (if 
> any) on the use of Design Pattern in python?

I can only speak for myself, but the whole idea of design patterns is
broken. The existence of nontrivial design patterns indicates language
deficiencies. For more extensive corroborating discussions, see:
http://www.codinghorror.com/blog/2005/06/are-design-patterns-how-languages-evolve.html
http://c2.com/cgi/wiki?AreDesignPatternsMissingLanguageFeatures

Python thankfully has relatively few/minor deficiencies (so long as
one judges it within its dynamic language niche), so design patterns
per se aren't too relevant to it.

The canonical Python-specific design pattern is Borg
(http://code.activestate.com/recipes/66531-singleton-we-dont-need-no-stinkin-singleton-the-bo/
) [a variation on Singleton], and nowadays it (like its parent,
Singleton) is considered to be of dubious utility/advisability.

> I am doing some 'fact-finding' in this area on request of my colleagues. Some 
> of them want to buy a book or two in this subject area. Hopefully the 
> newsgroup can give me some book recommendation and insight in this topic.

The closest alternative would be some publication that gave examples
of using some of Python's fancier, higher-level features, such as
metaclasses and context managers. I haven't been in the market for
such a book, so I have no good recommendations to give. Closest I
could suggest would be the Language Reference
(http://docs.python.org/reference/ ) and relevant PEPs
(http://www.python.org/dev/peps/ ; they tend to include examples by
way of motivating use-cases).

> I myself pretty much subscribe to the view that the nature of python language 
> actually do away much of the need of the use of DP, but it is just a personal 
> view. It comes form my experience of migrating from webware4py (webframework 
> based on J2EE/servlet idea) to cherrypy

I am glad you agree.

Cheers,
Chris
--
http://rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to