MVC

Patrick Mullen saluk64007 at gmail.com
Thu May 22 21:19:47 EDT 2008


In my experience, python is very pattern agnostic.  You can do functional or
object oriented or procedural fairly easily, have deep or light object
trees, or even mix procedural style with some object oriented code if you
like.  "There should be one way to do it" tends to not apply as much as some
would say, although the language doesn't bend over backward to make sure
programmers have flexibility.

MVC is a well respected pattern, and most of the major python web frameworks
are designed in an MVC way, so you should be just fine to use MVC for your
application.  Worry more about what pattern fits your application, than
whether your pattern fits the language.  For myself, whenever I try to do
strict MVC, it always tends to blend together.  I usually get some sort of
MC+V or MV+C sort of hybrid.  The model is also the view, or the controller
is also the model.  But that's just how I think.

Just keep in mind that python is not java, and you should be able to
transition very easily.  In fact, you could pretend python is java and go
far, but you risk irritating other python programmers who look at your code
:)  We had to use jython for a class, and my friend's code (he's a java
programmer) made me want to pull out my hair.  Private variables and get/set
functions all over the place...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080522/500de3de/attachment-0001.html>


More information about the Python-list mailing list