Joomla! 2.0 Architecture
                                    J and Beyond
                                      May 6, 2011




                                   Herman Peeren
                                        www.yepr.eu
                                     herman@yepr.nl
Filip Dujardin: Crazy Building 6
Software Architecture
•	   structure of the whole
•	   under the hood
Extending what you have...
starting small:




building more

•	   more and more
•	   knitting...
•	   more
•	   and more
•	   and even more


                     James Wines: Highrise of Homes (1981)
and more...




Hundertwasser
Until the past becomes a burden




    Giovanni Francesco Barbieri Guercino: Atlas (1646)
Example: Joomla! 1.6 ACL
•	   earlier Access Control for editing: /administrator-folder
•	   earlier Access Control for viewing: restricting menu- and article ac-
     cess for groups
•	   newer ACL while keeping the old structures
After:
•	   1.5
•	   1.6
•	   1.7
•	   1.8
•	   1.9
•	   1.10
•	   ...
•	   1.98




 ...it might be time for a

Major release:                          .
 N.B.: no major version forseen in framework version numbers (11.1 etc.)
Not even the sky is the limit!




Andrea Pozzo: trompe l’oeil, fresco, St. Ignazio, Roma
some books:




both from 2003...
Conversion
    to

  OOP
  DDD
  ORM
  TDD
  COC
  WTF
   Caravagio: the Conversion of St. Paul (1601)
Back to the OOP-basics
 •	   Simula (1960s); e.g. simulation of waiting queues
 •	   no division between data and behaviour: objects!
 •	   smaller problems that can be handled




Nelleke Verhoeff: Ellenlange Schlange (2003)
Layers
•	   3 main layers:

     presentation,
     domain,
     data


•	   OOP: domain layer
     is central (DDD)




                         Mark Rothko
ORM
•	   Object - Relational Mapping
•	   Frameworks. Java: Hibernate. PHP: Doctrine (2)
•	   Doctrine a.o. used in Zend, Symfony etc.
•	   Can be used in Joomla! (JCM-article)
•	   http://www.doctrine-project.org
aside: LINQ... for PHP
•	   SQL for recordsets in .NET (Language Integrated Queries)
•	   PHP, open source: http://phplinq.codeplex.com/
•	   mainly targeting Recordsets (but could be generally useful for
     Table Data Gateways)
•	   Doctrine uses DQL (like SQL, but querying objects, not tables)
MVC?
     •	   How does our Holy Trinity MVC fit into this story?




Antonio de Pereda (1611-1678): Holy Trinity
MVC and layers
•	   invented 1978/1979
•	   originally in the presentation layer
•	   now: scattered over layers
•	   or: instead of layers




                                            Prof. Trygve M. H. Reenskaug (Oslo)
← MVC in presentation layer
MVC everywhere...
Naked Objects
•	   PhD thesis Richard Pawson
     2004 (Dublin, Ireland)

•	   http://downloads.nakedobjects.net
     /resources/Pawson%20thesis.pdf

•	   Foreword by Trygve Reenskaug

•	   back to
     ‘behaviourally-complete’ objects!




                                         Hans Memling: Vienna Triptych Enthroned Madonna (1485), closed
NakedPHP
•	   a framework to implement Naked Objects in PHP
•	   by Giorgio Sironi
•	   http://giorgiosironi.blogspot.com/2009/07/naked-objects-in-php.html
•	   http://sourceforge.net/projects/nakedphp/ (LGPL)




Adolf Ziegler: The Four Elements: Fire, Water and Earth, Air (before 1937)
Experiments from the lab
•	   System-U: all objects only a uniform interface as public methods
•	   System-R: recources as basic objects
•	   System-A: Access control as feature in basic objects
•	   agregate MVC: class com_mycontents extends com_contents




Piet Mondriaan (1872-1944): tree, more and more abstract
Joomla! 2.0 could have:
•	   DDD and ORM
•	   database independency
•	   better integrated ACL, no /administrator
     RESTful interface
                                                                      ...and be:
•	


