SlideShare uma empresa Scribd logo
1 de 48
Baixar para ler offline
International PHP Conference 2008   Inspiring people to
Fluent Development with FLOW3       share
The History of FLOW3
      (short version)
The Long History of TYPO3
 Since 1998

 33 core members

 committed 500.000 lines of code

 resulting in a code base of

 300.000 lines today
TYPO3 today
     TYPO3 v4 is nearly feature complete

     Grown architecture, few unit tests

     Fundamental changes are risky

     Often used as an application framework - but was designed as a CMS




Fluent Development with FLOW3                                   Inspiring people to
                                                                share
TYPO3 tomorrow?




Fluent Development with FLOW3   Inspiring people to
                                share
<?php
Buy none get two for free.




Fluent Development with FLOW3   Inspiring people to
                                share
TYPO3 tomorrow
     FLOW3 acts as a reliable basis for any kind of web application

     TYPO3 v5 is a package based on FLOW3

     Extensions are packages as well, all based on FLOW3


     Packages can be used

       as extensions for TYPO3

       as libraries for standalone applications


Fluent Development with FLOW3                                         Inspiring people to
                                                                      share
The FLOW3 experience
 Flow [fl!] The mental state of operation in which the person is fully immersed in
 what he or she is doing by a feeling of energized focus, full involvement, and
 success in the process of the activity. Proposed by positive psychologist Mihály
 Csíkszentmihályi, the concept has been widely referenced across a variety of fields.

 FLOW3 [fl!'three] The application framework which takes care of all hassle and lets
 you play the fun part.




Fluent Development with FLOW3                                      Inspiring people to
                                                                   share
!   /**
!     * Creates a customer
!     *
!     * @return void
!     */
!   public function createAction() {
!   !     if (!$this->authorizationService->getCurrentUser()->hasRole('Admin')) {
!   !     !     $this->logger->log('Someone tried to create a new customer.');
!   !     !     throw new AccessDeniedException('You may not create customers.');
!   !     }
!   !     if ($this->request->getProtocol != 'HTTPS') {
!   !     !     $this->logger->log('Someone tried to create a new customer not using HTTPS.');
!   !     !     throw new SecurityException('Customers may only be created via HTTPS');
!   !     }
!   !
!   !     if (strlen($_POST['firstname']) > 50) throw new InvalidArgumentException();
!   !
!   !     $customer = new ModelCustomer;
!   !     $customer->setFirstName($_POST['firstname']);
!   !     $customer->setLastName($_POST['lastname']);
!   !
!   !     $customerValidator = MyAppValidatorsCustomerValidator::getInstance();
!   !     if ($customerValidator->validate($customer)) {
!   !     !     $customer->save();
!   !     !     $this->logger->log('A new customer was saved');
!   !     } else {
!   !     !     throw new InvalidCustomerException();
!   !     }
!   }




      Fluent Development with FLOW3                                                              Inspiring people to
                                                                                                 share
!   /**
!     * Creates a customer
!     *
!     * @return void
!     */
!   public function createAction() {
!   !     if (!$this->authorizationService->getCurrentUser()->hasRole('Admin')) {
!   !     !     $this->logger->log('Someone tried to create a new customer.');
!   !     !     throw new AccessDeniedException('You may not create customers.');
!   !     }
!   !     if ($this->request->getProtocol != 'HTTPS') {
!   !     !     $this->logger->log('Someone tried to create a new customer not using HTTPS.');
!   !     !     throw new SecurityException('Customers may only be created via HTTPS');
!   !     }
!   !
!   !     if (strlen($_POST['firstname']) > 50) throw new InvalidArgumentException();
!   !
!   !     $customer = new ModelCustomer;
!   !     $customer->setFirstName($_POST['firstname']);
!   !     $customer->setLastName($_POST['lastname']);
!   !
!   !     $customerValidator = MyAppValidatorsCustomerValidator::getInstance();
!   !     if ($customerValidator->validate($customer)) {
!   !     !     $customer->save();
!   !     !     $this->logger->log('A new customer was saved');
!   !     } else {
!   !     !     throw new InvalidCustomerException();
!   !     }
!   }




      Fluent Development with FLOW3                                                              Inspiring people to
                                                                                                 share
<?php

!       /**
!         * Creates a customer
!         *
!         * @return void
!         */
!       public function createAction() {
!       !     if ($this->arguments->hasErrors()) $this->throwStatus(400, 'Bad Request', '<strong>Invalid arguments!</strong>');

!       !    $customer = new DomainModelCustomer();
!       !    $this->dataMapper->map($this->arguments['customer'], $customer);
!       !    $this->customerRepository->add($customer);

!       !    $this->throwStatus(201);
!       }

?>




            Fluent Development with FLOW3                                                                  Inspiring people to
                                                                                                           share
FLOW3 = Application Framework
     Not just a collection of components or code snippet library

     Comes with ready-to-go default configuration

     Package based
                       PHP 5
     Runs with PHP 5.3 or later.3alpha
                                        1
     Comes with a powerful JSR-283 based Content Repository




Fluent Development with FLOW3                                      Inspiring people to
                                                                   share
Finest Handmade PHP Code
     100% documented source code (top project at Ohloh)

     Consistent and intuitive class, method and variable names

     FLOW3 Core Team always develops test-driven

     Continuous Integration

       multiple commits each day

       automatic tests for Linux, Windows and Mac with SQLite, MySQL and Postgres

       open CI server with statistics, email and jabber notifications


Fluent Development with FLOW3                                      Inspiring people to
                                                                   share
FLOW3 modules
     AOP                Locale        Reflection

     Component          Log           Resource

     Configuration       MVC           Security

     Cache              Package       Utility

     Error              Persistence   Validation

     Event              Property      ... and more



Fluent Development with FLOW3                   Inspiring people to
                                                share
Getting Started




Fluent Development with FLOW3   Inspiring people to
                                share
Getting Started


Requirements
       Some webserver (tested with Apache and IIS)

       PHP 5.3alpha1 or higher (see http://snaps.php.net/)

          PHP extensions: zlib, PDO and PDO SQLite and the usual stuff

       Some database (tested with SQLite, MySQL and Postgres)




Fluent Development with FLOW3                                        Inspiring people to
                                                                     share
Getting Started


Download
       Currently available through Subversion

          Checkout the FLOW3 Distribution:
          svn co https://svn.typo3.org/FLOW3/distribution/trunk

          or try the TYPO3 Distribution:
          svn co https://svn.typo3.org/TYPO3v5/distribution/trunk

       Nightly builds will follow after the 1.0 alpha 1 release




Fluent Development with FLOW3                                     Inspiring people to
                                                                  share
Fluent Development with FLOW3   Inspiring people to
                                share
Getting Started


Grant File Permissions
       The webserver needs

          read access for all files of the distribution and

          write access in the Public and Data directory

       On Linux / Mac just call sudo ./fixpermissions.sh

       On legacy operating systems: ask your system administrator




Fluent Development with FLOW3                                       Inspiring people to
                                                                    share
Getting Started


Create a package
In order to create a new package, just create
a new folder within the Packages directory.




Fluent Development with FLOW3                   Inspiring people to
                                                share
Getting Started


     Create a Default Controller
         Create a subfolder in your package: Classes/Controller/

         Create the controller class file:



<?php
declare(ENCODING = 'utf-8');
namespace F3MyPackageController;

class DefaultController extends F3FLOW3MVCControllerActionController {

!     public function indexAction() {
!     !    return 'Hello World!';
!     }
}

?>


     Fluent Development with FLOW3                                           Inspiring people to
                                                                             share
Bootstrap




Fluent Development with FLOW3   Inspiring people to
                                share
Bootstrap


Public/index.php
       This file is the default main script

       It launches FLOW3 in the Production context

       The webserver's web root should point to the Public directory


  define('FLOW3_PATH_PUBLIC', str_replace('', '/', __DIR__) . '/');
  require(FLOW3_PATH_PUBLIC . '../Packages/FLOW3/Classes/F3_FLOW3.php');

  $framework = new F3FLOW3();
  $framework->run();




Fluent Development with FLOW3                                              Inspiring people to
                                                                           share
Bootstrap


Public/index_dev.php
       This script is used for development

       It launches FLOW3 in the Development context

       More scripts like this can be created for additional contexts


  define('FLOW3_PATH_PUBLIC', str_replace('', '/', __DIR__) . '/');
  require(FLOW3_PATH_PUBLIC . '../Packages/FLOW3/Classes/F3_FLOW3.php');

  $framework = new F3FLOW3('Development');
  $framework->run();




Fluent Development with FLOW3                                              Inspiring people to
                                                                           share
Model - View - Controller




Fluent Development with FLOW3   Inspiring people to
                                share
MVC


Key Features
      Powerful Request-Response mechanism, based on Front Controller and
      Dispatcher

      Very convenient controllers and views

      Supports multiple template engines

      Sophisticated, easy to configure routing

      Built-in validation and default security

      REST support


Fluent Development with FLOW3                                   Inspiring people to
                                                               share
MVC


Model Types
                  Active Record                               Domain Model

             Model of / wrapper for a              Model of a domain which consists of
               database table row                          data and behaviour

           is responsible for persistence             doesn't know about persistence

  mixes infrastructure concerns with model           doesn't know about infrastructure

      quick to implement without a framework   clean and easy to use if framework supports it



Fluent Development with FLOW3                                            Inspiring people to
                                                                         share
MVC Pattern


Model
                   Active Record                             Domain Model

              Model of / wrapper for a            Model of a domain which consists of
                database table row                        data and behaviour

         is responsible for persistence              doesn't know about persistence

   mixes infrastructure concerns with model         doesn't know about infrastructure

   quick to implement without a framework     clean and easy to use if framework supports it



Fluent Development with FLOW3                                           Inspiring people to
                                                                        share
MVC Pattern


Model
                   Active Record                             Domain Model

              Model of / wrapper for a            Model of a domain which consists of
                database table row                        data and behaviour

         is responsible for persistence              doesn't know about persistence

   mixes infrastructure concerns with model         doesn't know about infrastructure

   quick to implement without a framework     clean and easy to use if framework supports it



Fluent Development with FLOW3                                           Inspiring people to
                                                                        share
Persistence




Fluent Development with FLOW3   Inspiring people to
                                share
Persistence


JSR-283 based Content Repository
       Defines a uniform API for accessing content repositories

       A Content Repository

          is a kind of object database for storage, search and retrieval of hierarchical
          data

          provides methods for versioning, transactions and monitoring

       TYPO3CR is the first working port of JSR-170 / JSR-283

       Karsten Dambekalns is member of the JSR-283 expert group


Fluent Development with FLOW3                                          Inspiring people to
                                                                       share
Persistence


Transparent Persistence
       Explicit support for Domain-Driven Design

       Class Schemata are defined by the Domain Model class

          No need to write an XML or YAML schema definition

          No need to define the database model and object model multiple
          times at different places

       Automatic persistence in the JSR-283 based Content Repository

       Legacy data sources can be mounted


Fluent Development with FLOW3                                      Inspiring people to
                                                                   share
Components




Fluent Development with FLOW3   Inspiring people to
                                share
Components


Component Dependencies
      Components seldomly come alone

      Components depend on other components which depend on
      other components which ...

      Problem:

        Components explicitly refer to other components:
        $phoneBookManager = new PhoneBookManager




Fluent Development with FLOW3                                 Inspiring people to
                                                              share
Components


Dependency Injection
      A component doesn't ask for the instance of another
      component but gets it injected

      This methodology is referred to as the "Hollywood Principle":
      "Don't call us, we'll call you"

      Enforces loose coupling and high cohesion

      Makes you a better programmer




Fluent Development with FLOW3                                         Inspiring people to
                                                                      share
Components


Autowiring
      FLOW3 tries to autowire constructor arguments and
      arguments of inject* methods

      The type of the component to be injected is determined by
      the argument type (type hinting)

      Autowiring does not work with Setter Injection through
      regular setters (set* methods)

      Dependencies are only autowired if no argument is passed
      explicitly



Fluent Development with FLOW3                                     Inspiring people to
                                                                  share
DEMO

Fluent Development with FLOW3   Inspiring people to
                                share
Security




Fluent Development with FLOW3   Inspiring people to
                                share
Playground




Fluent Development with FLOW3   Inspiring people to
                                share
Things to play with


F3BLOG
       Try out the Blog Example:
       svn co https://svn.typo3.org/FLOW3/Distribution/branches/BlogExample/




Fluent Development with FLOW3                            Inspiring people to
                                                         share
Things to play with


TYPO3CR Admin
       Play with persistence and watch your object in the TYPO3CR Admin




Fluent Development with FLOW3                                      Inspiring people to
                                                                  share
Things to play with


Testrunner
       Experiment with Test-Driven Development and watch the tests in
       FLOW3's test runner




Fluent Development with FLOW3                                     Inspiring people to
                                                                  share
Progress

             Developing FLOW3 ...




Fluent Development with FLOW3       Inspiring people to
                                    share
Next Steps
     First FLOW3 alpha release end of this year

     First pilot projects based on FLOW3 in spring '09

     Further development of the TYPO3 package

     Planned release of TYPO3 5.0 alpha: end of 2009




Fluent Development with FLOW3                            Inspiring people to
                                                         share
Links
     These Slides
     http://flow3.typo3.org/documentation/slides/

     FLOW3 Website
     http://flow3.typo3.org

     TYPO3 Forge
     http://forge.typo3.org

     Further Reading
     http://flow3.typo3.org/about/principles/further-reading/



Fluent Development with FLOW3                                  Inspiring people to
                                                               share
Questions




Fluent Development with FLOW3   Inspiring people to
                                share
Fluent Development with FLOW3

Mais conteúdo relacionado

Mais procurados

The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017Ryan Weaver
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)LumoSpark
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsSolution4Future
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Brad Williams
 
BUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREY
BUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREYBUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREY
BUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREYCodeCore
 
Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Ryan Weaver
 
Flask restfulservices
Flask restfulservicesFlask restfulservices
Flask restfulservicesMarcos Lin
 
How to Submit a plugin to WordPress.org Repository
How to Submit a plugin to WordPress.org RepositoryHow to Submit a plugin to WordPress.org Repository
How to Submit a plugin to WordPress.org RepositoryTareq Hasan
 
T3CON11: Lazy Development using the Extension Builder
T3CON11: Lazy Development using the Extension BuilderT3CON11: Lazy Development using the Extension Builder
T3CON11: Lazy Development using the Extension BuilderSteffen Müller
 
Getting root with benign app store apps
Getting root with benign app store appsGetting root with benign app store apps
Getting root with benign app store appsCsaba Fitzl
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Rest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemyRest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemyAlessandro Cucci
 
End to end web security
End to end web securityEnd to end web security
End to end web securityGeorge Boobyer
 
Windows Attacks AT is the new black
Windows Attacks   AT is the new blackWindows Attacks   AT is the new black
Windows Attacks AT is the new blackRob Fuller
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkChristian Trabold
 
Session: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from ScratchSession: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from ScratchRoald Umandal
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity George Boobyer
 

Mais procurados (20)

The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010
 
BUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREY
BUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREYBUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREY
BUILDING MODERN PYTHON WEB FRAMEWORKS USING FLASK WITH NEIL GREY
 
Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)
 
