Zope and Frontier Comparison
Zope uses acquisition, which is a pretty powerful concept, but not exactly template oriented (it can use any object, including Document Templates). Perhaps you can give us an overview of how Frontier does this?
Actually, the way how a Zope object acquires properties (or atrributes) is very similar to Frontier. The part that I feel Frontier is more advanced is, I don't need to put in the <!--#var abcHeader--> and <!--#var abcFooter--> in Frontier. It's much easier to illustrate it by an example. Let's say we have a site like this: SITE_ABC template pageHeader pageFooter index_html another_html FOLDER_A template pageHeader pageFooter index_html FOLDER_B index_html (NOTE: the actual object name that you need to use in Frontier maybe different. In Frontier, template, pageHeader and pageFooter are attributes, and you must put a "#" before its name.) In Zope, inside the html objects, I will need to put in: <!--#var pageHeader--> Bodytext goes here!!! <!--#var pageFooter--> Also, the pageHeaders and the pageFooters in FOLDER_A and FOLDER_B will be different, since FOLDER_B will acquire SITE_ABC.pageHeader and SITE_ABC.pageFooter, while FOLDER_A has its own pageHeader and pageFooter. However, the object "template" here is useless. You can even say that the html object PLUS the header, footer, and other object that you put into the html object BECOME a template by itself. You can of course, built a index_html object that will read data from object on other part of the site. But it's up to your own to do that, Zope doesn't do this. In Frontier, it's another story. When you view a Frontier object, Frontier will assume that you will acquire the most immediate pageHeader, pageFooter and template. So, in a Fronter object, all I need to do is put in: Bodytext goes here!!! I don't need to refer to any pageHeader or pageFooter in the html object. Instead, I will put all of these into the "template" object. A Frontier template usually compose of: {pageHeader ()} {bodytext} {pageFooter ()} Let's look at it from another perspective. When a user request a html object in Frontier. Frontier walks into the directory tree, grab whatever attributes that you have specified, override any previously declared attributes as it walked towards the html object. When it hits the html object, it will start the rendering. Right up to this point, Zope and Frontier is still very similar. Then the difference start to appear. In Zope, you must put in a reference to the attribute by yourself, since your html object is essentially a template. In Frontier, the Frontier framework will do one more step. It grabs the template object. So, instead of rendering against the html object, it will render against the template object, and use the html object as a "Content Object". You can override the folder's template/pageHeader/pageFooter attributes in the html object if you want, but if you don't Frontier will always force default attributes to your objects. Is it clear? Or, is it still very confusing? I have to admit that I am not a good writer, not to say an English writer. I think Philip Suh can do a lot better than I do. Kam On Cheung
You've misunderstood how Zope acquisition works, I'll try to explain as I go through your posting. Kam Cheung wrote:
Zope uses acquisition, which is a pretty powerful concept, but not exactly template oriented (it can use any object, including Document Templates). Perhaps you can give us an overview of how Frontier does this?
Actually, the way how a Zope object acquires properties (or atrributes) is very similar to Frontier. The part that I feel Frontier is more advanced is, I don't need to put in the <!--#var abcHeader--> and <!--#var abcFooter--> in Frontier. It's much easier to illustrate it by an example. Let's say we have a site like this:
<stuff deleted>
In Zope, inside the html objects, I will need to put in:
<!--#var pageHeader-->
Bodytext goes here!!!
<!--#var pageFooter-->
Also, the pageHeaders and the pageFooters in FOLDER_A and FOLDER_B will be different, since FOLDER_B will acquire SITE_ABC.pageHeader and SITE_ABC.pageFooter, while FOLDER_A has its own pageHeader and pageFooter.
However, the object "template" here is useless. You can even say that the html object PLUS the header, footer, and other object that you put into the html object BECOME a template by itself. You can of course, built a index_html object that will read data from object on other part of the site. But it's up to your own to do that, Zope doesn't do this.
Ok here goes for the stuff you've overlooked: If you know that you want the header and footer inserted into every document and combined with bodytext, then all you have to do is define index_html in the site root like this: <!--#var pageHeader--> <!--#var Bodytext--> <!--#var pageFooter--> and just insert a Bodytext method or document into the various folders, with overriding pageHeaders and pageFooters where appropriate. You only need to place index_html into a folder when your template changes. After this point you start to explain how frontier does this too, and how it's a pity that Zope doesn't do this, so I'll just skip that. The point is, DTML documents and methods can be used to both hold content and act as templates, it's up to you to decide how you want to factor your sites functionality, layout, and content into the Zope object heirarchy. HTH, Michael Bernstein.
participants (2)
-
Kam Cheung -
Michael Bernstein