ipcse12: hands on flow3

63
Robert Lemke Hands on FLOW3

Upload: robert-lemke

Post on 19-May-2015

939 views

Category:

Technology


1 download

DESCRIPTION

The FLOW3 framework got a lot of attention when version 1.0 was released after years of development. Its main approach is to deliver a whole-in-one concept for modern programming techniques and guiding developers to write excellent code. This session takes you on a tour through FLOW3's key features by demonstrating the making of a real application.

TRANSCRIPT

Page 1: IPCSE12: Hands on FLOW3

Robert Lemke

Hands on FLOW3

Page 2: IPCSE12: Hands on FLOW3

project founder of FLOW3 and TYPO3 “Phoenix”

co-founder of the TYPO3 Association

coach, coder, consultant

36 years old

lives in Lübeck, Germany

1 wife, 2 daughters, 1 espresso machine

likes drumming

Robert Lemke

Page 3: IPCSE12: Hands on FLOW3

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 4: IPCSE12: Hands on FLOW3

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 5: IPCSE12: Hands on FLOW3

TEXT HERE

Page 6: IPCSE12: Hands on FLOW3

1. Command Line

Page 7: IPCSE12: Hands on FLOW3
Page 8: IPCSE12: Hands on FLOW3

TEXT HERE

Page 9: IPCSE12: Hands on FLOW3
Page 10: IPCSE12: Hands on FLOW3
Page 11: IPCSE12: Hands on FLOW3

2. Action Controller

Page 12: IPCSE12: Hands on FLOW3
Page 13: IPCSE12: Hands on FLOW3

3. Templating

Page 14: IPCSE12: Hands on FLOW3
Page 15: IPCSE12: Hands on FLOW3

TEXT HERE

Page 16: IPCSE12: Hands on FLOW3

4. Models

Page 17: IPCSE12: Hands on FLOW3
Page 18: IPCSE12: Hands on FLOW3

TEXT HERE

Page 19: IPCSE12: Hands on FLOW3

TEXT HERE

Page 20: IPCSE12: Hands on FLOW3

TEXT HERE

Page 21: IPCSE12: Hands on FLOW3

TEXT HERE

Page 22: IPCSE12: Hands on FLOW3

5. Persistence

Page 23: IPCSE12: Hands on FLOW3

TEXT HERE

Page 24: IPCSE12: Hands on FLOW3

TEXT HERE

Page 25: IPCSE12: Hands on FLOW3

TEXT HERE

Page 26: IPCSE12: Hands on FLOW3

TEXT HERE

Page 27: IPCSE12: Hands on FLOW3

TEXT HERE

Page 28: IPCSE12: Hands on FLOW3

TEXT HERE

Page 29: IPCSE12: Hands on FLOW3

6. Domain-Driven Design

Page 30: IPCSE12: Hands on FLOW3

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: IPCSE12: Hands on FLOW3
Page 32: IPCSE12: Hands on FLOW3

Domain-Driven Design

Page 33: IPCSE12: Hands on FLOW3

7. Resources

Page 34: IPCSE12: Hands on FLOW3

TEXT HERE

Page 35: IPCSE12: Hands on FLOW3

TEXT HERE

Page 36: IPCSE12: Hands on FLOW3

TEXT HERE

Page 37: IPCSE12: Hands on FLOW3

TEXT HERE

Page 38: IPCSE12: Hands on FLOW3

TEXT HERE

Page 39: IPCSE12: Hands on FLOW3

7. Dependency Injection

Page 40: IPCSE12: Hands on FLOW3

TEXT HERE

Page 41: IPCSE12: Hands on FLOW3

TEXT HERE

Page 42: IPCSE12: Hands on FLOW3

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 gatered automatically (autowiring)

• intuitive use and no bad magical surprises

• fast! (like hardcoded or faster)

Page 43: IPCSE12: Hands on FLOW3

namespace Acme\Demo\Controller;

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

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

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

Constructor Injection

Page 44: IPCSE12: Hands on FLOW3

namespace Acme\Demo\Controller;

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

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

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

Setter Injection

Page 45: IPCSE12: Hands on FLOW3

namespace TYPO3\Demo\Controller;

use TYPO3\FLOW3\Annotations as FLOW3;use TYPO3\FLOW3\MVC\Controller\ActionController;use Acme\Demo\Service\GreeterService;

class DemoController extends ActionController { /** * @var \TYPO3\Demo\Service\GreeterService * @FLOW3\Inject */ protected $greeterService; /** * @param string $name */ public function helloAction($name) { return $this->greeterService->greet($name); }}

Property Injection

Page 46: IPCSE12: Hands on FLOW3

TEXT HERE

Page 47: IPCSE12: Hands on FLOW3

8. Sessions

Page 48: IPCSE12: Hands on FLOW3

TEXT HERE

Page 49: IPCSE12: Hands on FLOW3

TEXT HERE

Page 50: IPCSE12: Hands on FLOW3

TEXT HERE

Page 51: IPCSE12: Hands on FLOW3

TEXT HERE

Page 52: IPCSE12: Hands on FLOW3

9. Security

Page 53: IPCSE12: Hands on FLOW3
Page 54: IPCSE12: Hands on FLOW3

TEXT HERE

Page 55: IPCSE12: Hands on FLOW3
Page 56: IPCSE12: Hands on FLOW3

TEXT HERE

Page 57: IPCSE12: Hands on FLOW3
Page 58: IPCSE12: Hands on FLOW3

Rossmann

• second biggest drug store in Germany

• 5,13 billion ! turnover

• 31,000 employees

Customer Database

Page 59: IPCSE12: Hands on FLOW3

Amadeus

• world’s biggest e-ticket provider

• 217 markets

• 948 million billable transactions / year

• 2,7 billion ! revenue

Social Media Suite

Page 60: IPCSE12: Hands on FLOW3

World of Textile

• textile print and finishing

• 30,000 articles / day

• 180 employees

E-Commerce Platform

Page 61: IPCSE12: Hands on FLOW3

FLOW3 1.0 FLOW3 1.1transactions / second 27 71

longest transaction 1.06 0.38

shortest transaction 0.19 0.08

memory peak 19,8 MB 5,1 MB

Project X

Page 62: IPCSE12: Hands on FLOW3

?