SlideShare uma empresa Scribd logo
1 de 64
Baixar para ler offline
Gimme Five!architecture of TYPO3 5.0
The current
The road to TYPO3 5.0 „Phoenix“
TYPO3 Developer Days 25.-29.04.2007, Dietikon / Switzerland




                                                      Inspiring people to
                                                      share
The current architecture?
  we don‘t build buildings – design decisions
  can be changed most of the time

  refactoring is already an important part
  of our daily development

  with architecture we are referring to
  the design decisions we have taken so far
  for the core of TYPO3 5.0




                                             Inspiring people to
                                             share
The current architecture
„ Software is not limited by physics,
 like buildings are.
 It is limited by imagination, by design,
 by organization.
 In short, it is limited by properties of people,
 not by properties of the world. ”
                                   Martin Fowler




                                                    Inspiring people to
                                                    share
Tower of Babel
Ubiquitous language
  The common vocabulary is an important prerequisite
  for successful collaboration

  Use the same words for discussion, modeling, development
  and documentation

  Any vocabulary you know from TYPO3 4.x ?




                                         Inspiring people to
                                        share
Ubiquitous language in TYPO3 4.x
                                         Frontend
       Page          Extension                            Content
                                          Plugin
                                                          Element

     Page       System
      Tree      Folder                        Backend
                                 TypoScript    Module           dard
Template                           Object                   Stan p
                                                               Wra
 Record       TER
                                               File
                              rks pace        Mount
                         Wo
              beer

                                                Inspiring people to
                                                share
Ubiquitous language in TYPO3 5.0
          Page                Package            Plugin             Content
                                                                    Element

       Page             System
        Tree                                         Component
                        Folder
                                        TypoScript                        dard
                                          Object                      Stan p
  Template                                                               Wra
Configura                TPR
         tion

                                  orks pace           Resource
                 espres
                       so        W

                                                          Inspiring people to
                                                          share
Domain-Driven Design
  The domain of our software is content management

  We create a model of our domain which is described
  by the vocabulary of our ubiquitous language

  The PHP code is tightly related to our model which
  gives it meaning and makes the model relevant




                                          Inspiring people to
                                          share
Domain-Driven Design
  „Set the Modification Date of each Content Element of the
  Page with the Unique Identifier 1 to the current time“

  $page = $pageRepository->findByUid(1);
  foreach ($page->getContentElements() as $contentElement) {
    $contentElement->setModificationDate(time());
  }




                                             Inspiring people to
                                             share
Layered Architecture
                                                 This  is the point of
     important!                               our soft   ware, the hom
                                                                       e
               This is the real point of our software f the model
                                                    o


                           Domain




                                                 Inspiring people to
                                                 share
Layered Architecture



              Domain

            Data source



                          Inspiring people to
                          share
Layered Architecture

            Presentation

              Domain

            Data source



                           Inspiring people to
                           share
Layered Architecture

            Presentation

              Domain

            Data source



                           Inspiring people to
                           share
Layered Architecture

               View
Presentation   Controller
               Application Logic (Service Layer)
  Domain       Domain Model (Domain Layer)
               Data Mapper
 Data source   Data Source Abstraction




                                            Inspiring people to
                                            share
Caching          Debugging



Infrastructure
        Profiling              Messaging
                                               Transaction
                                               Management


                                       Package             Resource
        Logging       Versioning
                                     Management           Management


                                                  Object
  Object      Data Source        MVC                                   Error
                                                Relational
Management    Abstraction     Framework                              Handling
                                                 Mapping



                                   PHP


                                                     Inspiring people to
                                                 share
Infrastructure frameworks
  For the infrastructure of TYPO3 we need a lot of features, which
  are probably covered by existing frameworks we can use:

    Object Mgm. / Dependecy Injection: Seasar, Pico Container

    Model, View, Controller: Agavi

    Aspect Oriented Programming: Seasar, GAP, aspectPHP, ...

    Database / -model Abstraction: Propel, Creole

    ... and many more


                                           Inspiring people to
                                           share
Why re-invent the wheel?




                 Inspiring people to
                 share
Re-invent the wheel because ...
  some of the frameworks follow a weird, unclean or inconsistent
  approach

  some of the frameworks are not mature enough or badly
  documented / coded.

  some of the frameworks don‘t offer all the features we want

  some projects don‘t have a stable community and support

  we want a whole, component-based, feature-rich framework
  offering a consistent interface to the developer which
  increases quality, speed and ease of development
                                          Inspiring people to
                                          share
