24
We make IT berlinbrandenburg PD 2 Plone Driven Plone Development Henning Rietz, Condat AG Plone Conference 2010 Bristol, 28.10.2010 IT from Berlin

Boosting productivity with "Plone-driven Plone development"

Embed Size (px)

DESCRIPTION

Slides of my talk at the Plone conference 2010 in Bristol, Okt 28th

Citation preview

Page 1: 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

Page 2: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 2

Speaker specifics

Henning Rietz, [email protected]

Condat AG Software for innovative business processes.

Founded 1979

Location Berlin

Staff ~65

Page 3: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 3

Alliterated Agenda

Major motivation

Definitive Dream

Attractive Advantages

Multiple models

All-round Application

Outrageous Outlook

Page 4: Boosting productivity with "Plone-driven Plone development"

© 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

Page 5: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 5

Definitive dream

The model is Plone content.

Page 6: Boosting productivity with "Plone-driven Plone development"

© 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.

Page 7: Boosting productivity with "Plone-driven Plone development"

© 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)

Page 8: Boosting productivity with "Plone-driven Plone development"

© 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

Page 9: Boosting productivity with "Plone-driven Plone development"

© 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

Page 10: Boosting productivity with "Plone-driven Plone development"

© 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

Page 11: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 11

Code structure

Page 12: Boosting productivity with "Plone-driven Plone development"

© 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

Page 13: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 13

UML example

Page 14: Boosting productivity with "Plone-driven Plone development"

© 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()'}, [ …

Page 15: Boosting productivity with "Plone-driven Plone development"

© 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

Page 16: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 16

Content

Page 17: Boosting productivity with "Plone-driven Plone development"

© 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

Page 18: Boosting productivity with "Plone-driven Plone development"

© 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)

Page 19: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 19

Views

Page 20: Boosting productivity with "Plone-driven Plone development"

© 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

Page 21: Boosting productivity with "Plone-driven Plone development"

© 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

Page 22: Boosting productivity with "Plone-driven Plone development"

© 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

Page 23: Boosting productivity with "Plone-driven Plone development"

© 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

Page 24: Boosting productivity with "Plone-driven Plone development"

© 2010 Condat AG 24

Thank you

Condat AGHenning RietzAlt-Moabit 91 d10559 BerlinTel. (030) [email protected]