<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>From Accessibility to Zope &#187; Frameworks</title>
	<atom:link href="http://blog.mauveweb.co.uk/category/frameworks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mauveweb.co.uk</link>
	<description>experiments in contemporary web development</description>
	<lastBuildDate>Thu, 18 Aug 2011 23:26:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Satchmo</title>
		<link>http://blog.mauveweb.co.uk/2008/01/07/satchmo/</link>
		<comments>http://blog.mauveweb.co.uk/2008/01/07/satchmo/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 12:21:49 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[e-Commerce]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2008/01/07/satchmo/</guid>
		<description><![CDATA[Since I've been using the Django framework for web development I've been pointed in the direction of the Satchmo framework a few times. Satchmo is intended to be the framework for e-Commerce development built on top of Django. I've looked at Satchmo more than once trying to weigh up whether it would be a useful [...]]]></description>
			<content:encoded><![CDATA[<p>Since I've been using the Django framework for web development I've been pointed in the direction of the <a href="http://www.satchmoproject.com/">Satchmo</a> framework a few times. Satchmo is intended to be <em>the</em> framework for e-Commerce development built on top of Django. I've looked at Satchmo more than once trying to weigh up whether it would be a useful thing to use for projects, because an e-Commerce framework certainly should be useful. Satchmo doesn't satisfy this expectation.</p>
<p>I have written an e-Commerce shop in Django. It took three days, much of which was spent writing the backend &#8211; basket, order processing and so on. I am absolutely certain that I couldn't have done that with Satchmo. The first reason is that Satchmo isn't orthogonal; it's impossible to use Satchmo's basket/ordering system without using Satchmo's products front end. Front ends are very easy to write in Django and I needed something custom for this shop. Custom front ends are very hard to write in Satchmo &#8211; they involve writing custom extensions to the product model. The second reason is that Satchmo doesn't use Enterprise Design Patterns like <a href="http://martinfowler.com/eaaCatalog/money.html">Money</a>.</p>
<p>Satchmo also provides code that is very much outside its remit as a framework, like <a href="http://www.satchmoproject.com/trac/wiki/SatchmoAnalytics">this strange configuration property which embeds Google Analytics</a>. Google Analytics code is trivial to paste into the templates should I want to do so. Why would I need this built into the platform?</p>
<p>Satchmo doesn't satisfy as a framework; it's more of an off-the-shelf application regardless of what the authors claim. Now I have Django web shop code, I won't be needing Satchmo.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2008/01/07/satchmo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scheduling Events</title>
		<link>http://blog.mauveweb.co.uk/2007/08/09/scheduling-events/</link>
		<comments>http://blog.mauveweb.co.uk/2007/08/09/scheduling-events/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 18:25:15 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/08/09/scheduling-events/</guid>
		<description><![CDATA[There are several situations in web application programming where it is necessary to schedule events to happen in the future, outside of the request driven model. Some of the most common are these:

Expiring static files from the webserver. Some data can be cleaned up whenever a page is requested. On occasion, though, the application establishes [...]]]></description>
			<content:encoded><![CDATA[<p>There are several situations in web application programming where it is necessary to schedule events to happen in the future, outside of the request driven model. Some of the most common are these:</p>
<ul>
<li>Expiring static files from the webserver. Some data can be cleaned up whenever a page is requested. On occasion, though, the application establishes the contract that a file will stay around for a fixed period of time. When access to these files is provided by the webserver (not through the application itself) then the files need to be deleted at a given future moment.</li>
<li>Time-based notifications. For example, if you deal with dates and times in your web application it's sometimes necessary to actually notify users (most often, via email) at a given time. It's clearly not acceptable to wait until someone hits a page (possibly hours or days later) to issue these notifications.</li>
<li>Syndication. Polling data on remote servers has to be done ready for when a user hits a page, because otherwise it can introduce an unacceptable delay while variously contactable remote hosts are queried.</li>
</ul>
<p>In several of my web applications now I've come to a sticking point when it comes to scheduling events. As far as I know this is always left up to the developer to arrange. Scheduling events is considered outside their remit.</p>
<p>There are a few solutions I know of.</p>
<ul>
<li>The application can provide a script which the administrator must schedule to be run periodically at install time. Drupal, for example, recommends adding a crontab entry which periodically wgets a script on the web site. In redistributable apps, many users will obliviously skip this step and wonder why the application won't work.</li>
<li>Run scheduled tasks after serving each page. This approach doesn't solve the above problems. In mod_php/perl/python applications this hogs a webserver thread too, which could degrade performance.</li>
<li>There are websites like <a href="http://www.webcron.org/index.php?lang=en">webcron.org</a> that will fetch a script on your server at intervals. It would be madness to rely on this in your own applications or suggest this as a solution for a redistributable applications, so it's only suitable as a fallback if all else fails.</li>
<li>The application may be able to use to the system scheduler (cron/at on Posix, Windows Scheduler Service on Windows). While it should be possible for a <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> application to enqueue things into the webserver's user's crontab (as long as <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> isn't restricted to "safe mode"), I'm not sure that this is advisable. Most offline applications I know that need to schedule something spawn their own daemon to handle scheduled events, even if it sits idle most of the time.</li>
</ul>
<p>I can't see why the frameworks shouldn't provide an <acronym title="	Application Programming Interface">API</acronym> for scheduling tasks. This would have the advantage of being simple, integrated and portable, and it could negotiate to use the platform scheduler or fall back to spawning a daemon to dispatch events.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/08/09/scheduling-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More on Django</title>
		<link>http://blog.mauveweb.co.uk/2007/07/02/more-on-django/</link>
		<comments>http://blog.mauveweb.co.uk/2007/07/02/more-on-django/#comments</comments>
		<pubDate>Mon, 02 Jul 2007 22:28:54 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Frameworks]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/07/02/more-on-django/</guid>
		<description><![CDATA[As I come to the end of my first project using Django, I can offer a slightly better picture of how Django actually measures up in the field. In general I found that the bulk of the application was easier than I'd expect, but the remainder was more time consuming than I'd expected.
As mentioned before, [...]]]></description>
			<content:encoded><![CDATA[<p>As I come to the end of my first project using Django, I can offer a slightly better picture of how Django actually measures up in the field. In general I found that the bulk of the application was easier than I'd expect, but the remainder was more time consuming than I'd expected.<span id="more-78"></span></p>
<p>As mentioned before, Django's weakest link is its rudimentary template language. Content and data has to be digested and spoon-fed to the templates because the templating language doesn't provide the tools required to manipulate data arbitrarily. This doesn't allow the separation of presentation and controller code that is the purpose of a templating language. Instead, each template has a one-to-one dependence on the code which sets up the model. On the plus side, it's very easy to track where the thread of execution goes in these templates. A potentially dangerous issue is that the templating system defaults to not escaping data variables. This is effectively <acronym title="Cross-site scripting">XSS</acronym> unaware. Inverting the semantics such as to escape everything unless I tell you otherwise (to insert <acronym title="eXtensible Markup Language">XML</acronym>/SGML markup, say) would fix this.</p>
<p>The philosophy given by the Django documentation for the design of its templating is that</p>
<blockquote><p>We wanted Django’s template language to be usable for more than just <acronym title="eXtensible Markup Language">XML</acronym>/HTML templates. At World Online, we use it for e-mails, JavaScript and <acronym title="Comma Separated Value">CSV</acronym>. You can use the template language for any text-based format.</p></blockquote>
<p>This "one size fits all" approach is self-evidently misguided. <acronym title="eXtensible Markup Language">XML</acronym> and JSON need a guarantee of structural validity but they rarely need re-styling anyway. (X)<acronym title="HyperText Markup Language">HTML</acronym> needs escaping. Javascript (other than JSON) should be static anyway. <acronym title="Comma Separated Value">CSV</acronym> barely needs an <acronym title="	Application Programming Interface">API</acronym>, let along a templating language. Emails&#8230; well, OK, this is a fine templating language for text-only emails.</p>
<p>I'd also found my Django application hard to structure. Views (functions called by the Django context in response to different request URIs) shouldn't contain application code. Following that philosophy, my code is split mainly into four classes in two Django "applications", a handful of utility functions in the <acronym title="Object-Relational Mapper">ORM</acronym> models, and everything else is wrapped up in the 20 or so views. They don't do more than delegation and template context setup, but there be semantics in them there views, and those semantics aren't codified a form that can be nested and built into more advanced and interdependent web applications. For larger applications, Django will need code to modify and extend the framework, but there isn't a good <acronym title="	Application Programming Interface">API</acronym> to plug in this code. It's a mixture of adding the class names to the config file, and giving modules special names within the package.</p>
<p>These issues tends to convey to me the general sense that Django code is hard to tie together. Overall, to build an application as elegantly structured as my current web shop code would require a sizable layer on top of the Django framework, with the occasional aspect of Django re-written too. But then, my current shop code has already borrowed some of the best aspects of programming with Django as well as a handful of other frameworks too <img src='http://blog.mauveweb.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/07/02/more-on-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django</title>
		<link>http://blog.mauveweb.co.uk/2007/04/06/django/</link>
		<comments>http://blog.mauveweb.co.uk/2007/04/06/django/#comments</comments>
		<pubDate>Fri, 06 Apr 2007 13:06:21 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Frameworks]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/04/06/django/</guid>
		<description><![CDATA[For the past couple of weeks I've been developing a web application for a client in the Django framework. I looked at frameworks before I started, wondering what I could use to make the development of this project easier.
I have previously mentioned why I abhor PHP even as I developed Mauvespace in that language, but [...]]]></description>
			<content:encoded><![CDATA[<p>For the past couple of weeks I've been developing a web application for a client in the Django framework. I looked at frameworks before I started, wondering what I could use to make the development of this project easier.</p>
<p>I have previously mentioned why I abhor <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> even as I developed Mauvespace in that language, but as I started this project <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> seemed utterly unconscionable. <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> doesn't offer anything apart from a dodgy syntax, incomplete object model and an <acronym title="	Application Programming Interface">API</acronym> consisting of a basic <acronym title="Common Gateway Interface">CGI</acronym> wrapper and bindings for a few library functions. Alternatives included my Python framework, but that is a long way from being ready for the mainstream. In fact it's been all but abandoned. I originally wrote it to serve static sites generated from <acronym title="eXtensible Stylesheet Language">XSL</acronym> and <acronym title="eXtensible Markup Language">XML</acronym>, but then found myself bolting in little bits of <acronym title="Common Gateway Interface">CGI</acronym> scripts and eventually writing a whole <acronym title="Object-Relational Mapper">ORM</acronym>.</p>
<p>I had also been looking at Zope, and particularly Zope 3, but Zope has a ridiculous learning curve. It does seem appropriate for more large-scale, extensible development though. It's just that most web application projects for SMEs don't need to be so enterprise that they require unit tests for everything and interfaces saying what each class will do as well as an implementation. I am looking into Zope but I don't expect to find a project that it will be suitable for very often.</p>
<p>So Django then. I'd seen Django before and discounted it because of its templating language, which was not what I wanted. I wanted to use <acronym title="eXtensible Stylesheet Language">XSL</acronym>, obviously. <acronym title="eXtensible Stylesheet Language">XSL</acronym> and <acronym title="eXtensible Markup Language">XML</acronym> can together be handed to browsers. This makes writing <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> applications much easier: no special handlers are required to be able to pass <acronym title="eXtensible Markup Language">XML</acronym> data to the client. With the same requests, Javascript can create whatever <acronym title="REpresenational State Transfer">REST</acronym> model it likes.</p>
<p>But regardless, it looked more appropriate than anything else at this point.</p>
<p>So Django then. I was really impressed with Django initially. I say initially because while I managed to write about half of the application in the first two hours of using it, the rest has drawn out and out.</p>
<p>Django has an excellent <acronym title="Object-Relational Mapper">ORM</acronym>. However, it makes the mistake of trying to encapsulate all of <acronym title="Structured Query Language">SQL</acronym> in the Python Object Model, which is a kind of antipattern in itself. This happens all the time with <acronym title="Object-Relational Mappers">ORMs</acronym>, because while it's easy to make database rows appear to be objects, <acronym title="Structured Query Language">SQL</acronym> is designed to do clever things that you don't really want to re-implement in another layer just because you can abstract it. Django's <acronym title="Object-Relational Mapper">ORM</acronym> allows users to write code like Game.objects.get(id=the_game) to retrieve a single game. That's lovely. Then it allows you to write code like Game.objects.filter(category=this_category), and it <em>lazily</em> evaluates the query, even allowing you to chain these filters lazily. Which is fantastic.</p>
<p>Then you hit queries like finding objects with date ranges. In <acronym title="Structured Query Language">SQL</acronym> this is easy.</p>
<p><code><span style="color: #993333; font-weight: bold;">SELECT</span> * <span style="color: #993333; font-weight: bold;">FROM</span> games <span style="color: #993333; font-weight: bold;">WHERE</span> start &lt;= NOW<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AND</span> end &gt; NOW<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></code></p>
<p>In Django this is munged into a horrific double-underscore variable name:</p>
<p><code>now=<span style="color: #dc143c;">datetime</span>.<span style="color: #dc143c;">datetime</span>.<span style="color: black;">now</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
Game.<span style="color: black;">objects</span>.<span style="color: #008000;">filter</span><span style="color: black;">&#40;</span>start__lte=now, end__gt=now<span style="color: black;">&#41;</span></code></p>
<p>If you're a programmer this should be fearing you with dread as to what comes next. Two sets or more of double-underscores starts performing joins, I believe.</p>
<p>So Django's <acronym title="Object-Relational Mapper">ORM</acronym> is a bit unwieldy, but this should come as no surprise because I think many <acronym title="Object-Relational Mappers">ORMs</acronym> are like this. One that I have seen that avoid this is Joomla's, where you just hand off an <acronym title="Structured Query Language">SQL</acronym> query to the <acronym title="Object-Relational Mapper">ORM</acronym> and it just populates objects from the results. Trying to construct complex queries in an object-oriented way is likely to be harder and less maintainably than just writing the <acronym title="Structured Query Language">SQL</acronym> query, and so I think this is the best solution in general.</p>
<p>Django's <acronym title="Object-Relational Mapper">ORM</acronym> libraries handily integrate with other bits of the system, such as administration screens, meaning almost no work has to be done to make your database rows entirely editable, with configurable permissions, from the admin screen. This is a big win for Django. There's no way you could even contemplate this with, say, Zope, because the <acronym title="Zope Object DataBase">ZODB</acronym> stores arbitrary objects and an admin screen would have to deal with, basically, all of Python.</p>
<p>The annoyances I've found later on in the development of Django is that it's not intuitive. There's a vast wealth of features, and you have to keep looking at the documentation to find them all. There is a <strong>lot</strong> of magic involved. This is Python's fault, really. Magic is easy to do in Python, and a lot of developers won't have any issues with jumping in and creating magic for ever situation. This means that there is much less code to be written for performing many tasks, but magic has drawbacks. Developers have to understand what the magic is doing for them. In languages where magic is hard, developers can read the code and know, with very little context, exactly what it will do and why. With magic, the object model and even elements of the language can be warped. I'd agree that magic is good for an ORM: it should mean that you can get an object that magically persists. You don't need to know what's going on to make it persist. However, Django goes way too far with the magic. Admin screens are driven by magic variables. The <acronym title="Uniform Resource Locator">URL</acronym> configuration is slightly magical. I think permissions are almost entirely magical but I haven't got into that yet.</p>
<p>Then there's the templating language. I was set to hate this from the beginning. There is a much-vaunted feature called template inheritance (according to the documentation "the real power of Django templates". Apparently this allows one template to extend another. In practice this doesn't do anything more than allowing you to stuff some chunk of content into another template. The only situation this appears to be useful is in stuffing the main content of your page into a layout. Woo. It doesn't allow you to do really useful things, like calling templates that create generic page elements with arbitrary content. At least, without creating an inheritance tree of dozens of little template element files in a manner that is likely to be quite unmaintainable. Templates can read Python variables and attributes of Python objects that are passed to them. They can apply "filters" which are written in the core Python code. They can't do anything else, like even computing simple expressions. This is annoying; few other templating languages are so restricted.</p>
<p>In future it's likely that I'll write a Django middleware to do <acronym title="eXtensible Stylesheet Language">XSL</acronym> transformation. Then I won't need Django's stupid templating. This doesn't sound like it will be too hard.</p>
<p>I'm currently trying to solve a problem with User authentication. I have a function, tickets_remaining() which I wanted to add to the User authentication class. But I can't do this. I need to create a separate Profile model and retrieve this instead.</p>
<p>So Django: on the whole, I'm impressed with it. The design is easy, extensible, and fast to get going with, but there are some caveats with the <acronym title="	Application Programming Interface">API</acronym> and particularly the templating.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/04/06/django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plan for 2007</title>
		<link>http://blog.mauveweb.co.uk/2007/01/08/plan-for-2007/</link>
		<comments>http://blog.mauveweb.co.uk/2007/01/08/plan-for-2007/#comments</comments>
		<pubDate>Mon, 08 Jan 2007 12:59:07 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Mauvespace]]></category>
		<category><![CDATA[RDF]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2007/01/08/plan-for-2007/</guid>
		<description><![CDATA[New Year is a good time to look forward to the things we hope to achieve over the next year. So I thought I'd define now my main (technological) priorities for the year ahead so that I can get some sense of focus.

Get up to speed on RDF and get using it in applications. I [...]]]></description>
			<content:encoded><![CDATA[<p>New Year is a good time to look forward to the things we hope to achieve over the next year. So I thought I'd define now my main (technological) priorities for the year ahead so that I can get some sense of focus.</p>
<ol>
<li>Get up to speed on <acronym title="Resource Description Framework">RDF</acronym> and get using it in applications. I am not a total stranger to <acronym title="Resource Description Framework">RDF</acronym> but I've not used it at all so far. The main focus of my effort for now is a new project called <a href="http://www.mauvespace.com/">Mauvespace</a>. Mauvespace is an open-source web application that is a cross between a semantic <acronym title="Content Management System">CMS</acronym> for personal homepages and a full social networking service. I don't want to hype it too much now though until there is something to show. But I hope very soon to roll up all of my homepage stuff from <a href="http://mauveweb.co.uk/">Mauveweb</a> into Mauvespace, then throw it open to other people to use it for the same thing, either on my server or on their own. This frees up the mauveweb.co.uk domain, which could become a place for web projects. Sorry about all the 'Mauve's. I guess I'm not very imaginative with names. Although, it works as a brand, I suppose.</li>
<li>Deploy some applications using Zope. My Python web applications are becoming increasingly Zope-like. The latest one I've been working on for a client is a self-contained web server, but that's partly because I wanted very careful handling of file uploads. I needed to remove file size and memory limits imposed by <acronym title="PHP: Hypertext Preprocessor">PHP</acronym>, and I implement concurrent querying of the status of uploads, which allows me to provide <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> progress bars. There are lots of parallels with Zope: that it's Python; that it's a web server; that any persistence is object-based (although in this application it's in-memory persistence; non-volatile data is retrieved from other network services mandated by the brief). Anyway, in 2007 I hope to transfer from ad-hoc Zope-like systems to Zope proper with all the advantages that brings. It's just a shame there have always been reasons not to so far. Unfortunately Mauvespace is <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> by necessity. <acronym title="PHP: Hypertext Preprocessor">PHP</acronym> is the only language that enjoys widespread hosting support and I consider that vital.</li>
<li>Hack <a href="http://www.inkscape.org/">Inkscape</a>. Inkscape is of course hugely important to my work and as a result I've become quite involved with making sure it meets my needs, mainly through bug reporting, feature requesting, and so on. I would like to stretch my C++ legs and improve things, if I find time. Incidentally Inkscape 0.45 has been bug hunted and is moving to feature freeze very soon. The headline news is the Gaussian blur feature but there are <a href="http://wiki.inkscape.org/wiki/index.php/ReleaseNotes045">a plethora of other improvements</a> too.</li>
<li>Continue the high standard of technical commentary on this blog <img src='http://blog.mauveweb.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Actually, I wish I could get it more organised and make it more accessible to people who aren't knowledgable web developers. But if it would be less personally useful to me if that was the case. So the status quo may have to suffice.</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2007/01/08/plan-for-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zope</title>
		<link>http://blog.mauveweb.co.uk/2006/11/21/zope/</link>
		<comments>http://blog.mauveweb.co.uk/2006/11/21/zope/#comments</comments>
		<pubDate>Tue, 21 Nov 2006 03:15:32 +0000</pubDate>
		<dc:creator>mauve</dc:creator>
				<category><![CDATA[Frameworks]]></category>

		<guid isPermaLink="false">http://blog.mauveweb.co.uk/2006/11/21/zope/</guid>
		<description><![CDATA[You might have noticed that the title of this blog includes the name Zope, but that I have, thus far, not so much as mentioned Zope. Not to worry, I have been looking into Zope, but it is a big subject, and it's incredibly time consuming to just sit and read swathes of documentation to [...]]]></description>
			<content:encoded><![CDATA[<p>You might have noticed that the title of this blog includes the name Zope, but that I have, thus far, not so much as mentioned Zope. Not to worry, I have been looking into Zope, but it is a big subject, and it's incredibly time consuming to just sit and read swathes of documentation to even get an inkling as to how to work with it.</p>
<p>I do have a couple of ideas for web applications which I would consider writing/rewriting in Zope pretty soon.</p>
<p><span id="more-41"></span>I have only looked into Zope 2 so far, because that's what's available in Debian Stable, which is what is currently running on my web server. I am starting to understand some of the things Zope does, but I'm not at this point particularly sure why it does them.</p>
<p>The truly wonderful thing about Zope is the <acronym title="Zope Object DataBase">ZODB</acronym>, Zope's Object <acronym title="DataBase Management System">DBMS</acronym>. This was what really attracted me to Zope in the first place, working as I have been with Python CGIs with persistence mainly provided by my session class, which just pickles objects to temporary storage.</p>
<p><acronym title="Zope Object DataBase">ZODB</acronym> allows you to avoid dodgy object-relational mappers and just store real Python objects. This sounds wonderful, but in practice it's nowhere near this simple and if you have any experience of concurrent programming you will know why. Relational databases these days provide <acronym title="Atomicity, Consistency, Isolation and Durability">ACID</acronym> for you quickly and effectively, and they can do this because the operations to perform are passed to the <acronym title="DataBase Management System">DBMS</acronym> for it to execute. When operations must be performed in application code and there can't be a way to transparently persist the objects without running into concurrency issues. I couldn't understand how the <acronym title="Zope Object DataBase">ZODB</acronym> was transparently solving these concurrency issues, so I read up a bit further on that subject, and as I understand it, it isn't. You get transactional locking, but the granularity is very coarse, so you need to do your own concurrency programming if you need performance. Happily it looks like there are some utility classes which implement some abstract datatypes in a concurrent way.</p>
<p>Zope provides 'products' which are object systems you can import into the <acronym title="Zope Object DataBase">ZODB</acronym> hierarchy and combine to produce applications. To achieve anything useful I believe you must write your own products, which might manipulate other products (your own, built-in ones, or third-party) within the <acronym title="Zope Object DataBase">ZODB</acronym> to achieve their task. For example, the folder object contains other objects and allows them to be accessed at a sub-<acronym title="Uniform Resource Locator">URL</acronym>.</p>
<p>Most of the examples involve <acronym title="Dynamic Template Markup Language">DTML</acronym> and <acronym title="Zope Page Templates">ZPT</acronym>, templating schemes which, although they could produce <acronym title="eXtensible Markup Language">XML</acronym> to plug into <acronym title="eXtensible Stylesheet Language">XSL</acronym> if I wanted, just don't really fit the way I work.</p>
<p>There's also a Python Script object which might be useful as glue but is sandboxed quite severely.</p>
<p>At this point I must explain my main reservation with Zope 2. It's that the strategy of constructing object hierarchies by creating and configuring object instances in the <acronym title="Zope Management Interface">ZMI</acronym> (Zope's web-based administration interface) means that your web application is only stored within the <acronym title="Zope Object DataBase">ZODB</acronym>. It depends on the contents of the database not only for data but code structure. Therefore none of your existing tools will work.</p>
<p>That means, for example, you can't use tools like Subversion to maintain a code repository or create a working copy. Perhaps it's possible to use it to maintain your Zope products, but not your entire web application. If you're already using Subversion, it's difficult for anyone to construct any kind of argument as to why you're better off not using it. <acronym title="Zope Object DataBase">ZODB</acronym>'s own versioning is not equivalent. In fact, almost anything you already have a tool to achieve, you must write a script to do in Python, or else do manually with the <acronym title="Zope Management Interface">ZMI</acronym>.</p>
<p>My other point of issue is that Zope's documentation describes in detail a principle called acquisition, which is really some magic with the Python object model to inherit functionality from other objects, a lot like subclassing, but not. The documentation has not, however, given me the slightest inkling as to what it's for.</p>
<p>I've just been reading a few bits and pieces about Zope 3 which suggest that it might be a more straightforward step, providing the bits of Zope that I do want as libraries without forcing me down a road of total Zopiness which would mean my abandoning of some of the tools that I have come to rely on.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mauveweb.co.uk/2006/11/21/zope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

