[Zope] MVC pattern

Jeffrey Shell Jeffrey@digicool.com
Wed, 16 Jun 1999 10:58:46 -0400


> From: steve@hosys.com [mailto:steve@hosys.com]
> 
> Hello,
>  Does a template exist for implementing an MVC (VisualWorks 
> Smalltalk) like
> structure  for
> Products. The Product example I have shows inheriting Zope 
> class info and
> DTML info
> into the "domain object". I'd like a pattern where the Python 
> objects remain
> clean, are
> wrapped by a value model, and linked via the value model with 
> a presentation
> scheme (DTML). Some
> code is presented below to the idea across but is not a suggested
> implementation.

No real template exists, but it's one I would like to see.  Having spent
some time looking at OpenStep recently, I believe even more firmly in
it.

ZClasses (part of Zope 2) do bring this closer to light.  They make it
fairly easy to write a user-interfaceless Product class on disk, and
then you can subclass it through the ZClass interface (along with other
classes, like ObjectManager or Folder), and you can create Property
Sheets, Methods (ie, DTML methods and other external methods) and Views
(tabs) for the new ZClass and its instances.  We hope someday to have a
way of being able to subclass normal Python classes this way with little
or no fuss (ala the External Method/Pluggable Brain mechanisms) and
bring Zope closer to one of the original ideas of Bobo -- publishing
Python objects on the web.  This will make it even easier to bring
existing code into Zope.  (I still love the fact that (a couple of years
ago) I was able to turn an application from a socket-server based app to
a Bobo app in a matter of hours).

.jPS