Innovated, not re-invented
  Not just a re-invention, we ...

    ... looked at the best wheels which exist today
    (other programming languages have nice wheels, too)

    ... studied the history of wheels and what experience others
    made while using them

    ... added our own creativity and expertise

  Recipe: Take the best wheels, attach them to a lean, yet
  powerful vessel (framework) and add the TYPO3 flavour


                                           Inspiring people to
                                           share
Inspiring people to
share
C MS          ew ork
       Fram
 5.0          1.0




         Inspiring people to
         share
Focussing on our domain
  Framework and CMS: exist as independent packages

  Enforces clean separation of infrastructure and business logic

  The Framework can be used without the TYPO3 CMS and serve as
  a foundation for any enterprise PHP application

  Packages contain additional functionality for CMS- and other
  applications

  The TYPO3 Package Repository can be used independently from
  the TYPO3 CMS


                                           Inspiring people to
                                           share
TYPO3 Framework
TYPO3 Framework
  Components

  Packages

  Aspect Oriented Programming

  Model, View, Controller

  Resources

  Reflection

  Utility

                                Inspiring people to
                                share
TYPO3 Framework




                  Inspiring people to
                  share
TYPO3 Framework




                  Inspiring people to
                  share
Components
  Components are re-usable, properly encapsulated objects which
  are managed by the Component Manager

  (Almost) all classes in the TYPO3 context are components

  Components are configurable

  They allow for Dependency Injection




                                          Inspiring people to
                                          share
Components: Configuration
  The Component Manager controls the life cycle of a component

  The scope of a component is just a matter of configuration:

    prototype, singleton or session

  A component is referred to by its name, the implementation
  class is configurable:

    comparable to the XCLASS mechanism in TYPO3 4.x

    implementations sharing the same interface act as true drop-
    in replacements

                                          Inspiring people to
                                          share
Components: Configuration
     Packages/MyPackage/Classes/T3P_MyPackage_MyComponent.php


     class T3P_MyPackage_MyComponent {

         protected $counter = 0;

         public function increaseAndGetCounter() {
           return $this->counter ++;
         }
     }




                                                            Inspiring people to
                                                            share
Components: Configuration
     Packages/MyPackage/Classes/T3P_MyPackage_MyComponent.php
       Packages/MyPackage/Classes/Components.conf

     class T3P_MyPackage_MyComponent {
       [T3P_MyPackage_MyComponent]
       scope = prototype = 0;
         protected $counter

         public function increaseAndGetCounter() {
           return $this->counter ++;
         }
     }




                                                            Inspiring people to
                                                            share
Components:
Dependency Injection
  Inverse of Control or Hollywood Principle:
  „Don‘t call us, we call you“

  Your component needs access to a Logger

    Usual case:
    Your code asks the framework to deliver a logger instance

    With Dependency Injection:
    Your code just gets an instance of the logger injected




                                           Inspiring people to
                                           share
Components:
Dependency Injection
 class tx_myextension_pi1 {

     protected $logger;

     public function __construct() {
         $this->logger = t3lib_div::makeInstance(’tx_log_logger‘);
      }

     public function main() {
        $this->logger->log(’Hello log file‘);
     }
 }




                                                       Inspiring people to
                                                       share
Components:
Dependency Injection
 class tx_myextension_pi1 {

     protected $logger;

     public function __construct() {
         $this->logger = tx_log_logger::getInstance(); # Custom Singleton
                                                         implementation
      }

     public function main() {
        $this->logger->log(’Hello log file‘);
     }
 }



                                                       Inspiring people to
                                                      share
Components:
Dependency Injection
 class T3P_MyPackage_MyComponent {

     protected $logger;

     public function __construct(T3P_Log_LoggerInterface $logger) {
         $this->logger = $logger;
      }

     public function main() {
        $this->logger->log(’Hello log‘);
     }
 }




                                                      Inspiring people to
                                                      share
Components:
Dependency Injection
  Different ways of injection:

    Constructor injection

    Setter injection

  Dependencies are resolved automatically

  Classes are loaded automatically

  ... of course: configurable



                                            Inspiring people to
                                            share
Packages
  Extensions are now called Packages

  A package is any combination of meta data, code,
  documentation, media and other resources

  Packages can be up- and downloaded from the Package
  Repository

  Documentation is stored as DocBook

  The exchange format for packages is a plain ZIP file



                                          Inspiring people to
                                          share
Packages: Package Manager
  Manages packages - replacement for the Extension Manager

  Accessible through command line and SOAP

  The package manager can even upgrade the Framework
  package, ie. it can upgrade itself




                                        Inspiring people to
                                       share
Aspect Oriented Programming
  AOP is a programming paradigm

  complements OOP by separating concerns to improve
  modularization

  OOP modularizes concerns: methods, classes, packages

  AOP addresses cross-cutting concerns




                                         Inspiring people to
                                         share
