La charla propone hacer un recorrido y revisión de componentes y conceptos empleados en Zope que puedan ser empleados de forma independiente en otras aplicaciones, incluso que no sean web.
1. Reusando componentes Zope fuera de Zope
(y la web)
Roberto Allende
Menttes / Plone Foundation
rallende@menttes.com
http://robertoallende.com
twitter: robertoallende
3. Buildout is a Python-based build system for
creating, assembling and deploying applications
from multiple parts, some of which may be non-
Python-based. It lets you create a buildout
configuration and reproduce the same software
later.
Buildout
4. Tool for working with eggs
Repeatable
Developer oriented
Buildout | Features
10. Don’t squeeze your objects into tables:
store them in an object database.
ZODB
11. Transparent persistence for Python objects
Full ACID-compatible transaction support
History/undo ability
Efficient support for binary large objects (BLOBs)
Pluggable storages
Scalable architecture
ZODB | Features
17. Zope Page Template allows you to generateZope Page Template allows you to generate
HTML dynamically.HTML dynamically.
Chameleon compiles templates to Python byte-code. It includes aChameleon compiles templates to Python byte-code. It includes a
complete implementation of the Zope Page Templates (ZPT) language andcomplete implementation of the Zope Page Templates (ZPT) language and
a partial implementation of the Genshi language.a partial implementation of the Genshi language.
ZPT vía Chameleon
18. ZPT templates are valid XML documentsZPT templates are valid XML documents
It uses namespaces for attributes and tags toIt uses namespaces for attributes and tags to
define the template behaviour.define the template behaviour.
Works on Python 2.4, 2.5 and 2.6, includingWorks on Python 2.4, 2.5 and 2.6, including
Google App EngineGoogle App Engine
PHP, Java, PerlPHP, Java, Perl
ZPT vía Chameleon
24. Dynamic adaptation might feel like a typeDynamic adaptation might feel like a type
declaration, but it's not!declaration, but it's not!
It specifies a behavior, not a type; it's dynamic;It specifies a behavior, not a type; it's dynamic;
it's optional.it's optional.
Adapters
26. Intrusivo clase baseIntrusivo clase base
Test aisladamenteTest aisladamente
Control factoryControl factory
Colision de nombresColision de nombres
Patches compitenPatches compiten
Lo hace RubyLo hace Ruby
Wrapping es molestoWrapping es molesto
Zope es Cool!Zope es Cool!
Adapters | Comparación con Otros
por Brandon Craig Rhodes
Herencia
oo
xx
xx
xx
Mixin
oo
oo
xx
xx
MonkeyPatch
oo
xx
xx
xx
Adapter
oo
oo
oo
oo
xx
oo
oo
oo
oo
oo
oo
Adapter
a'la Zope
29. import zope.interfaceimport zope.interface
class IFile(zope.interface.Interface):class IFile(zope.interface.Interface):
body = zope.interface.Attribute('Contents of the file.')body = zope.interface.Attribute('Contents of the file.')
class ISize(zope.interface.Interface):class ISize(zope.interface.Interface):
def getSize():def getSize():
'Return the size of an object.''Return the size of an object.'
Adapters | Define an interface
32. Using the Adapter RegistryUsing the Adapter Registry
http://docs.zope.org/zope3/Book/ifaceschema/human/show.htmlhttp://docs.zope.org/zope3/Book/ifaceschema/human/show.html
Using Grok to walk like a DuckUsing Grok to walk like a Duck
Brandon Rhodes - Pycon08, PloneConf 08Brandon Rhodes - Pycon08, PloneConf 08
Adapters | Mas Lectura