Python Design Patterns

T

Tony Ha

Hello

I am learning Python for in the pass ten months, and have brought a few
books about Python. Most of them are good books by its only right, and all
of them only teach you how to write Python programs using Python syntax and
Python ways, but no one single Python book explicitly teaches you on how to
analyst your application, and structure your programmes in a way, so that,
it is easy to maintain, easily to reuse, (i.e. use loosely couple), and
easily to extend or add new features (programming to Interface instead of
Implementation) without introduce bugs into your existing working codes.

I recently brought a book called "Head First Design Patterns" published by
O'reilly. This book is simply a gem. It shows you how to use and apply
Design Patterns to analyst and structure your code, so that, the programs
can be easy maintains, reuse, modify and extend. (It is the books I have
been looking for a long time while I am learning Python, but cannot find
one). The only caveat about this book is that the authors use Java (not
Python) in the examples.

I wonder, can any Python guru out there translate the Java examples in the
book into Python examples, or write a similar book in Python, perhaps
called "Head First Design Patterns in Python". I think, this will be a
great addition to Python books, and a great benefit to Python community.

P.S. I am not sure is this the right news group to post this request.
 
D

Dave Cook

I wonder, can any Python guru out there translate the Java examples in the

Should be a good exercise, and not just for gurus ;}.
book into Python examples, or write a similar book in Python, perhaps

I've also wished for a design patterns book aimed at Python, or at least
dynamic languages with first class functions and modules. There's a paper
Python book with "Patterns" in the title, but it has precious little content
in it related to design patterns, at least not the GOF variety.

This web book has the word "Patterns" in it, too:

http://www.brpreiss.com/books/opus7/

But looks like it's mainly data structures.

If you do a google search, and also search the Python Cookbook

http://aspn.activestate.com/ASPN/Python/Cookbook/

you can find examples of:

Singleton
Borg
Null
Factory
Observer (including a Publish/Subscribe recipe)
Memento
State
Decorator
Masquerading and Adaptation patterns (Alex Martelli paper)
Template (another Alex Martelli paper)
Chain of Responsibility
Proxy
Prototype

There must be good examples in actual source code out there, too.
called "Head First Design Patterns in Python". I think, this will be a
great addition to Python books, and a great benefit to Python community.

I just bought this book as well. I must have adult ADD, because I do enjoy
the Head First format, though I disdained it at first.
P.S. I am not sure is this the right news group to post this request.

Yup, this is the place.

Dave Cook
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top