AOP: Cross-cutting concerns

            Presentation

              Domain

            Data source



                           Inspiring people to
                           share
AOP: Cross-cutting concerns

            Presentation    The concerns
                              live here

              Domain

            Data source



                           Inspiring people to
                           share
AOP: Cross-cutting concerns



Guestbook   Forum   Domain
                      News   Content         Parties




                              Inspiring people to
                             share
AOP: Cross-cutting concerns



Guestbook   Forum    News      Content         Parties

                    Security
                    Logging




                                Inspiring people to
                               share
AOP: Cross-cutting concerns



Guestbook
  Security   Forum   News   Content         Parties
   Logging




                             Inspiring people to
                            share
AOP: Cross-cutting concerns



Guestbook
  Security   Forum   News   Content         Parties
   Logging




                             Inspiring people to
                            share
AOP: Method interception
                                                      Hypothetical
                                                     code example

class T3P_User_AccountManagement {
   public function deleteAccount($accountId) {
     $this->accountRepository->delete($accountId);
   }
}




                                             Inspiring people to
                                             share
AOP: Method interception

class T3P_Security_RightsManager {
   public function hasEnoughRights($situation) {
     $account = $this->accountManager->getCurrentAccount();
     return $account->hasEnoughRightsForSituation($situation);
   }
}




                                             Inspiring people to
                                             share
AOP: Method interception
class T3P_User_AccountManagement {
   public function deleteAccount($accountId) {
     $account = $this->accountManager->getCurrentAccount();
     if ($account->hasEnoughRightsForSituation($situation)) {
        $this->accountRepository->delete($accountId);
     } else {
        throw new NotEnoughtRightsException(’Access denied’);
     }
   }
}



                                             Inspiring people to
                                             share
AOP: Implementation details
  TYPO3 makes use of dynamic proxies for weaving

  Our AOP Framework does not require any pre-processing or a
  special PHP extension to run

  Standards are used where they made sense, other parts are
  simplified or adapted to the PHP capabilities

  only low performance loss because weaving is a one-time
  operation which can be cached




                                         Inspiring people to
                                         share
AOP
  Where it makes sense:

    Cross-cutting concerns

    Extending legacy code


  Caveats:

    Scattered code, multiple extensions

    check out clean OOP alternatives


                                          Inspiring people to
                                          share
Model, View, Controller
  MVC Framework is work in progress

  Some design decisions taken:

    Request Handler with filter chain

    Dispatcher with interceptor chain

    One controller per plugin, multiple actions per controller

  Code is on the way ...



                                           Inspiring people to
                                           share
Inspiring people to
share
Resources
  Resource Manager for centralizing resource access

  Media, documents, generic files and other resources are
  available as resource objects

  File resources from the packages are detected and managed
  automatically

  Allows for fine-grained rights management and performance
  optimization

  Status: Pending


                                          Inspiring people to
                                          share
Reflection
  Extended reflection capabilities

  Allow for accessing tags in doc comments directly

  Will feature some caching mechanism in the future

  Maybe an annotation manager will be added




                                          Inspiring people to
                                          share
Utility
   Home of t3lib_div-like tools

   Some functions have already been ported




                                         Inspiring people to
                                         share
TYPO3 CMS
  Currently working on the model / node types

  TypoScript 2.0

  Content Repository




                                         Inspiring people to
                                         share
Some project ideas
  Implement the TYPO3 Package Repository as 5.0 package

  Create a 5.0 implementation of the Party Information
  Framework

  Integrate 5.0 as a 4.x frontend plugin

  Create a bootstrap-like, everything-works-auto-installer




                                           Inspiring people to
                                           share
Recommended literature

             Gamma et al.:
             Design Patterns
             Elements of Reusable Object-
             Oriented Software

             Addison Wesley 1995




                                Inspiring people to
                               share
Recommended literature

             Martin Fowler:
             Refactoring
             Improving the Design of Existing
             Code

             Addison Wesley 1999




                                Inspiring people to
                                share
Recommended literature

             Kent Beck:
             Test-Driven Development
             By Example


             Addison Wesley 2002




                              Inspiring people to
                             share
Recommended literature

             Martin Fowler:
             Patterns of Enterprise
             Application Architecture

             Addison Wesley 2002




                              Inspiring people to
                              share
Recommended literature
             Eric Evans:
             Domain Driven Design
             Tackling Complexity in the Heart of
             Software


             Addison Wesley 2002




                                 Inspiring people to
                                share
Recommended literature




                    Inspiring people to
                    share
Thanks for listening
      Robert Lemke <robert@typo3.org>




                                        Inspiring people to
                                        share
Gimme Five!
The road to TYPO3 5.0 „Phoenix“

