Boosting productivity with "Plone-driven Plone development"
-
Upload
henning-rietz -
Category
Technology
-
view
664 -
download
2
description
Transcript of Boosting productivity with "Plone-driven Plone development"
We make ITberlinbrandenburg
PD2
Plone Driven Plone Development
Henning Rietz, Condat AG
Plone Conference 2010
Bristol, 28.10.2010
IT from Berlin
© 2010 Condat AG 2
Speaker specifics
Henning Rietz, [email protected]
Condat AG Software for innovative business processes.
Founded 1979
Location Berlin
Staff ~65
© 2010 Condat AG 3
Alliterated Agenda
Major motivation
Definitive Dream
Attractive Advantages
Multiple models
All-round Application
Outrageous Outlook
© 2010 Condat AG 4
Major motivation
Likes Model-driven development Application of design
patterns ArchGenXML
Likes Model-driven development Application of design
patterns ArchGenXML
Dislikes Writing boilerplate code Editing *.zcml, *.xml Migration migraine (Plone
234 …) Learning curve for new
developers
Dislikes Writing boilerplate code Editing *.zcml, *.xml Migration migraine (Plone
234 …) Learning curve for new
developers
© 2010 Condat AG 5
Definitive dream
The model is Plone content.
© 2010 Condat AG 6
Dream details
Metamodel == Domain-specific language== Plone Content Types
Model== Metadata== Description of a specific system== Plone content
Code== Implementation of a specific system== Views on Plone content (metadata)
Metamodel == Domain-specific language== Plone Content Types
Model== Metadata== Description of a specific system== Plone content
Code== Implementation of a specific system== Views on Plone content (metadata)
ArchGenXML: • Metamodel == UML Metamodel• Model == UML (XMI file)• Code == generated from XMI
PloneFormGen:• Metamodel == PFG Content Types• Model == FormFolder + Subobjects• No code generated, interpretation of model at runtime
Collections
ArchGenXML: • Metamodel == UML Metamodel• Model == UML (XMI file)• Code == generated from XMI
PloneFormGen:• Metamodel == PFG Content Types• Model == FormFolder + Subobjects• No code generated, interpretation of model at runtime
Collections
Exis
tin
g E
xam
ple
sExis
tin
g E
xam
ple
s
It‘s an appro
ach
– not a pro
duct.
© 2010 Condat AG 7
Attractive Advantages
Reduces manual coding effort Generates .py, .pt, .cpt, .cpy, .xml, .sql, .zcml, …
High configurability (for you and the customer) Model can be accessed at runtime Behavior of generic parts is dynamically changed
Increases productivity Homogenous environment, everything is Plone-ish Makes your design patterns explicit, enforces conventions Better learning curve for new developers
Higher maintainability Single source for changes Helps you deal with major changes in Plone architecture Integrated documentation
(orange: specific strengths of PD2, otherwise: typical advantage of MDD)
© 2010 Condat AG 8
Conflicting Challenges
Keep implementation details out of the models
Make it simple
Customer readable
Generate as much as possible (and useful)
Make it powerful
Executable
© 2010 Condat AG 9
Domain description
Finding your metamodel –How would you describe your future systems?What abstractions/patterns do you employ?
Possible input
Legacy systems (to be migrated)
The future design
Storyboards
UML models
Your own patterns/frameworks
User/technical documentation
© 2010 Condat AG 10
Multiple metamodels
Content
Views
Navigation
Layout
Authoring Build
Deployment
Code Structure
Ab
str
act
ion
Looking at the system from different perspectives
© 2010 Condat AG 11
Code structure
© 2010 Condat AG 12
Concepts / structures for code generation
File, Directory, FileSeries, FileGroup, etc.
PT/DTML Templates for code generation, using domain model objects as contexts
Code generation traverses the structure, applying model elements to templates, writing the resulting code to the local file system of the Zope (ZEO client) instance
Code structure modelling
© 2010 Condat AG 13
UML example
© 2010 Condat AG 14
Example structure('plone3layout', 'Plone 3 Standard Layout', 'PD2Layout', {'namingExpression':'context.Title()'}, [ ('readme.txt','README.txt','PD2File',{'viewname':'empty','namingExpression':'self.Title()'},[]), ('setup.cfg','setup.cfg','PD2File',{'viewname':'empty','namingExpression':'self.Title()'},[]), ('setup.py','setup.py','PD2File',{'viewname':setup','namingExpression':'self.Title()'},[]), ('modulepart1','<modulepart1>','PD2Directory',{'viewname':'','namingExpression':'context.Title().split(\'.\')[0]'}, [ ('init.py','__init__.py','PD2File',{'viewname':'initpkg','namingExpression':'self.Title()'},[]), ('modulepart2','<modulepart2>','PD2Directory',{'viewname':'','namingExpression':'context.Title().split(\'.\')[1]'}, [ ('init.py','__init__.py','PD2File',{'viewname':'init','namingExpression':'self.Title()'},[]), ('configure.zcml','configure.zcml','PD2File',{'viewname':'configure','namingExpression':'self.Title()'},[]), ('config.py','config.py','PD2File',{'viewname':'empty','namingExpression':'self.Title()'},[]), ('interfaces.py','interfaces.py','PD2File',{'viewname':'interfaces','namingExpression':'self.Title()'},[]), ('readme.txt','README.txt','PD2File',{'viewname':'empty','namingExpression':'self.Title()'},[]), ('version.txt','version.txt','PD2File',{'viewname':'empty','namingExpression':'self.Title()'},[]), ('browser','browser','PD2Directory',{'viewname':'','namingExpression':'self.Title()'},[]), ('content','content','PD2Directory',{'viewname':'','namingExpression':'self.Title()'}, [ ('init.py','__init__.py','PD2File',{'viewname':'empty','namingExpression':'self.Title()'},[]), ('type.py','<type>.py','PD2FileSeries',{'viewname':'atclass','namingExpression':'\'%s.py\' % context.Title().lower()','listExpression':'context.getContentTypes()'},[]), ('configure.zcml','configure.zcml','PD2File',{'viewname':'cconfigure','namingExpression':'self.Title()'},[]), ]), ('profiles','profiles','PD2Directory',{'viewname':'','namingExpression':'self.Title()'}, [ ('default','default','PD2Directory',{'viewname':'','namingExpression':'self.Title()'}, [ …
© 2010 Condat AG 15
Example: gstype view<tal:block i18n:domain="conpd2.codegen" tal:define="ct context/Title"><object tal:replace='structure string:<?xml version="1.0"?>'/><object name="PD2Adapter" tal:attributes="name ct" meta_type="Factory-based Type Information with dynamic views" xmlns:i18n="http://xml.zope.org/namespaces/i18n"> <property name="title" tal:content="ct">PD2Adapter</property> <property name="description"></property> <property name="content_meta_type" tal:content="ct">PD2Adapter</property> <property name="product" tal:content="context/getProductName">ConPD2</property> <property name="factory" tal:content="string:add${ct}">addPD2Adapter</property> <property name="immediate_view">base_view</property> <property name="global_allow">True</property> <property name="filter_content_types">False</property> <property name="allowed_content_types"> </property> <property name="allow_discussion">False</property> <property name="default_view">base_view</property> <property name="view_methods"> <element value="base_view"/>…
Full example
© 2010 Condat AG 16
Content
© 2010 Condat AG 17
Content modelling
Describes most of the information architecture
Metamodel: Types, Attributes, Relationships
Probably even more domain-specific
Code: AT schemata, classes, GS xml, zcml
Also possible: RDBMS-related content
© 2010 Condat AG 18
UML example
(this is taken from the metamodel of the first version of ConPD2, which is basically a metamodel for AT development)
© 2010 Condat AG 19
Views
© 2010 Condat AG 20
Views modelling
What is presented where/how?
Metamodel: View Types (e.g. single object, object list, dashboard) with presentation details (e.g. sorting, batching)
Code: template fragments, macros, view classes, helper methods
© 2010 Condat AG 21
More metamodels
Navigation: primary, secondary, depth, … navigation portlet, sections viewlet
Layout: two/three columns, header, footer, … Viewlets, CSS (cf. Subskins product)
Authoring: roles, workflows, staging, content rules
Build & Deployment: devbuildout|production|test.cfg, deployment scripts, monitoring frontend
© 2010 Condat AG 22
All-round Application
Implement Metamodel E.g. with ArgoUML, ArchGenXML
Templates for code generation
Deploy PD2 Model lives in ZEO server
Developers work with local ZEO Client, which writes to local file system
Develop with PD2 Describe customer site in terms of the
metamodel
Push the button
Make customer specific extensions
Implement generic parts (which interpret metadata at runtime)
Iterate
© 2010 Condat AG 23
Outrageous Outlook
Metamodels for knowledge management, public internet, collaborative applications, …
Plone Technology Metamodel
Generic Applications for multiple clients in SaaS scenarios
© 2010 Condat AG 24
Thank you
Condat AGHenning RietzAlt-Moabit 91 d10559 BerlinTel. (030) [email protected]