Flask restfulservices
Flask restfulservicesFlask restfulservices
Flask restfulservices
 
How to Submit a plugin to WordPress.org Repository
How to Submit a plugin to WordPress.org RepositoryHow to Submit a plugin to WordPress.org Repository
How to Submit a plugin to WordPress.org Repository
 
T3CON11: Lazy Development using the Extension Builder
T3CON11: Lazy Development using the Extension BuilderT3CON11: Lazy Development using the Extension Builder
T3CON11: Lazy Development using the Extension Builder
 
MVC for TYPO3 4.3 with extbase
MVC for TYPO3 4.3 with extbaseMVC for TYPO3 4.3 with extbase
MVC for TYPO3 4.3 with extbase
 
Getting root with benign app store apps
Getting root with benign app store appsGetting root with benign app store apps
Getting root with benign app store apps
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Rest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemyRest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemy
 
End to end web security
End to end web securityEnd to end web security
End to end web security
 
Windows Attacks AT is the new black
Windows Attacks   AT is the new blackWindows Attacks   AT is the new black
Windows Attacks AT is the new black
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
Session: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from ScratchSession: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from Scratch
 
REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity
 

Semelhante a Fluent Development with FLOW3

Creating Clean Code with AOP (WebExpo 2010)
Creating Clean Code with AOP (WebExpo 2010)Creating Clean Code with AOP (WebExpo 2010)
Creating Clean Code with AOP (WebExpo 2010)Robert Lemke
 
