Thoughts about Plone and Zope
Autor: Leonardo Andrade | Publicado: 2013-04-22T18:45:00-03:00



Programar pela ZMI Web é um modo reconhecidamente ultrapassado. (Program in ZMI is a recognizably outdated&nbsp;way.)


Em&nbsp;Zope 2 Book, relata:

"One of the most notable differences between the original Zope2 approach and todays best-practices is in the way you develop applications with Zope2.&nbsp;The original Zope2 approach has focussed on a Through-The-Web (TTW) development model.&nbsp;You would create your entire application and manage your data through the same browser interface and store everything transparently in the same database. This model&nbsp;has worked very well in the beginning of “the web”&nbsp;as many dynamic websites have been rather simple and specialized projects.

Over the years websites have grown their requirements and often turned into development projects of a considerable size.&nbsp;Today websites are understood as applications&nbsp;in themselves and need an approach which&nbsp;is no longer compatible with the TTW approach of the early Zope2."



Conceito de aquisição do Zope 2 (Concept of Acquisition)


"One more prominent aspect of Zope is acquisition, whose core concepts are simply that:

Zope objects are contained inside other objects (such as Folders).
Objects can "acquire" attributes and behavior from their containers."



Diferença entre herança e aquisição:&nbsp;"Inheritance&nbsp;stipulates that an object can learn about its behavior from its superclasses via an&nbsp;inheritance hierarchy.&nbsp;Acquisition, on the other hand, stipulates that an object can additionally learn about its behavior through its&nbsp;containment hierarchy. In Zope, an object’s inheritance hierarchy is always searched for behavior before its acquisition hierarchy.&nbsp;If the method or attribute is not found in the object’s inheritance hierarchy, then the acquisition hierarchy is searched."

"Acquisition is not limited to searching a containment hierarchy: it can also search a context hierarchy. Acquisition by context is terribly difficult to explain, and you should avoid it if at all possible."

"Acquisition allows behavior to be distributed hierarchically throughout the system."

"Acquisition is a mechanism in Zope for sharing information among objects contained in a folder and its subfolders."







Separar camada de apresentação e de lógica (Keep presentation and logic separate)



"Zope encourages you to keep your presentation and logic separate&nbsp;by providing different objects that are intended to be used expressly for “presentation”. “Presentation” is defined as the task of dynamically defining layout of web pages and other user-visible data. Presentation objects typically render HTML (and sometimes XML)."&nbsp;(fonte)&nbsp;



Prefira ZPT à DTML (ZPT is better than DTML)



Motivo 1: DTML é velho.&nbsp;"an older version of a presentation facility included, which is called Document Template Markup Language or short DTML."

Motivo 2: DTML não faz boa separação entre camada de apresentação e camada responsável pela lógica:&nbsp;"There is a major problem with many languages designed for the purpose of creating dynamic HTML content: they don’t allow for “separation of presentation and logic” very well.&nbsp;For example, “tag-based” scripting languages, like&nbsp;DTML, SSI, PHP, and JSP, encourage programmers to embed special tags into HTML that are, at best, mysterious to graphics designers who “just want to make the page look good” and don’t know (or want to know!) a lot about creating an application around the HTML that they generate. Worse, these tags can sometimes cause the HTML on which the designer has been working to become “invalid” HTML, unrecognizable by any of his or her tools."








Contribuições do CMF ao Zope 2 original (Contribs of CMF inside Zope2)


"Zope ships with several content components: ZSQL Methods, Files, and Images. You can use Files for textual content since you can edit the contents of Files if the file is less than 64K and contains text.&nbsp;However, the File object is fairly basic and may not provide all of the features&nbsp;or metadata that you need.

Zope’s&nbsp;Content Management Framework&nbsp;(CMF)&nbsp;solves this problem by providing an assortment of rich content components. The CMF is Zope’s content management add on. It introduces all kinds of enhancements including workflow, skins and content objects. The CMF makes a lot of use of Page Templates."