Mais conteúdo relacionado

Destaque

Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...
Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...
Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...Age of Peers
 
TYPO3 Inc. Business Model Presentation
TYPO3 Inc. Business Model PresentationTYPO3 Inc. Business Model Presentation
TYPO3 Inc. Business Model PresentationAlain Veuve
 
Architecture principles in relation to TYPO3
Architecture principles in relation to TYPO3Architecture principles in relation to TYPO3
Architecture principles in relation to TYPO3Gernot Schulmeister
 
TYPO3 presentation CeBIT 2010
TYPO3 presentation CeBIT 2010TYPO3 presentation CeBIT 2010
TYPO3 presentation CeBIT 2010Age of Peers
 
IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes Robert Lemke
 

Destaque (7)

Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...
Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...
Disrupt TYPO3: Thinking the Unthinkable. Challenge our thinking and create a ...
 
TYPO3 Inc. Business Model Presentation
TYPO3 Inc. Business Model PresentationTYPO3 Inc. Business Model Presentation
TYPO3 Inc. Business Model Presentation
 
Architecture principles in relation to TYPO3
Architecture principles in relation to TYPO3Architecture principles in relation to TYPO3
Architecture principles in relation to TYPO3
 
TYPO3 presentation CeBIT 2010
TYPO3 presentation CeBIT 2010TYPO3 presentation CeBIT 2010
TYPO3 presentation CeBIT 2010
 
Architecture & TYPO3
Architecture & TYPO3Architecture & TYPO3
Architecture & TYPO3
 
IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes
 
Workspaces in TYPO3
Workspaces in TYPO3Workspaces in TYPO3
Workspaces in TYPO3
 

Semelhante a The current architecture of TYPO3 5.0

TYPO3 5.0 The Business Case
TYPO3 5.0 The Business CaseTYPO3 5.0 The Business Case
TYPO3 5.0 The Business CaseRobert Lemke
 
Introduction to the Semantic Web
Introduction to the Semantic WebIntroduction to the Semantic Web
Introduction to the Semantic WebNuxeo
 
Development with TYPO3 5.0
Development with TYPO3 5.0Development with TYPO3 5.0
Development with TYPO3 5.0Robert Lemke
 
A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0Karsten Dambekalns
 
Nuxeo Semantic ECM: from Scribo and Stanbol to valuable applications
Nuxeo Semantic ECM: from Scribo and Stanbol to valuable applicationsNuxeo Semantic ECM: from Scribo and Stanbol to valuable applications
Nuxeo Semantic ECM: from Scribo and Stanbol to valuable applicationsNuxeo
 
Web 2.0 And The End Of DITA
Web 2.0 And The End Of DITAWeb 2.0 And The End Of DITA
Web 2.0 And The End Of DITAJoe Gollner
 
CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009johnnewton
 
Inaugural address manjusha - Indicthreads cloud computing conference 2011
Inaugural address manjusha -  Indicthreads cloud computing conference 2011Inaugural address manjusha -  Indicthreads cloud computing conference 2011
Inaugural address manjusha - Indicthreads cloud computing conference 2011IndicThreads
 
Gilbane SF - Content Convergence Strategies
Gilbane SF - Content Convergence StrategiesGilbane SF - Content Convergence Strategies
Gilbane SF - Content Convergence StrategiesEric Barroca
 
IPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DIIPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DIRobert Lemke
 
Applying Semantic Extensions And New Services To Drupal Sem Tech June 2010
Applying Semantic Extensions And New Services To Drupal   Sem Tech June 2010Applying Semantic Extensions And New Services To Drupal   Sem Tech June 2010
Applying Semantic Extensions And New Services To Drupal Sem Tech June 2010AI4BD GmbH
 
From file-based production to real-time co-production
From file-based production to real-time co-productionFrom file-based production to real-time co-production
From file-based production to real-time co-productionMaarten Verwaest
 
From WWW to GGG Ignite Athens 2012
From WWW to GGG Ignite Athens 2012From WWW to GGG Ignite Athens 2012
From WWW to GGG Ignite Athens 2012healis
 
Webinar: Semantic web for developers
Webinar: Semantic web for developersWebinar: Semantic web for developers
Webinar: Semantic web for developersSemantic Web Company
 
Www 2 ggg Athanassios Hatzis
Www 2 ggg Athanassios HatzisWww 2 ggg Athanassios Hatzis
Www 2 ggg Athanassios HatzisIgnite_Athens
 
Migrating from Unstructured to Structured FrameMaker
Migrating from Unstructured to Structured FrameMakerMigrating from Unstructured to Structured FrameMaker
Migrating from Unstructured to Structured FrameMakerScott Abel
 

Semelhante a The current architecture of TYPO3 5.0 (20)