OCI Oracle Functions Deployment
OCI Oracle Functions Deployment OCI Oracle Functions Deployment
OCI Oracle Functions Deployment Toni Epple
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3Robert Lemke
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Robert Lemke
 
Hitchhiker’s Guide to FLOW3
Hitchhiker’s Guide to FLOW3Hitchhiker’s Guide to FLOW3
Hitchhiker’s Guide to FLOW3Robert Lemke
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtRobert Lemke
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
 
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a FoxModern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a FoxC4Media
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckrICh morrow
 
Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorialKaty Slemon
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
Filesystem Management with Flysystem - php[tek] 2023
Filesystem Management with Flysystem - php[tek] 2023Filesystem Management with Flysystem - php[tek] 2023
Filesystem Management with Flysystem - php[tek] 2023Mark Niebergall
 

Semelhante a Fluent Development with FLOW3 (20)

Creating Clean Code with AOP (WebExpo 2010)
Creating Clean Code with AOP (WebExpo 2010)Creating Clean Code with AOP (WebExpo 2010)
Creating Clean Code with AOP (WebExpo 2010)
 
OCI Oracle Functions Deployment
OCI Oracle Functions Deployment OCI Oracle Functions Deployment
OCI Oracle Functions Deployment
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3
 
Introduction to Flow3
Introduction to Flow3Introduction to Flow3
Introduction to Flow3
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)
 
