[Zope] Zope and Frontier Comparison

Kam Cheung zope@littlecircle.com
Tue, 13 Jul 1999 16:47:07 +0000


> 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