TYPO3 5.0 The Business Case
TYPO3 5.0 The Business CaseTYPO3 5.0 The Business Case
TYPO3 5.0 The Business Case
 
Introduction to the Semantic Web
Introduction to the Semantic WebIntroduction to the Semantic Web
Introduction to the Semantic Web
 
Development with TYPO3 5.0
Development with TYPO3 5.0Development with TYPO3 5.0
Development with TYPO3 5.0
 
A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0A Content Repository for TYPO3 5.0
A Content Repository for TYPO3 5.0
 
Nuxeo Semantic ECM: from Scribo and Stanbol to valuable applications
Nuxeo Semantic ECM: from Scribo and Stanbol to valuable applicationsNuxeo Semantic ECM: from Scribo and Stanbol to valuable applications
Nuxeo Semantic ECM: from Scribo and Stanbol to valuable applications
 
Sapphire
SapphireSapphire
Sapphire
 
Introduction to Pig
Introduction to PigIntroduction to Pig
Introduction to Pig
 
Web 2.0 And The End Of DITA
Web 2.0 And The End Of DITAWeb 2.0 And The End Of DITA
Web 2.0 And The End Of DITA
 
CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009CMIS and Interoperability - AIIM 2009
CMIS and Interoperability - AIIM 2009
 
Inaugural address manjusha - Indicthreads cloud computing conference 2011
Inaugural address manjusha -  Indicthreads cloud computing conference 2011Inaugural address manjusha -  Indicthreads cloud computing conference 2011
Inaugural address manjusha - Indicthreads cloud computing conference 2011
 
Gilbane SF - Content Convergence Strategies
Gilbane SF - Content Convergence StrategiesGilbane SF - Content Convergence Strategies
Gilbane SF - Content Convergence Strategies
 
Saadallah vtls
Saadallah vtlsSaadallah vtls
Saadallah vtls
 
IPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DIIPC07 Talk - Beautiful Code with AOP and DI
IPC07 Talk - Beautiful Code with AOP and DI
 
Applying Semantic Extensions And New Services To Drupal Sem Tech June 2010
Applying Semantic Extensions And New Services To Drupal   Sem Tech June 2010Applying Semantic Extensions And New Services To Drupal   Sem Tech June 2010
Applying Semantic Extensions And New Services To Drupal Sem Tech June 2010
 
From file-based production to real-time co-production
From file-based production to real-time co-productionFrom file-based production to real-time co-production
From file-based production to real-time co-production
 
From WWW to GGG Ignite Athens 2012
From WWW to GGG Ignite Athens 2012From WWW to GGG Ignite Athens 2012
From WWW to GGG Ignite Athens 2012
 
Webinar: Semantic web for developers
Webinar: Semantic web for developersWebinar: Semantic web for developers
Webinar: Semantic web for developers
 
Www 2 ggg Athanassios Hatzis
Www 2 ggg Athanassios HatzisWww 2 ggg Athanassios Hatzis
Www 2 ggg Athanassios Hatzis
 
Migrating from Unstructured to Structured FrameMaker
Migrating from Unstructured to Structured FrameMakerMigrating from Unstructured to Structured FrameMaker
Migrating from Unstructured to Structured FrameMaker
 
IT Governance Portals
IT Governance   PortalsIT Governance   Portals
IT Governance Portals
 

Mais de Robert Lemke

Neos Content Repository – Git for content
Neos Content Repository – Git for contentNeos Content Repository – Git for content
Neos Content Repository – Git for contentRobert Lemke
 
A General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPA General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPRobert Lemke
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesRobert Lemke
 
Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Robert Lemke
 
GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022Robert Lemke
 
OpenID Connect with Neos and Flow
OpenID Connect with Neos and FlowOpenID Connect with Neos and Flow
OpenID Connect with Neos and FlowRobert Lemke
 
Neos Conference 2019 Keynote
Neos Conference 2019 KeynoteNeos Conference 2019 Keynote
Neos Conference 2019 KeynoteRobert Lemke
 
A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)Robert Lemke
 
Neos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome KeynoteNeos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome KeynoteRobert Lemke
 
A practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSA practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSRobert Lemke
 
Neos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome KeynoteNeos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome KeynoteRobert Lemke
 
IPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for DevelopersIPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for DevelopersRobert Lemke
 
Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016Robert Lemke
 
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)Robert Lemke
 
The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)Robert Lemke
 
Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)Robert Lemke
 
Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!Robert Lemke
 
Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!Robert Lemke
 
Turning Neos inside out / React.js HH
Turning Neos inside out / React.js HHTurning Neos inside out / React.js HH
Turning Neos inside out / React.js HHRobert Lemke
 