Hitchhiker’s Guide to FLOW3
Hitchhiker’s Guide to FLOW3Hitchhiker’s Guide to FLOW3
Hitchhiker’s Guide to FLOW3
 
Laravel 5.3 - Web Development Php framework
Laravel 5.3 - Web Development Php frameworkLaravel 5.3 - Web Development Php framework
Laravel 5.3 - Web Development Php framework
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
WebGUI Developers Workshop
WebGUI Developers WorkshopWebGUI Developers Workshop
WebGUI Developers Workshop
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 Frankfurt
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
 
Revoke-Obfuscation
Revoke-ObfuscationRevoke-Obfuscation
Revoke-Obfuscation
 
Modern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a FoxModern Web Security, Lazy but Mindful Like a Fox
Modern Web Security, Lazy but Mindful Like a Fox
 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 
Flask jwt authentication tutorial
Flask jwt authentication tutorialFlask jwt authentication tutorial
Flask jwt authentication tutorial
 
Php
PhpPhp
Php
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
Filesystem Management with Flysystem - php[tek] 2023
Filesystem Management with Flysystem - php[tek] 2023Filesystem Management with Flysystem - php[tek] 2023
Filesystem Management with Flysystem - php[tek] 2023
 

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

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
 
IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes IPC16: A Practical Introduction to Kubernetes
IPC16: A Practical Introduction to Kubernetes
 
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
 

