2012 08-11-flow3-northeast-php

71
Get into the flow with FLOW3 Jochen Rau Demo App: https://github.com/jocrau/RoeBooks.Shop

Upload: jochen-rau

Post on 19-May-2015

1.653 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: 2012 08-11-flow3-northeast-php

Get into

the flow

with FLOW3

Jochen Rau

Demo App: https://github.com/jocrau/RoeBooks.Shop

Page 2: 2012 08-11-flow3-northeast-php

Stuttgart

Who is this?

Page 3: 2012 08-11-flow3-northeast-php

Hatfield

Who is this?

Page 4: 2012 08-11-flow3-northeast-php

Researcher & Project ManagerFraunhofer-GesellschaftGerman Aerospace Center

Who is this?

Page 5: 2012 08-11-flow3-northeast-php

High School TeacherMathematics and Physics

Who is this?

Page 6: 2012 08-11-flow3-northeast-php

Infected withTYPO3 and FLOW3

in 2OO6

Who is this?

Page 7: 2012 08-11-flow3-northeast-php

Infected withTYPO3 and FLOW3

in 2OO6

Who is this?

Page 8: 2012 08-11-flow3-northeast-php

ConsultantSoftware EngineerInfinite Cloud LLC

Who is this?

Page 9: 2012 08-11-flow3-northeast-php

project founderFLOW3 and TYPO3 “Phoenix”

co-founder TYPO3 Association

coach, coder, consultant

36 years old

lives in Lübeck, Germany

credits to him for most of the slides

Robert Lemke

Page 10: 2012 08-11-flow3-northeast-php

At a Glance

FLOW3 is a web application platform

• holistic concept for your apps

• modular, extensible, package based

• pedantically clean with focus on quality

• puts a smile on developer’s faces

• free & Open Source (LGPL v3)

• backed by one of the largest Open Source projects

Page 11: 2012 08-11-flow3-northeast-php

Foundation for the Next Generation CMS

TYPO3 “Phoenix” is the all-new Enterprise CMS

• content repository, workspaces, versions, i18n, modular UI ...

• powered by FLOW3

• compatible code base

• use TYPO3 features in FLOW3 standalone apps as you like

Page 12: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 13: 2012 08-11-flow3-northeast-php

1. Kickstart

Page 14: 2012 08-11-flow3-northeast-php
Page 15: 2012 08-11-flow3-northeast-php
Page 16: 2012 08-11-flow3-northeast-php
Page 17: 2012 08-11-flow3-northeast-php
Page 18: 2012 08-11-flow3-northeast-php

2. Action Controller

Page 19: 2012 08-11-flow3-northeast-php

Controller

Repository View

Request

findByTitle('FLOW3')

Response

$book

assign('book', $book)

Response

Domain Model

render()

1

2

3

4

Book

Category Author

RoeBooks

Model-View-Controller

Page 20: 2012 08-11-flow3-northeast-php
Page 21: 2012 08-11-flow3-northeast-php

3. Templating

Page 22: 2012 08-11-flow3-northeast-php
Page 23: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 24: 2012 08-11-flow3-northeast-php

4. Models

Page 25: 2012 08-11-flow3-northeast-php
Page 26: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 27: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 28: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 29: 2012 08-11-flow3-northeast-php

5. Domain-Driven Design

Page 30: 2012 08-11-flow3-northeast-php

Tackling the Heart of Software Development

Domain-Driven DesignA methodology which ...

• results in rich domain models

• provides a common language across the project team

• simplify the design of complex applications

FLOW3 is the first PHP framework tailored to Domain-Driven Design

/** * A Book * * @FLOW3\Scope(“prototype”) * @FLOW3\Entity */class Book {

/** * @var string */ protected $title;

/** * @var string */ protected $isbn;

/** * @var string */ protected $description;

/** * @var integer */ protected $price;

/** * @var \SplObjectStorage */ protected $materials;

/** * @var \Acme\Conference\Domain\Model\SessionType * @validate NotEmpty */ protected $proposedSessionType;

/** * Constructs a new Paper * * @author Robert Lemke <[email protected]> */ public function __construct() { $this->materials = new \SplObjectStorage; }

/** * Sets the author of this paper * * @param \Acme\Conference\Domain\Model\Participant $author * @return void * @author Robert Lemke <[email protected]> */ public function setAuthor(\Acme\Conference\Domain\Model\Participant $author) { $this->author = $author; }

/** * Getter for the author of this paper * * @return \Acme\Conference\Domain\Model\Participant * @author Robert Lemke <[email protected]> */ public function getAuthor() { return $this->author; }

/** * Setter for title * * @param string $title The title of this paper * @return void * @author Robert Lemke <[email protected]> */ public function setTitle($title) { $this->title = $title; }

/** * Getter for title * * @return string The title of this paper * @author Robert Lemke <[email protected]> */ public function getTitle() { return $this->title; }

/** * Setter for the short abstract * * @param string $shortAbstract The short abstract for this paper * @return void * @author Robert Lemke <[email protected]> */ public function setShortAbstract($shortAbstract) { $this->shortAbstract = $shortAbstract; }

/** * Getter for the short abstract * * @return string The short abstract * @author Robert Lemke <[email protected]> */ public function getShortAbstract() { return $this->shortAbstract; }

/** * Setter for abstract * * @param string $abstract The abstract of this paper * @return void * @author Robert Lemke <[email protected]> */ public function setAbstract($abstract) { $this->abstract = $abstract; }

/** * Getter for abstract * * @return string The abstract * @author Robert Lemke <[email protected]> */ public function getAbstract() { return $this->abstract; }

/** * Returns the materials attached to this paper * * @return \SplObjectStorage The materials * @author Robert Lemke <[email protected]> */ public function getMaterials() { return $this->materials; }

/** * Setter for the proposed session type * * @param \Acme\Conference\Domain\Model\SessionType $proposedSessionType The proposed session type * @return void * @author Robert Lemke <[email protected]> */ public function setProposedSessionType(\Acme\Conference\Domain\Model\SessionType $proposedSessionType) { $this->proposedSessionType = $proposedSessionType; }

/** * Getter for the proposed session type * * @return \Acme\Conference\Domain\Model\SessionType The proposed session type * @author Robert Lemke <[email protected]> */ public function getProposedSessionType() { return $this->proposedSessionType; }}?>