Docker in Production - IPC 15 München
Docker in Production - IPC 15 MünchenDocker in Production - IPC 15 München
Docker in Production - IPC 15 MünchenRobert Lemke
 

Mais de Robert Lemke (20)

Neos Content Repository – Git for content
Neos Content Repository – Git for contentNeos Content Repository – Git for content
Neos Content Repository – Git for content
 
A General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPA General Purpose Docker Image for PHP
A General Purpose Docker Image for PHP
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022Flownative Beach - Neos Meetup Hamburg 2022
Flownative Beach - Neos Meetup Hamburg 2022
 
GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022
 
OpenID Connect with Neos and Flow
OpenID Connect with Neos and FlowOpenID Connect with Neos and Flow
OpenID Connect with Neos and Flow
 
Neos Conference 2019 Keynote
Neos Conference 2019 KeynoteNeos Conference 2019 Keynote
Neos Conference 2019 Keynote
 
A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)A practical introduction to Kubernetes (IPC 2018)
A practical introduction to Kubernetes (IPC 2018)
 
Neos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome KeynoteNeos Conference 2018 Welcome Keynote
Neos Conference 2018 Welcome Keynote
 
A practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRSA practical introduction to Event Sourcing and CQRS
A practical introduction to Event Sourcing and CQRS
 
Neos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome KeynoteNeos Conference 2017 Welcome Keynote
Neos Conference 2017 Welcome Keynote
 
IPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for DevelopersIPC 2016: Content Strategy for Developers
IPC 2016: Content Strategy for Developers
 
Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016
 
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
Is this Open Source Thing Really Worth it? (IPC 2016 Berlin)
 
The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)The Neos Brand (Inspiring Conference 2016)
The Neos Brand (Inspiring Conference 2016)
 
Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)Neos - past, present, future (Inspiring Conference 2016)
Neos - past, present, future (Inspiring Conference 2016)
 
Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!Meet Neos Nürnberg 2016: Ja ich will!
Meet Neos Nürnberg 2016: Ja ich will!
 
Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!Meet Neos Nürnberg 2016: Hallo Neos!
Meet Neos Nürnberg 2016: Hallo Neos!
 
Turning Neos inside out / React.js HH
Turning Neos inside out / React.js HHTurning Neos inside out / React.js HH
Turning Neos inside out / React.js HH
 
Docker in Production - IPC 15 München
Docker in Production - IPC 15 MünchenDocker in Production - IPC 15 München
Docker in Production - IPC 15 München
 

