Design Pattern and Python: Any book recommendation? Your view?
Ulrich Eckhardt
ulrich.eckhardt at dominolaser.com
Fri Nov 4 05:49:07 EDT 2011
Am 04.11.2011 01:33, schrieb Anthony Kong:
> I would like to find out what is the current prevailing view or
> consensus (if any) on the use of Design Pattern in python?
My consensus with myself is that design patterns are language-agnostic.
If I write "class Foo serves as view and controller for class Bar in a
model-view-controller (MVC) design", everybody that knows MVC has
immediately a very high-level understanding of how those two classes
interact.
> 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 Gang of Four book on design patterns is one you will probably come
across, and there are many that refer to it.
> 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
"webframework based on J2EE/servlet" - apart from J2EE being a specific
implementation, this also describes a design pattern, i.e. one where
(forgive me if I'm slightly off, this is not actually my field of
programming) the UI is browser-based and the program logic runs on a server.
Instead of explaining it in many words, you reused the known design
pattern to describe it, and that is also IMHO what design patterns are
about. They serve as a tool to make software that follows known
patterns, so that people that know the pattern will recognize them and
then get easier understanding. It also serves as tool when talking about
things, you don't have to explain the design when you can refer to a
pattern.
In that sense, I fully disagree that design patterns are obsolete in
Python. However, there are other patterns that are more
language-specific, like e.g. RAII in C++, so if you rather meant those,
I would agree with you.
Cheers!
Uli
More information about the Python-list
mailing list