•	   Extendable API




                                                                      UP
                                                                       -TO
                                                                         -D
                                                                            AT
                                                                               E!
 Vangobot: Skyscrapers Architecture Pop (http://popartmachine.com/)
“Creativity
                                  requires the courage
                                  to let go certainties”                 Erich Fromm




Sergey Tyukanof (http://www.tyukanov.com/): Alice in Wonderland (2005)
Who joins this dance?
•	   goal: to work towards a new major version




Henri Matisse: La Danse (1910)

Joomla2.0 architecture

  • 1.
    Joomla! 2.0 Architecture J and Beyond May 6, 2011 Herman Peeren www.yepr.eu herman@yepr.nl Filip Dujardin: Crazy Building 6
  • 2.
    Software Architecture • structure of the whole • under the hood
  • 3.
    Extending what youhave... starting small: building more • more and more • knitting... • more • and more • and even more James Wines: Highrise of Homes (1981)
  • 4.
  • 5.
    Until the pastbecomes a burden Giovanni Francesco Barbieri Guercino: Atlas (1646)
  • 6.
    Example: Joomla! 1.6ACL • earlier Access Control for editing: /administrator-folder • earlier Access Control for viewing: restricting menu- and article ac- cess for groups • newer ACL while keeping the old structures
  • 7.
    After: • 1.5 • 1.6 • 1.7 • 1.8 • 1.9 • 1.10 • ... • 1.98 ...it might be time for a Major release: . N.B.: no major version forseen in framework version numbers (11.1 etc.)
  • 8.
    Not even thesky is the limit! Andrea Pozzo: trompe l’oeil, fresco, St. Ignazio, Roma
  • 9.
  • 10.
    Conversion to OOP DDD ORM TDD COC WTF Caravagio: the Conversion of St. Paul (1601)
  • 11.
    Back to theOOP-basics • Simula (1960s); e.g. simulation of waiting queues • no division between data and behaviour: objects! • smaller problems that can be handled Nelleke Verhoeff: Ellenlange Schlange (2003)
  • 12.
    Layers • 3 main layers: presentation, domain, data • OOP: domain layer is central (DDD) Mark Rothko
  • 15.
    ORM • Object - Relational Mapping • Frameworks. Java: Hibernate. PHP: Doctrine (2) • Doctrine a.o. used in Zend, Symfony etc. • Can be used in Joomla! (JCM-article) • http://www.doctrine-project.org
  • 16.
    aside: LINQ... forPHP • SQL for recordsets in .NET (Language Integrated Queries) • PHP, open source: http://phplinq.codeplex.com/ • mainly targeting Recordsets (but could be generally useful for Table Data Gateways) • Doctrine uses DQL (like SQL, but querying objects, not tables)
  • 17.
    MVC? • How does our Holy Trinity MVC fit into this story? Antonio de Pereda (1611-1678): Holy Trinity
  • 18.
    MVC and layers • invented 1978/1979 • originally in the presentation layer • now: scattered over layers • or: instead of layers Prof. Trygve M. H. Reenskaug (Oslo)
  • 19.
    ← MVC inpresentation layer
  • 20.
  • 21.
    Naked Objects • PhD thesis Richard Pawson 2004 (Dublin, Ireland) • http://downloads.nakedobjects.net /resources/Pawson%20thesis.pdf • Foreword by Trygve Reenskaug • back to ‘behaviourally-complete’ objects! Hans Memling: Vienna Triptych Enthroned Madonna (1485), closed
  • 22.
    NakedPHP • a framework to implement Naked Objects in PHP • by Giorgio Sironi • http://giorgiosironi.blogspot.com/2009/07/naked-objects-in-php.html • http://sourceforge.net/projects/nakedphp/ (LGPL) Adolf Ziegler: The Four Elements: Fire, Water and Earth, Air (before 1937)
  • 23.
    Experiments from thelab • System-U: all objects only a uniform interface as public methods • System-R: recources as basic objects • System-A: Access control as feature in basic objects • agregate MVC: class com_mycontents extends com_contents Piet Mondriaan (1872-1944): tree, more and more abstract
  • 24.
    Joomla! 2.0 couldhave: • DDD and ORM • database independency • better integrated ACL, no /administrator RESTful interface ...and be: • • Extendable API UP -TO -D AT E! Vangobot: Skyscrapers Architecture Pop (http://popartmachine.com/)
  • 25.
    “Creativity requires the courage to let go certainties” Erich Fromm Sergey Tyukanof (http://www.tyukanov.com/): Alice in Wonderland (2005)
  • 26.
    Who joins thisdance? • goal: to work towards a new major version Henri Matisse: La Danse (1910)