The current architecture of TYPO3 5.0

  • 1. Gimme Five!architecture of TYPO3 5.0 The current The road to TYPO3 5.0 „Phoenix“ TYPO3 Developer Days 25.-29.04.2007, Dietikon / Switzerland Inspiring people to share
  • 2. The current architecture? we don‘t build buildings – design decisions can be changed most of the time refactoring is already an important part of our daily development with architecture we are referring to the design decisions we have taken so far for the core of TYPO3 5.0 Inspiring people to share
  • 3. The current architecture „ Software is not limited by physics, like buildings are. It is limited by imagination, by design, by organization. In short, it is limited by properties of people, not by properties of the world. ” Martin Fowler Inspiring people to share
  • 5. Ubiquitous language The common vocabulary is an important prerequisite for successful collaboration Use the same words for discussion, modeling, development and documentation Any vocabulary you know from TYPO3 4.x ? Inspiring people to share
  • 6. Ubiquitous language in TYPO3 4.x Frontend Page Extension Content Plugin Element Page System Tree Folder Backend TypoScript Module dard Template Object Stan p Wra Record TER File rks pace Mount Wo beer Inspiring people to share
  • 7. Ubiquitous language in TYPO3 5.0 Page Package Plugin Content Element Page System Tree Component Folder TypoScript dard Object Stan p Template Wra Configura TPR tion orks pace Resource espres so W Inspiring people to share
  • 8. Domain-Driven Design The domain of our software is content management We create a model of our domain which is described by the vocabulary of our ubiquitous language The PHP code is tightly related to our model which gives it meaning and makes the model relevant Inspiring people to share
  • 9. Domain-Driven Design „Set the Modification Date of each Content Element of the Page with the Unique Identifier 1 to the current time“ $page = $pageRepository->findByUid(1); foreach ($page->getContentElements() as $contentElement) { $contentElement->setModificationDate(time()); } Inspiring people to share
  • 10. Layered Architecture This is the point of important! our soft ware, the hom e This is the real point of our software f the model o Domain Inspiring people to share
  • 11. Layered Architecture Domain Data source Inspiring people to share
  • 12. Layered Architecture Presentation Domain Data source Inspiring people to share
  • 13. Layered Architecture Presentation Domain Data source Inspiring people to share
  • 14. Layered Architecture View Presentation Controller Application Logic (Service Layer) Domain Domain Model (Domain Layer) Data Mapper Data source Data Source Abstraction Inspiring people to share
  • 15. Caching Debugging Infrastructure Profiling Messaging Transaction Management Package Resource Logging Versioning Management Management Object Object Data Source MVC Error Relational Management Abstraction Framework Handling Mapping PHP Inspiring people to share
  • 16. Infrastructure frameworks For the infrastructure of TYPO3 we need a lot of features, which are probably covered by existing frameworks we can use: Object Mgm. / Dependecy Injection: Seasar, Pico Container Model, View, Controller: Agavi Aspect Oriented Programming: Seasar, GAP, aspectPHP, ... Database / -model Abstraction: Propel, Creole ... and many more Inspiring people to share
  • 17. Why re-invent the wheel? Inspiring people to share
  • 18. Re-invent the wheel because ... some of the frameworks follow a weird, unclean or inconsistent approach some of the frameworks are not mature enough or badly documented / coded. some of the frameworks don‘t offer all the features we want some projects don‘t have a stable community and support we want a whole, component-based, feature-rich framework offering a consistent interface to the developer which increases quality, speed and ease of development Inspiring people to share
  • 19. Innovated, not re-invented Not just a re-invention, we ... ... looked at the best wheels which exist today (other programming languages have nice wheels, too) ... studied the history of wheels and what experience others made while using them ... added our own creativity and expertise Recipe: Take the best wheels, attach them to a lean, yet powerful vessel (framework) and add the TYPO3 flavour Inspiring people to share
  • 21. C MS ew ork Fram 5.0 1.0 Inspiring people to share
  • 22. Focussing on our domain Framework and CMS: exist as independent packages Enforces clean separation of infrastructure and business logic The Framework can be used without the TYPO3 CMS and serve as a foundation for any enterprise PHP application Packages contain additional functionality for CMS- and other applications The TYPO3 Package Repository can be used independently from the TYPO3 CMS Inspiring people to share
  • 24. TYPO3 Framework Components Packages Aspect Oriented Programming Model, View, Controller Resources Reflection Utility Inspiring people to share
  • 25. TYPO3 Framework Inspiring people to share
  • 26. TYPO3 Framework Inspiring people to share
  • 27. Components Components are re-usable, properly encapsulated objects which are managed by the Component Manager (Almost) all classes in the TYPO3 context are components Components are configurable They allow for Dependency Injection Inspiring people to share
  • 28. Components: Configuration The Component Manager controls the life cycle of a component The scope of a component is just a matter of configuration: prototype, singleton or session A component is referred to by its name, the implementation class is configurable: comparable to the XCLASS mechanism in TYPO3 4.x implementations sharing the same interface act as true drop- in replacements Inspiring people to share
  • 29. Components: Configuration Packages/MyPackage/Classes/T3P_MyPackage_MyComponent.php class T3P_MyPackage_MyComponent { protected $counter = 0; public function increaseAndGetCounter() { return $this->counter ++; } } Inspiring people to share
  • 30. Components: Configuration Packages/MyPackage/Classes/T3P_MyPackage_MyComponent.php Packages/MyPackage/Classes/Components.conf class T3P_MyPackage_MyComponent { [T3P_MyPackage_MyComponent] scope = prototype = 0; protected $counter public function increaseAndGetCounter() { return $this->counter ++; } } Inspiring people to share
  • 31. Components: Dependency Injection Inverse of Control or Hollywood Principle: „Don‘t call us, we call you“ Your component needs access to a Logger Usual case: Your code asks the framework to deliver a logger instance With Dependency Injection: Your code just gets an instance of the logger injected Inspiring people to share
  • 32. Components: Dependency Injection class tx_myextension_pi1 { protected $logger; public function __construct() { $this->logger = t3lib_div::makeInstance(’tx_log_logger‘); } public function main() { $this->logger->log(’Hello log file‘); } } Inspiring people to share
  • 33. Components: Dependency Injection class tx_myextension_pi1 { protected $logger; public function __construct() { $this->logger = tx_log_logger::getInstance(); # Custom Singleton implementation } public function main() { $this->logger->log(’Hello log file‘); } } Inspiring people to share
  • 34. Components: Dependency Injection class T3P_MyPackage_MyComponent { protected $logger; public function __construct(T3P_Log_LoggerInterface $logger) { $this->logger = $logger; } public function main() { $this->logger->log(’Hello log‘); } } Inspiring people to share
  • 35. Components: Dependency Injection Different ways of injection: Constructor injection Setter injection Dependencies are resolved automatically Classes are loaded automatically ... of course: configurable Inspiring people to share
  • 36. Packages Extensions are now called Packages A package is any combination of meta data, code, documentation, media and other resources Packages can be up- and downloaded from the Package Repository Documentation is stored as DocBook The exchange format for packages is a plain ZIP file Inspiring people to share
  • 37. Packages: Package Manager Manages packages - replacement for the Extension Manager Accessible through command line and SOAP The package manager can even upgrade the Framework package, ie. it can upgrade itself Inspiring people to share
  • 38. Aspect Oriented Programming AOP is a programming paradigm complements OOP by separating concerns to improve modularization OOP modularizes concerns: methods, classes, packages AOP addresses cross-cutting concerns Inspiring people to share
  • 39. AOP: Cross-cutting concerns Presentation Domain Data source Inspiring people to share
  • 40. AOP: Cross-cutting concerns Presentation The concerns live here Domain Data source Inspiring people to share
  • 41. AOP: Cross-cutting concerns Guestbook Forum Domain News Content Parties Inspiring people to share
  • 42. AOP: Cross-cutting concerns Guestbook Forum News Content Parties Security Logging Inspiring people to share
  • 43. AOP: Cross-cutting concerns Guestbook Security Forum News Content Parties Logging Inspiring people to share
  • 44. AOP: Cross-cutting concerns Guestbook Security Forum News Content Parties Logging Inspiring people to share
  • 45. AOP: Method interception Hypothetical code example class T3P_User_AccountManagement { public function deleteAccount($accountId) { $this->accountRepository->delete($accountId); } } Inspiring people to share
  • 46. AOP: Method interception class T3P_Security_RightsManager { public function hasEnoughRights($situation) { $account = $this->accountManager->getCurrentAccount(); return $account->hasEnoughRightsForSituation($situation); } } Inspiring people to share
  • 47. AOP: Method interception class T3P_User_AccountManagement { public function deleteAccount($accountId) { $account = $this->accountManager->getCurrentAccount(); if ($account->hasEnoughRightsForSituation($situation)) { $this->accountRepository->delete($accountId); } else { throw new NotEnoughtRightsException(’Access denied’); } } } Inspiring people to share
  • 48. AOP: Implementation details TYPO3 makes use of dynamic proxies for weaving Our AOP Framework does not require any pre-processing or a special PHP extension to run Standards are used where they made sense, other parts are simplified or adapted to the PHP capabilities only low performance loss because weaving is a one-time operation which can be cached Inspiring people to share
  • 49. AOP Where it makes sense: Cross-cutting concerns Extending legacy code Caveats: Scattered code, multiple extensions check out clean OOP alternatives Inspiring people to share
  • 50. Model, View, Controller MVC Framework is work in progress Some design decisions taken: Request Handler with filter chain Dispatcher with interceptor chain One controller per plugin, multiple actions per controller Code is on the way ... Inspiring people to share
  • 52. Resources Resource Manager for centralizing resource access Media, documents, generic files and other resources are available as resource objects File resources from the packages are detected and managed automatically Allows for fine-grained rights management and performance optimization Status: Pending Inspiring people to share
  • 53. Reflection Extended reflection capabilities Allow for accessing tags in doc comments directly Will feature some caching mechanism in the future Maybe an annotation manager will be added Inspiring people to share
  • 54. Utility Home of t3lib_div-like tools Some functions have already been ported Inspiring people to share
  • 55. TYPO3 CMS Currently working on the model / node types TypoScript 2.0 Content Repository Inspiring people to share
  • 56. Some project ideas Implement the TYPO3 Package Repository as 5.0 package Create a 5.0 implementation of the Party Information Framework Integrate 5.0 as a 4.x frontend plugin Create a bootstrap-like, everything-works-auto-installer Inspiring people to share
  • 57. Recommended literature Gamma et al.: Design Patterns Elements of Reusable Object- Oriented Software Addison Wesley 1995 Inspiring people to share
  • 58. Recommended literature Martin Fowler: Refactoring Improving the Design of Existing Code Addison Wesley 1999 Inspiring people to share
  • 59. Recommended literature Kent Beck: Test-Driven Development By Example Addison Wesley 2002 Inspiring people to share
  • 60. Recommended literature Martin Fowler: Patterns of Enterprise Application Architecture Addison Wesley 2002 Inspiring people to share
  • 61. Recommended literature Eric Evans: Domain Driven Design Tackling Complexity in the Heart of Software Addison Wesley 2002 Inspiring people to share
  • 62. Recommended literature Inspiring people to share
  • 63. Thanks for listening Robert Lemke <robert@typo3.org> Inspiring people to share
  • 64. Gimme Five! The road to TYPO3 5.0 „Phoenix“