<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Django -&gt; Plone: Portlets, Viewlets, Zcatalog, Aspects</title>
	<atom:link href="http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/feed/" rel="self" type="application/rss+xml" />
	<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/</link>
	<description>Python, Django, technology, Seattle, careers, life, et cetera...</description>
	<lastBuildDate>Sun, 05 Feb 2012 01:48:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Plone Conference 2008 reflections &#171; Seek Nuance</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-423</link>
		<dc:creator><![CDATA[Plone Conference 2008 reflections &#171; Seek Nuance]]></dc:creator>
		<pubDate>Thu, 16 Oct 2008 16:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-423</guid>
		<description><![CDATA[[...] a horses ass haven&#8217;t fully appreciated interfaces, and the Zope 3 Component Architecture. Previous comments tried to set me straight, and they partially succeeded, but the Bootcamp and conference really drove it home. I am now less [...]]]></description>
		<content:encoded><![CDATA[<p>[...] a horses ass haven&#8217;t fully appreciated interfaces, and the Zope 3 Component Architecture. Previous comments tried to set me straight, and they partially succeeded, but the Bootcamp and conference really drove it home. I am now less [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gustavo Noronha</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-390</link>
		<dc:creator><![CDATA[Gustavo Noronha]]></dc:creator>
		<pubDate>Mon, 06 Oct 2008 20:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-390</guid>
		<description><![CDATA[I&#039;ve been through Plone for twice now, and I agree with your view of the Plone/Zope world. Too much complication for too little gain. You end up never needing the full power the CA intends to achieve, and when you need it for use cases that were not foreseen by the Plone/Zope developers you end up in a dead-end.

Other Zope3 technologies were supposed to be improvements over the earlier ones, but I for one think Zope is plainly replacing one mistake (the inheritance issue that was cited above) with a bigger one - trying to view the whole world through interfaces/adapters.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve been through Plone for twice now, and I agree with your view of the Plone/Zope world. Too much complication for too little gain. You end up never needing the full power the CA intends to achieve, and when you need it for use cases that were not foreseen by the Plone/Zope developers you end up in a dead-end.</p>
<p>Other Zope3 technologies were supposed to be improvements over the earlier ones, but I for one think Zope is plainly replacing one mistake (the inheritance issue that was cited above) with a bigger one &#8211; trying to view the whole world through interfaces/adapters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-388</link>
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Sun, 05 Oct 2008 23:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-388</guid>
		<description><![CDATA[Thank you to all of you who commented so far! I&#039;m in awe of your willingness to take the time to correct and help me on this stuff. I hope someday I can do as well with helping someone else learn Plone and Zope.

I can see some of your points clearly, while others are still murky. Yes, I concede that I jumped the gun at assuming &lt;code&gt;Zope Interfaces == Java Interfaces&lt;/code&gt;. :-)  I haven&#039;t been thinking about developers vs. administrators. Is setting the bar that administrators should know Python so bad? It&#039;s easy to learn, although, sure, XML is easier...

I&#039;m going back to my books to continue learning!]]></description>
		<content:encoded><![CDATA[<p>Thank you to all of you who commented so far! I&#8217;m in awe of your willingness to take the time to correct and help me on this stuff. I hope someday I can do as well with helping someone else learn Plone and Zope.</p>
<p>I can see some of your points clearly, while others are still murky. Yes, I concede that I jumped the gun at assuming <code>Zope Interfaces == Java Interfaces</code>. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   I haven&#8217;t been thinking about developers vs. administrators. Is setting the bar that administrators should know Python so bad? It&#8217;s easy to learn, although, sure, XML is easier&#8230;</p>
<p>I&#8217;m going back to my books to continue learning!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raphael Ritz</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-380</link>
		<dc:creator><![CDATA[Raphael Ritz]]></dc:creator>
		<pubDate>Sun, 05 Oct 2008 17:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-380</guid>
		<description><![CDATA[first of all thanks for your posting: those reports help us to figure out where we need to do a better job of explaining our approach.

further to what Martin responded already: 

regarding the CA: the top-level answer is: divide and conquer.

If you are interested, here is a bit of background/history: one of the mistakes Zope (2) did (in retrospect) has been to overuse multiple inheritance to make objects that could be used in a variety of ways. It turned out that this approach found its limits when it came to extensibility and reuse by other applications (and more so  frameworks of course) and their extensions. So the next generation of Zope (3) adopted a completely different approach: the CA. It&#039;s all about pluggability, extensibility and customizability. But also about making the code base more managable by breaking it down into smaller, more managable pieces (even if it doesn&#039;t always look like that). 

From a more down-to-earth perspective: how do you want to deal with situations where add-ons (in Plone&#039;s parlance &#039;Products&#039;) want to change or expand the stuff that&#039;s there by default (e.g., adding fields to the schema of (a subset of) the default content types or adding further views - in the sense of further output formats - to objects defined in yet another add-on)?

Sure enough: as long as you are in control of the entire code base of your application all those problems seem to be non-existent. But as soon as you start considering integrating third-party code (or share your own) with people that don&#039;t program your perspective will change completetly.

Last but not least: with Plone we are trying to reach beyond the developer. This is why (web-based) configurabilty is so important to us. Again, if your use cases don&#039;t include situations where sites are managed by non-developers (aka people who neitehr know Python nor have file system access at the server) you might consider this complete overkill but we do believe it makes sense and it addresses real-world situations.

And finally regarding viewlets versus portlets: in addition to what Martin mentioned already: there is also a bit of history or more precisely learning experinence involved. First we had portlets (which were quite simply managed prior to Plone 3 but that has proven to be too naive in the long run) and later viewlets were introduced based on the experiences made from the portlets overhaul. That said, some people are thinking about how to integrate this in the long run.

To your catalog remark: 
http://plope.com/Books/2_7Edition/SearchingZCatalog.stx

Cheers,

   Raphael]]></description>
		<content:encoded><![CDATA[<p>first of all thanks for your posting: those reports help us to figure out where we need to do a better job of explaining our approach.</p>
<p>further to what Martin responded already: </p>
<p>regarding the CA: the top-level answer is: divide and conquer.</p>
<p>If you are interested, here is a bit of background/history: one of the mistakes Zope (2) did (in retrospect) has been to overuse multiple inheritance to make objects that could be used in a variety of ways. It turned out that this approach found its limits when it came to extensibility and reuse by other applications (and more so  frameworks of course) and their extensions. So the next generation of Zope (3) adopted a completely different approach: the CA. It&#8217;s all about pluggability, extensibility and customizability. But also about making the code base more managable by breaking it down into smaller, more managable pieces (even if it doesn&#8217;t always look like that). </p>
<p>From a more down-to-earth perspective: how do you want to deal with situations where add-ons (in Plone&#8217;s parlance &#8216;Products&#8217;) want to change or expand the stuff that&#8217;s there by default (e.g., adding fields to the schema of (a subset of) the default content types or adding further views &#8211; in the sense of further output formats &#8211; to objects defined in yet another add-on)?</p>
<p>Sure enough: as long as you are in control of the entire code base of your application all those problems seem to be non-existent. But as soon as you start considering integrating third-party code (or share your own) with people that don&#8217;t program your perspective will change completetly.</p>
<p>Last but not least: with Plone we are trying to reach beyond the developer. This is why (web-based) configurabilty is so important to us. Again, if your use cases don&#8217;t include situations where sites are managed by non-developers (aka people who neitehr know Python nor have file system access at the server) you might consider this complete overkill but we do believe it makes sense and it addresses real-world situations.</p>
<p>And finally regarding viewlets versus portlets: in addition to what Martin mentioned already: there is also a bit of history or more precisely learning experinence involved. First we had portlets (which were quite simply managed prior to Plone 3 but that has proven to be too naive in the long run) and later viewlets were introduced based on the experiences made from the portlets overhaul. That said, some people are thinking about how to integrate this in the long run.</p>
<p>To your catalog remark:<br />
<a href="http://plope.com/Books/2_7Edition/SearchingZCatalog.stx" rel="nofollow">http://plope.com/Books/2_7Edition/SearchingZCatalog.stx</a></p>
<p>Cheers,</p>
<p>   Raphael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Jung</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-379</link>
		<dc:creator><![CDATA[Andreas Jung]]></dc:creator>
		<pubDate>Sun, 05 Oct 2008 16:49:01 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-379</guid>
		<description><![CDATA[&quot;&quot;&quot;Zcatalog, Holy Crap&quot;&quot;&quot;

Your observed behavior is intentional and documented (see The Zope Book 2.7 edition). In addition: you can define custom attribute and method names to be in indexed. So the name of the index is definetly only lously coupled with the data to be indexed. This also implies that the search is not tied to the names of the indexes. In reality you usually have a layer sitting between the form and the ZCatalog performing modifications to the search request data.

-aj]]></description>
		<content:encoded><![CDATA[<p>&#8220;&#8221;"Zcatalog, Holy Crap&#8221;"&#8221;</p>
<p>Your observed behavior is intentional and documented (see The Zope Book 2.7 edition). In addition: you can define custom attribute and method names to be in indexed. So the name of the index is definetly only lously coupled with the data to be indexed. This also implies that the search is not tied to the names of the indexes. In reality you usually have a layer sitting between the form and the ZCatalog performing modifications to the search request data.</p>
<p>-aj</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Teague</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-372</link>
		<dc:creator><![CDATA[Kevin Teague]]></dc:creator>
		<pubDate>Sun, 05 Oct 2008 07:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-372</guid>
		<description><![CDATA[Interfaces rock! :)

At the point when you are using a package and &quot;want to do the necessary coding&quot; is one of the sweet spots of interfaces. An Interface is simply formalized documentation. Think of an interfaces.py file in a package as an &quot;API Reference&quot; for that package. The README.txt for a package will give you an overview of the purpose of the package, and some examples of how to get started, but when you need to look-up specific details such as method names,
signatures and a documentation on that method, then interfaces.py is the  place to look. Putting important interfaces in interfaces.py is nice because
you can look at the description of the API of an object you are looking at
without being distracted by the implementation details ... I know I tend to
sometimes wander beyond just looking up the details of a method call when
presented with a big juicy file full of code n&#039; documentation.

The interfaces.py file is the second place I look when exploring a Python
package new to me. First is README.txt to see what the package is about,
then a glance at interfaces.py to suss out the size and scope of the published
APIs of the package.

Interfaces are also now in the Python standard library as of the 2.6 release
(under the guise of Abstract Base Classes) - and no, Python is not becoming
statically typed!

Read Jeff Shell&#039;s article on the subject of Interfaces and ABCs, it&#039;s quite
informative:

http://griddlenoise.blogspot.com/2007/05/abc-may-be-easy-as-123-but-it-cant-beat.html]]></description>
		<content:encoded><![CDATA[<p>Interfaces rock! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>At the point when you are using a package and &#8220;want to do the necessary coding&#8221; is one of the sweet spots of interfaces. An Interface is simply formalized documentation. Think of an interfaces.py file in a package as an &#8220;API Reference&#8221; for that package. The README.txt for a package will give you an overview of the purpose of the package, and some examples of how to get started, but when you need to look-up specific details such as method names,<br />
signatures and a documentation on that method, then interfaces.py is the  place to look. Putting important interfaces in interfaces.py is nice because<br />
you can look at the description of the API of an object you are looking at<br />
without being distracted by the implementation details &#8230; I know I tend to<br />
sometimes wander beyond just looking up the details of a method call when<br />
presented with a big juicy file full of code n&#8217; documentation.</p>
<p>The interfaces.py file is the second place I look when exploring a Python<br />
package new to me. First is README.txt to see what the package is about,<br />
then a glance at interfaces.py to suss out the size and scope of the published<br />
APIs of the package.</p>
<p>Interfaces are also now in the Python standard library as of the 2.6 release<br />
(under the guise of Abstract Base Classes) &#8211; and no, Python is not becoming<br />
statically typed!</p>
<p>Read Jeff Shell&#8217;s article on the subject of Interfaces and ABCs, it&#8217;s quite<br />
informative:</p>
<p><a href="http://griddlenoise.blogspot.com/2007/05/abc-may-be-easy-as-123-but-it-cant-beat.html" rel="nofollow">http://griddlenoise.blogspot.com/2007/05/abc-may-be-easy-as-123-but-it-cant-beat.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiberiu Ichim</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-371</link>
		<dc:creator><![CDATA[Tiberiu Ichim]]></dc:creator>
		<pubDate>Sun, 05 Oct 2008 05:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-371</guid>
		<description><![CDATA[Let me see if I can shed some light for you:

Portlets are an artifact since the beginning of Plone. Typically, they&#039;re the boxes on the left and right side of the Plone site. The classic portlets were implemented as a macro (a bit of PT code) in a template, somewhere, and you pointed to those macros in a &quot;magic property&quot; called left_slots and right_slots. This property you could set on every object and through the acquisition and the skin machinery, the portlets appeared on the site, but you could override them and even define new ones, per location. Modern Plone portlets (and here I might be wrong - I haven&#039;t been heavily involved with Plone recently) have a complex implementation, partially based on the concept viewlets.

I think you got it wrong when you say you understood the difference between portlets and viewlets. Both will be inserted automatically, in the sense that a Plone portlet manager is a content provider, which means you need to insert it in the main template if you want its associated portlets to appear. Viewlet managers are content providers as well. The main difference, I would say, is that Plone portlets managers are &quot;plonified viewlet managers&quot;: they are persistent and you can define their behaviour through the web.

Now, viewlets are a completely different thing. A viewlet doesn&#039;t need to be a box on the left side or right side. A viewlet is a &quot;small view&quot;. A view, in z3 terminology, is something that you use to render a certain detail of an object. A view can be a page or just a small html fragment that you can insert into other views. Viewlets are rendered inside viewlet managers. A viewlet manager is a piece of code that &quot;gathers&quot; all the viewlets that can be rendered for a particular context (let&#039;s say object), sorts them and renders them in a particular way. In practice, viewlets can be anything: menus, boxes of content, a list of actions that you can do, etc. One of the advantages of using viewlets (and here is an application of the interfaces), is that you can render conditionally. When you register a viewlet you need to specify the type of the context (is it a Folder? An image? A homefolder? etc), the request (which means you can have different implementations of the same viewlet per skin), the View (typically, the page that is rendered into) and the manager in which will be rendered. All these types are typically specified by interfaces, not by classes. You could specify by classes, too.

Now, you say that you can implement this with Django as well. In your example, you say that the code that renders that viewlet, or HTML bit, needs to know about the context where it is inserted. Indeed, but then why should you add more code in the viewlet that decides if the viewlet should render or not? Using the viewlet/viewlet manager/content providers mechanism you can have the viewlet manager decide this for you, based on the registration of the viewlet. The thing is, it&#039;s hard to compare code from Django with code from Plone. I have almost 0 experience with Django, but my understanding is that the applications that you do with it are focused. You could probably insert the mechanism that would discriminate agains the context in the viewlet code and be done and happy with it. Plone wants to minimize the code needed and provide standardized ways of doing this very typical problem.

Zope 3 Interfaces have multiple purposes: API documentation, model definition (using zope.schema), can be used in form generation and validation and, using zope.component, they can be used to create a plugable infrastructure. A zope interface can&#039;t force you anything. Really. It&#039;s not static typying! As it&#039;s typical in Python, it&#039;s a gentlemen&#039;s agreement. If you say that your class implements an interface, it&#039;s up to you to actually implement that interface. Even more (and I think Django models are more restrictive in this aspect), you can define &quot;invariants&quot; or constraints for the attributes of the objects derived from that interface, but you need to call this validation functionality by hand. In general, you could say that you can define behaviour with them. Oh, one more thing, this might help you in understanding the lingo from the docs: classes are declared to implement interfaces, objects constructed from those classes are said to &quot;provide&quot; those interfaces.

ZCA (Zope Component Architecture) has several major types of components: adapters, utilities, subscribers and sites. A component is an object that provides an interface. Adapters have certain AOP connections to them: they allow you to see an aspect of an object. The typical basic example of an adapter is the ISize interface. When you have a folder listing with a mixed variety of objects inside, you want to have a standardized way of displaying the size of those objects, even if your framework doesn&#039;t know anything about the objects. For example, an image could list its pixel size, a file its byte size and an mp3 its duration. By using a standardized interface, ISize, you can have different implementations: for each object type you provide an adapter that implements the ISize interface for that object type. Zope 3 views (or pages) are named multiadapters: they adapt the request and the context to the IView interface (or IBrowserView, if you&#039;re dealing with an http application), to produce a view. This multiadapter is registered with a name, the name of the page.

Utilities are objects that are registered as &quot;singletons&quot; for a particular interface. They can also be registered with a particular name. This makes it possible to define pluggable and overridable implementations of site behaviour, for example, the language negociation of the site. Sites are objects that have a site manager associated to them (you would implement a portal or a website in its own site) and this site manager has a component registry associated to it, which means that you can create persistent utilities and register them for certain interfaces, at site level, overriding the utilities that are defined in sites above the hierarchy or utilities that are registered in code. Subscribers are a way to associate callables to interfaces. This makes it possible to implement, for example, events.

I can understand your frustration in learning Plone. It is unfortunate that, right now, learning Plone means having to learn multiple ways of doing the same thing, of which one is deprecated but you still need to know about it. Transitions are never easy. Hopefully in a couple of years this situation will be solved and the Plone learning curve can be significantly flattened.

Now, the zope catalog: it indexes objects attributes and allow you to search through them. By doing a search, you specify what index is used, the value you want to be searched in that index. The search will return you with a list of &quot;brains&quot;, which are small objects that contain information about the object that was found as the result of the search. This is an optimization. It does not return directly the object and instead returns the brain because this brain will contain the metadata that was extracted from the object, and &quot;waking up&quot; objects is an expensive operation in ZODB, while the catalog index will typically be cached by zope. Of course, you can get the real object by calling one method on the brain. In a Plone catalog you define indexes and metadata. The indexes are used for searching, while the metadata &quot;indexes&quot; are used to define the information that will be stored in the brain. When you define an index you specify the attribute (or method) from all content objects that you want to be indexed. When you save an object, the catalog will use all the indexes defined to extract information from that object, and all the metadata will be stored associated with that object.

Hope this is helpful! :-) One more piece of advice: the Plone community is usually a friendly one, and you can usually get imediate help for any question throught he #plone @ irc.freenode.net IRC channel. Just ask the question, and you&#039;ll probably get an answer.]]></description>
		<content:encoded><![CDATA[<p>Let me see if I can shed some light for you:</p>
<p>Portlets are an artifact since the beginning of Plone. Typically, they&#8217;re the boxes on the left and right side of the Plone site. The classic portlets were implemented as a macro (a bit of PT code) in a template, somewhere, and you pointed to those macros in a &#8220;magic property&#8221; called left_slots and right_slots. This property you could set on every object and through the acquisition and the skin machinery, the portlets appeared on the site, but you could override them and even define new ones, per location. Modern Plone portlets (and here I might be wrong &#8211; I haven&#8217;t been heavily involved with Plone recently) have a complex implementation, partially based on the concept viewlets.</p>
<p>I think you got it wrong when you say you understood the difference between portlets and viewlets. Both will be inserted automatically, in the sense that a Plone portlet manager is a content provider, which means you need to insert it in the main template if you want its associated portlets to appear. Viewlet managers are content providers as well. The main difference, I would say, is that Plone portlets managers are &#8220;plonified viewlet managers&#8221;: they are persistent and you can define their behaviour through the web.</p>
<p>Now, viewlets are a completely different thing. A viewlet doesn&#8217;t need to be a box on the left side or right side. A viewlet is a &#8220;small view&#8221;. A view, in z3 terminology, is something that you use to render a certain detail of an object. A view can be a page or just a small html fragment that you can insert into other views. Viewlets are rendered inside viewlet managers. A viewlet manager is a piece of code that &#8220;gathers&#8221; all the viewlets that can be rendered for a particular context (let&#8217;s say object), sorts them and renders them in a particular way. In practice, viewlets can be anything: menus, boxes of content, a list of actions that you can do, etc. One of the advantages of using viewlets (and here is an application of the interfaces), is that you can render conditionally. When you register a viewlet you need to specify the type of the context (is it a Folder? An image? A homefolder? etc), the request (which means you can have different implementations of the same viewlet per skin), the View (typically, the page that is rendered into) and the manager in which will be rendered. All these types are typically specified by interfaces, not by classes. You could specify by classes, too.</p>
<p>Now, you say that you can implement this with Django as well. In your example, you say that the code that renders that viewlet, or HTML bit, needs to know about the context where it is inserted. Indeed, but then why should you add more code in the viewlet that decides if the viewlet should render or not? Using the viewlet/viewlet manager/content providers mechanism you can have the viewlet manager decide this for you, based on the registration of the viewlet. The thing is, it&#8217;s hard to compare code from Django with code from Plone. I have almost 0 experience with Django, but my understanding is that the applications that you do with it are focused. You could probably insert the mechanism that would discriminate agains the context in the viewlet code and be done and happy with it. Plone wants to minimize the code needed and provide standardized ways of doing this very typical problem.</p>
<p>Zope 3 Interfaces have multiple purposes: API documentation, model definition (using zope.schema), can be used in form generation and validation and, using zope.component, they can be used to create a plugable infrastructure. A zope interface can&#8217;t force you anything. Really. It&#8217;s not static typying! As it&#8217;s typical in Python, it&#8217;s a gentlemen&#8217;s agreement. If you say that your class implements an interface, it&#8217;s up to you to actually implement that interface. Even more (and I think Django models are more restrictive in this aspect), you can define &#8220;invariants&#8221; or constraints for the attributes of the objects derived from that interface, but you need to call this validation functionality by hand. In general, you could say that you can define behaviour with them. Oh, one more thing, this might help you in understanding the lingo from the docs: classes are declared to implement interfaces, objects constructed from those classes are said to &#8220;provide&#8221; those interfaces.</p>
<p>ZCA (Zope Component Architecture) has several major types of components: adapters, utilities, subscribers and sites. A component is an object that provides an interface. Adapters have certain AOP connections to them: they allow you to see an aspect of an object. The typical basic example of an adapter is the ISize interface. When you have a folder listing with a mixed variety of objects inside, you want to have a standardized way of displaying the size of those objects, even if your framework doesn&#8217;t know anything about the objects. For example, an image could list its pixel size, a file its byte size and an mp3 its duration. By using a standardized interface, ISize, you can have different implementations: for each object type you provide an adapter that implements the ISize interface for that object type. Zope 3 views (or pages) are named multiadapters: they adapt the request and the context to the IView interface (or IBrowserView, if you&#8217;re dealing with an http application), to produce a view. This multiadapter is registered with a name, the name of the page.</p>
<p>Utilities are objects that are registered as &#8220;singletons&#8221; for a particular interface. They can also be registered with a particular name. This makes it possible to define pluggable and overridable implementations of site behaviour, for example, the language negociation of the site. Sites are objects that have a site manager associated to them (you would implement a portal or a website in its own site) and this site manager has a component registry associated to it, which means that you can create persistent utilities and register them for certain interfaces, at site level, overriding the utilities that are defined in sites above the hierarchy or utilities that are registered in code. Subscribers are a way to associate callables to interfaces. This makes it possible to implement, for example, events.</p>
<p>I can understand your frustration in learning Plone. It is unfortunate that, right now, learning Plone means having to learn multiple ways of doing the same thing, of which one is deprecated but you still need to know about it. Transitions are never easy. Hopefully in a couple of years this situation will be solved and the Plone learning curve can be significantly flattened.</p>
<p>Now, the zope catalog: it indexes objects attributes and allow you to search through them. By doing a search, you specify what index is used, the value you want to be searched in that index. The search will return you with a list of &#8220;brains&#8221;, which are small objects that contain information about the object that was found as the result of the search. This is an optimization. It does not return directly the object and instead returns the brain because this brain will contain the metadata that was extracted from the object, and &#8220;waking up&#8221; objects is an expensive operation in ZODB, while the catalog index will typically be cached by zope. Of course, you can get the real object by calling one method on the brain. In a Plone catalog you define indexes and metadata. The indexes are used for searching, while the metadata &#8220;indexes&#8221; are used to define the information that will be stored in the brain. When you define an index you specify the attribute (or method) from all content objects that you want to be indexed. When you save an object, the catalog will use all the indexes defined to extract information from that object, and all the metadata will be stored associated with that object.</p>
<p>Hope this is helpful! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  One more piece of advice: the Plone community is usually a friendly one, and you can usually get imediate help for any question throught he #plone @ irc.freenode.net IRC channel. Just ask the question, and you&#8217;ll probably get an answer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Aspeli</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-370</link>
		<dc:creator><![CDATA[Martin Aspeli]]></dc:creator>
		<pubDate>Sun, 05 Oct 2008 04:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-370</guid>
		<description><![CDATA[... and on the catalog: You search the catalog however you want (see chapter 9 of my book). The default search form has a way to pass request parameters directly to the catalog, but that&#039;s just a feature of the default search page, nothing more.

... and you&#039;re dead wrong about interfaces, but we&#039;ll leave that for another day. Suffice it to say that for the component architecture to do its magic, you need to be able to describe a component separately from its implementation. You don&#039;t *need* to use interfaces unless you&#039;re trying to make things that are extensible or overridable or you&#039;re trying to use the CA as a registry for something. Having a backlash against them just because Java has them is not very sensible, though.

... and similarly, you don&#039;t need to use the CA (what you call APO) in your own code. But when you decide that you want to customise the way the navtree renders itself for a particular type of folder only, and you don&#039;t want to copy and paste the five or six bits of code that constitute the navtree, I bet you that you&#039;ll be glad we made it possible for you to register an adapter for your interface that provides a new navtree strategy.

I appreciate that it&#039;s all a bit much to take in at once. Plone and Zope are very different in philosophy than Django, and solve different types of problems. However, the things that are there are often (but not always) there for a good reason. :)

Martin]]></description>
		<content:encoded><![CDATA[<p>&#8230; and on the catalog: You search the catalog however you want (see chapter 9 of my book). The default search form has a way to pass request parameters directly to the catalog, but that&#8217;s just a feature of the default search page, nothing more.</p>
<p>&#8230; and you&#8217;re dead wrong about interfaces, but we&#8217;ll leave that for another day. Suffice it to say that for the component architecture to do its magic, you need to be able to describe a component separately from its implementation. You don&#8217;t *need* to use interfaces unless you&#8217;re trying to make things that are extensible or overridable or you&#8217;re trying to use the CA as a registry for something. Having a backlash against them just because Java has them is not very sensible, though.</p>
<p>&#8230; and similarly, you don&#8217;t need to use the CA (what you call APO) in your own code. But when you decide that you want to customise the way the navtree renders itself for a particular type of folder only, and you don&#8217;t want to copy and paste the five or six bits of code that constitute the navtree, I bet you that you&#8217;ll be glad we made it possible for you to register an adapter for your interface that provides a new navtree strategy.</p>
<p>I appreciate that it&#8217;s all a bit much to take in at once. Plone and Zope are very different in philosophy than Django, and solve different types of problems. However, the things that are there are often (but not always) there for a good reason. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Martin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Aspeli</title>
		<link>http://seeknuance.com/2008/10/04/django-plone-portlets-viewlets-zcatalog-aspects/#comment-369</link>
		<dc:creator><![CDATA[Martin Aspeli]]></dc:creator>
		<pubDate>Sun, 05 Oct 2008 03:59:38 +0000</pubDate>
		<guid isPermaLink="false">http://seeknuance.wordpress.com/?p=655#comment-369</guid>
		<description><![CDATA[I don&#039;t think you understand the difference between viewlets and portlets. :-)

A viewlet is something a developer writes. We have a pluggable UI where people can define &quot;holes&quot; (viewlet managers) where a developer can &quot;plug in&quot; a viewlet. It&#039;s a configuration thing that requires a Zope restart to change (though you can hide and re-order things at runtime).

A portlet is something an administrator uses. You have a GUI to add/remove and configure a portlet, and rules about how they&#039;re blocked and how they interact. Crucially, there is a per-portlet persistent configuration, and you can have as many instances of a given portlet as you want.]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t think you understand the difference between viewlets and portlets. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>A viewlet is something a developer writes. We have a pluggable UI where people can define &#8220;holes&#8221; (viewlet managers) where a developer can &#8220;plug in&#8221; a viewlet. It&#8217;s a configuration thing that requires a Zope restart to change (though you can hide and re-order things at runtime).</p>
<p>A portlet is something an administrator uses. You have a GUI to add/remove and configure a portlet, and rules about how they&#8217;re blocked and how they interact. Crucially, there is a per-portlet persistent configuration, and you can have as many instances of a given portlet as you want.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