Fluent Development with FLOW3

  • 1. International PHP Conference 2008 Inspiring people to Fluent Development with FLOW3 share
  • 2. The History of FLOW3 (short version)
  • 3. The Long History of TYPO3 Since 1998 33 core members committed 500.000 lines of code resulting in a code base of 300.000 lines today
  • 4. TYPO3 today TYPO3 v4 is nearly feature complete Grown architecture, few unit tests Fundamental changes are risky Often used as an application framework - but was designed as a CMS Fluent Development with FLOW3 Inspiring people to share
  • 5. TYPO3 tomorrow? Fluent Development with FLOW3 Inspiring people to share
  • 7. Buy none get two for free. Fluent Development with FLOW3 Inspiring people to share
  • 8. TYPO3 tomorrow FLOW3 acts as a reliable basis for any kind of web application TYPO3 v5 is a package based on FLOW3 Extensions are packages as well, all based on FLOW3 Packages can be used as extensions for TYPO3 as libraries for standalone applications Fluent Development with FLOW3 Inspiring people to share
  • 9. The FLOW3 experience Flow [fl!] The mental state of operation in which the person is fully immersed in what he or she is doing by a feeling of energized focus, full involvement, and success in the process of the activity. Proposed by positive psychologist Mihály Csíkszentmihályi, the concept has been widely referenced across a variety of fields. FLOW3 [fl!'three] The application framework which takes care of all hassle and lets you play the fun part. Fluent Development with FLOW3 Inspiring people to share
  • 10. ! /** ! * Creates a customer ! * ! * @return void ! */ ! public function createAction() { ! ! if (!$this->authorizationService->getCurrentUser()->hasRole('Admin')) { ! ! ! $this->logger->log('Someone tried to create a new customer.'); ! ! ! throw new AccessDeniedException('You may not create customers.'); ! ! } ! ! if ($this->request->getProtocol != 'HTTPS') { ! ! ! $this->logger->log('Someone tried to create a new customer not using HTTPS.'); ! ! ! throw new SecurityException('Customers may only be created via HTTPS'); ! ! } ! ! ! ! if (strlen($_POST['firstname']) > 50) throw new InvalidArgumentException(); ! ! ! ! $customer = new ModelCustomer; ! ! $customer->setFirstName($_POST['firstname']); ! ! $customer->setLastName($_POST['lastname']); ! ! ! ! $customerValidator = MyAppValidatorsCustomerValidator::getInstance(); ! ! if ($customerValidator->validate($customer)) { ! ! ! $customer->save(); ! ! ! $this->logger->log('A new customer was saved'); ! ! } else { ! ! ! throw new InvalidCustomerException(); ! ! } ! } Fluent Development with FLOW3 Inspiring people to share
  • 11. ! /** ! * Creates a customer ! * ! * @return void ! */ ! public function createAction() { ! ! if (!$this->authorizationService->getCurrentUser()->hasRole('Admin')) { ! ! ! $this->logger->log('Someone tried to create a new customer.'); ! ! ! throw new AccessDeniedException('You may not create customers.'); ! ! } ! ! if ($this->request->getProtocol != 'HTTPS') { ! ! ! $this->logger->log('Someone tried to create a new customer not using HTTPS.'); ! ! ! throw new SecurityException('Customers may only be created via HTTPS'); ! ! } ! ! ! ! if (strlen($_POST['firstname']) > 50) throw new InvalidArgumentException(); ! ! ! ! $customer = new ModelCustomer; ! ! $customer->setFirstName($_POST['firstname']); ! ! $customer->setLastName($_POST['lastname']); ! ! ! ! $customerValidator = MyAppValidatorsCustomerValidator::getInstance(); ! ! if ($customerValidator->validate($customer)) { ! ! ! $customer->save(); ! ! ! $this->logger->log('A new customer was saved'); ! ! } else { ! ! ! throw new InvalidCustomerException(); ! ! } ! } Fluent Development with FLOW3 Inspiring people to share
  • 12. <?php ! /** ! * Creates a customer ! * ! * @return void ! */ ! public function createAction() { ! ! if ($this->arguments->hasErrors()) $this->throwStatus(400, 'Bad Request', '<strong>Invalid arguments!</strong>'); ! ! $customer = new DomainModelCustomer(); ! ! $this->dataMapper->map($this->arguments['customer'], $customer); ! ! $this->customerRepository->add($customer); ! ! $this->throwStatus(201); ! } ?> Fluent Development with FLOW3 Inspiring people to share
  • 13. FLOW3 = Application Framework Not just a collection of components or code snippet library Comes with ready-to-go default configuration Package based PHP 5 Runs with PHP 5.3 or later.3alpha 1 Comes with a powerful JSR-283 based Content Repository Fluent Development with FLOW3 Inspiring people to share
  • 14. Finest Handmade PHP Code 100% documented source code (top project at Ohloh) Consistent and intuitive class, method and variable names FLOW3 Core Team always develops test-driven Continuous Integration multiple commits each day automatic tests for Linux, Windows and Mac with SQLite, MySQL and Postgres open CI server with statistics, email and jabber notifications Fluent Development with FLOW3 Inspiring people to share
  • 15. FLOW3 modules AOP Locale Reflection Component Log Resource Configuration MVC Security Cache Package Utility Error Persistence Validation Event Property ... and more Fluent Development with FLOW3 Inspiring people to share
  • 16. Getting Started Fluent Development with FLOW3 Inspiring people to share
  • 17. Getting Started Requirements Some webserver (tested with Apache and IIS) PHP 5.3alpha1 or higher (see http://snaps.php.net/) PHP extensions: zlib, PDO and PDO SQLite and the usual stuff Some database (tested with SQLite, MySQL and Postgres) Fluent Development with FLOW3 Inspiring people to share
  • 18. Getting Started Download Currently available through Subversion Checkout the FLOW3 Distribution: svn co https://svn.typo3.org/FLOW3/distribution/trunk or try the TYPO3 Distribution: svn co https://svn.typo3.org/TYPO3v5/distribution/trunk Nightly builds will follow after the 1.0 alpha 1 release Fluent Development with FLOW3 Inspiring people to share
  • 19. Fluent Development with FLOW3 Inspiring people to share
  • 20. Getting Started Grant File Permissions The webserver needs read access for all files of the distribution and write access in the Public and Data directory On Linux / Mac just call sudo ./fixpermissions.sh On legacy operating systems: ask your system administrator Fluent Development with FLOW3 Inspiring people to share
  • 21. Getting Started Create a package In order to create a new package, just create a new folder within the Packages directory. Fluent Development with FLOW3 Inspiring people to share
  • 22. Getting Started Create a Default Controller Create a subfolder in your package: Classes/Controller/ Create the controller class file: <?php declare(ENCODING = 'utf-8'); namespace F3MyPackageController; class DefaultController extends F3FLOW3MVCControllerActionController { ! public function indexAction() { ! ! return 'Hello World!'; ! } } ?> Fluent Development with FLOW3 Inspiring people to share
  • 23. Bootstrap Fluent Development with FLOW3 Inspiring people to share
  • 24. Bootstrap Public/index.php This file is the default main script It launches FLOW3 in the Production context The webserver's web root should point to the Public directory define('FLOW3_PATH_PUBLIC', str_replace('', '/', __DIR__) . '/'); require(FLOW3_PATH_PUBLIC . '../Packages/FLOW3/Classes/F3_FLOW3.php'); $framework = new F3FLOW3(); $framework->run(); Fluent Development with FLOW3 Inspiring people to share
  • 25. Bootstrap Public/index_dev.php This script is used for development It launches FLOW3 in the Development context More scripts like this can be created for additional contexts define('FLOW3_PATH_PUBLIC', str_replace('', '/', __DIR__) . '/'); require(FLOW3_PATH_PUBLIC . '../Packages/FLOW3/Classes/F3_FLOW3.php'); $framework = new F3FLOW3('Development'); $framework->run(); Fluent Development with FLOW3 Inspiring people to share
  • 26. Model - View - Controller Fluent Development with FLOW3 Inspiring people to share
  • 27. MVC Key Features Powerful Request-Response mechanism, based on Front Controller and Dispatcher Very convenient controllers and views Supports multiple template engines Sophisticated, easy to configure routing Built-in validation and default security REST support Fluent Development with FLOW3 Inspiring people to share
  • 28. MVC Model Types Active Record Domain Model Model of / wrapper for a Model of a domain which consists of database table row data and behaviour is responsible for persistence doesn't know about persistence mixes infrastructure concerns with model doesn't know about infrastructure quick to implement without a framework clean and easy to use if framework supports it Fluent Development with FLOW3 Inspiring people to share
  • 29. MVC Pattern Model Active Record Domain Model Model of / wrapper for a Model of a domain which consists of database table row data and behaviour is responsible for persistence doesn't know about persistence mixes infrastructure concerns with model doesn't know about infrastructure quick to implement without a framework clean and easy to use if framework supports it Fluent Development with FLOW3 Inspiring people to share
  • 30. MVC Pattern Model Active Record Domain Model Model of / wrapper for a Model of a domain which consists of database table row data and behaviour is responsible for persistence doesn't know about persistence mixes infrastructure concerns with model doesn't know about infrastructure quick to implement without a framework clean and easy to use if framework supports it Fluent Development with FLOW3 Inspiring people to share
  • 31. Persistence Fluent Development with FLOW3 Inspiring people to share
  • 32. Persistence JSR-283 based Content Repository Defines a uniform API for accessing content repositories A Content Repository is a kind of object database for storage, search and retrieval of hierarchical data provides methods for versioning, transactions and monitoring TYPO3CR is the first working port of JSR-170 / JSR-283 Karsten Dambekalns is member of the JSR-283 expert group Fluent Development with FLOW3 Inspiring people to share
  • 33. Persistence Transparent Persistence Explicit support for Domain-Driven Design Class Schemata are defined by the Domain Model class No need to write an XML or YAML schema definition No need to define the database model and object model multiple times at different places Automatic persistence in the JSR-283 based Content Repository Legacy data sources can be mounted Fluent Development with FLOW3 Inspiring people to share
  • 34. Components Fluent Development with FLOW3 Inspiring people to share
  • 35. Components Component Dependencies Components seldomly come alone Components depend on other components which depend on other components which ... Problem: Components explicitly refer to other components: $phoneBookManager = new PhoneBookManager Fluent Development with FLOW3 Inspiring people to share
  • 36. Components Dependency Injection A component doesn't ask for the instance of another component but gets it injected This methodology is referred to as the "Hollywood Principle": "Don't call us, we'll call you" Enforces loose coupling and high cohesion Makes you a better programmer Fluent Development with FLOW3 Inspiring people to share
  • 37. Components Autowiring FLOW3 tries to autowire constructor arguments and arguments of inject* methods The type of the component to be injected is determined by the argument type (type hinting) Autowiring does not work with Setter Injection through regular setters (set* methods) Dependencies are only autowired if no argument is passed explicitly Fluent Development with FLOW3 Inspiring people to share
  • 38. DEMO Fluent Development with FLOW3 Inspiring people to share
  • 39. Security Fluent Development with FLOW3 Inspiring people to share
  • 40. Playground Fluent Development with FLOW3 Inspiring people to share
  • 41. Things to play with F3BLOG Try out the Blog Example: svn co https://svn.typo3.org/FLOW3/Distribution/branches/BlogExample/ Fluent Development with FLOW3 Inspiring people to share
  • 42. Things to play with TYPO3CR Admin Play with persistence and watch your object in the TYPO3CR Admin Fluent Development with FLOW3 Inspiring people to share
  • 43. Things to play with Testrunner Experiment with Test-Driven Development and watch the tests in FLOW3's test runner Fluent Development with FLOW3 Inspiring people to share
  • 44. Progress Developing FLOW3 ... Fluent Development with FLOW3 Inspiring people to share
  • 45. Next Steps First FLOW3 alpha release end of this year First pilot projects based on FLOW3 in spring '09 Further development of the TYPO3 package Planned release of TYPO3 5.0 alpha: end of 2009 Fluent Development with FLOW3 Inspiring people to share
  • 46. Links These Slides http://flow3.typo3.org/documentation/slides/ FLOW3 Website http://flow3.typo3.org TYPO3 Forge http://forge.typo3.org Further Reading http://flow3.typo3.org/about/principles/further-reading/ Fluent Development with FLOW3 Inspiring people to share
  • 47. Questions Fluent Development with FLOW3 Inspiring people to share