Page 31: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 32: 2012 08-11-flow3-northeast-php

6. Persistence

Page 33: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 34: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 35: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 36: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 37: 2012 08-11-flow3-northeast-php
Page 38: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 39: 2012 08-11-flow3-northeast-php

7. Resources

Page 40: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 41: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 42: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 43: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 44: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 45: 2012 08-11-flow3-northeast-php

8. Dependency Injection

Page 46: 2012 08-11-flow3-northeast-php

namespace Acme\Demo\Controller;

use TYPO3\FLOW3\Mvc\Controller\ActionController;use Acme\Demo\Service\GreeterService;

class DemoController extends ActionController { /** * @var \Acme\Demo\Service\GreeterServiceInterface * */ protected $greeterService;

/** * */ public function __construct() { $this->greeterService = new \Acme\Demo\Service\GreeterService(); } /** * @param string $name */ public function helloAction($name) { return $this->greeterService->greet($name); }

Without Dependency Injection

Page 47: 2012 08-11-flow3-northeast-php

namespace Acme\Demo\Controller;

use TYPO3\FLOW3\Mvc\Controller\ActionController;use Acme\Demo\Service\GreeterService;

class DemoController extends ActionController { /** * @var \Acme\Demo\Service\GreeterServiceInterface * */ protected $greeterService;

/** * @param \Acme\Demo\Service\GreeterServiceInterface */ public function __construct(GreeterServiceInterface $greeterService) { $this->greeterService = $greeterService; } /** * @param string $name */ public function helloAction($name) { return $this->greeterService->greet($name); }

Constructor Injection

Page 48: 2012 08-11-flow3-northeast-php

namespace Acme\Demo\Controller;

use TYPO3\FLOW3\Mvc\Controller\ActionController;use Acme\Demo\Service\GreeterService;

class DemoController extends ActionController { /** * @var \Acme\Demo\Service\GreeterServiceInterface * */ protected $greeterService;

/** * @param \Acme\Demo\Service\GreeterServiceInterface */ public function injectGreeterService(GreeterServiceInterface $greeterService) { $this->greeterService = $greeterService; } /** * @param string $name */ public function helloAction($name) { return $this->greeterService->greet($name); }

Setter Injection

Page 49: 2012 08-11-flow3-northeast-php

namespace Acme\Demo\Controller;

use TYPO3\FLOW3\Annotations as FLOW3;use TYPO3\FLOW3\Mvc\Controller\ActionController;

class DemoController extends ActionController { /** * @var \Acme\Demo\Service\GreeterServiceInterface * @FLOW3\Inject */ protected $greeterService;

/** * @param string $name */ public function helloAction($name) { return $this->greeterService->greet($name); }

Property Injection

Page 50: 2012 08-11-flow3-northeast-php

Object Management

FLOW3's take on Dependency Injection

• one of the first PHP implementations(started in 2006, improved ever since)

• object management for the whole lifecycle of all objects

• no unnecessary configuration if information can be gathered automatically (autowiring)

• intuitive use and no bad magical surprises

• fast! (like hardcoded or faster)

Page 51: 2012 08-11-flow3-northeast-php

9. Sessions

Page 52: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 53: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 54: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 55: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 56: 2012 08-11-flow3-northeast-php

10. Security

Page 57: 2012 08-11-flow3-northeast-php
Page 58: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 59: 2012 08-11-flow3-northeast-php
Page 60: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 61: 2012 08-11-flow3-northeast-php

11. Aspect-OrientedProgramming

Page 62: 2012 08-11-flow3-northeast-php
Page 63: 2012 08-11-flow3-northeast-php
Page 64: 2012 08-11-flow3-northeast-php
Page 65: 2012 08-11-flow3-northeast-php
Page 66: 2012 08-11-flow3-northeast-php

12. In the wild

Page 67: 2012 08-11-flow3-northeast-php

Rossmann

• second biggest drug store in Germany

• 5.13 billion ! turnover

• 31000 employees

Customer Database

Page 68: 2012 08-11-flow3-northeast-php

Amadeus

• world’s biggest e-ticket provider

• 217 markets

• 948 million billable transactions / year

• 2.7 billion ! revenue

Social Media Suite

Page 69: 2012 08-11-flow3-northeast-php

TEXT HERE

Page 70: 2012 08-11-flow3-northeast-php
Page 71: 2012 08-11-flow3-northeast-php

Thanks for having me!

Slides: http://slideshare.net/jocrau

Examples: https://github.com/jocrau/RoeBooks.Shop

Blog: http://typoplanet.com

Twitter: @jocrau @flow3

Feedback: [email protected] https://joind.in/6815

FLOW3: http://flow3.typo3.org