Download - T3DD09: Hitchhiker’s Guide to FLOW3

Transcript
Page 1: T3DD09: Hitchhiker’s Guide to FLOW3

T3DD09, Elmshorn, Germany

Hitchhiker's Guide to FLOW3

Mittwoch, 20. Mai 2009

Page 2: T3DD09: Hitchhiker’s Guide to FLOW3

The History of FLOW3(short version)

Mittwoch, 20. Mai 2009

Page 3: T3DD09: Hitchhiker’s Guide to FLOW3

Mittwoch, 20. Mai 2009

Page 4: T3DD09: Hitchhiker’s Guide to FLOW3

1998Mittwoch, 20. Mai 2009

Page 5: T3DD09: Hitchhiker’s Guide to FLOW3

33Mittwoch, 20. Mai 2009

Page 6: T3DD09: Hitchhiker’s Guide to FLOW3

500.000Mittwoch, 20. Mai 2009

Page 7: T3DD09: Hitchhiker’s Guide to FLOW3

300.000Mittwoch, 20. Mai 2009

Page 8: T3DD09: Hitchhiker’s Guide to FLOW3

Mittwoch, 20. Mai 2009

Page 9: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

The FLOW3 experienceFlow [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.

Mittwoch, 20. Mai 2009

Page 10: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

The FLOW3 experienceFlow [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.

["miha#j t$i#k"s%ntmiha#ji]

Mittwoch, 20. Mai 2009

Page 11: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

FLOW3 = Application FrameworkNot just a collection of components or code snippet library

Comes with ready-to-go default configuration

Package based

Tailored to Domain-Driven Design

Mittwoch, 20. Mai 2009

Page 12: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Get the FLOW experienceIntuitive APIs

Readable source code (like a book)

Consistent naming for classes, methods and properties

Focus on the essential, the framework takes care of the infrastructure

Mittwoch, 20. Mai 2009

Page 13: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

TYPO3 and FLOW3FLOW3 acts as a reliable basis for any kind of web application

TYPO3 v5 is a package based on FLOW3

TYPO3 extensions are packages as well, all based on FLOW3

Packages can be used

as extensions for TYPO3

as libraries for standalone applications

Mittwoch, 20. Mai 2009

Page 14: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

FLOW3 sub packagesAOP

Component

Configuration

Cache

Error

Locale

Log

Monitor

MVC

Object

Package

Persistence

Reflection

Resource

Session

SignalSlot

Validation

... and more

Mittwoch, 20. Mai 2009

Page 15: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Getting Started

Mittwoch, 20. Mai 2009

Page 16: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Getting Started

RequirementsSome webserver (tested with Apache and IIS)

PHP 5.3RC1 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)

Mittwoch, 20. Mai 2009

Page 17: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Getting Started

DownloadCurrently 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 as soon

FLOW3 1.0 alpha 1 release on June 1st

Mittwoch, 20. Mai 2009

Page 18: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Getting Started

Grant File PermissionsThe 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

Mittwoch, 20. Mai 2009

Page 19: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Model - View - Controller

Mittwoch, 20. Mai 2009

Page 20: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

The MVC Pattern

Modelan object which contains data and business logic of a certain domain

doesn't contain any information about the presentation of that data, but rather defines the behaviour

in the FLOW3 project we prefer a special kind of model, the Domain Model

Mittwoch, 20. Mai 2009

Page 21: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

The MVC Pattern

Viewrepresents the display of the model on the web or another output channel

views only display data, they don't build or modify it

Mittwoch, 20. Mai 2009

Page 22: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

The MVC Pattern

Controllerreacts on user input, selects and manipulates the model as accordingly

selects a view and passes it the prepared model for rendering

Mittwoch, 20. Mai 2009

Page 23: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Action ControllerAn action controller

accepts a request

evaluates arguments

calls the action defined in the request

and adds output to the response

MVC

Mittwoch, 20. Mai 2009

Page 24: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Action Controller: Important MethodsActions - methods just need an "Action" suffix:public function indexAction() { … }public function deleteAction() { … }

Initialization for the whole controller:public function initializeController() { … }

Initialization before any action is called:public function initializeAction() { … }public function initializeXYAction() { … }

MVC

Mittwoch, 20. Mai 2009

Page 25: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Action ArgumentsArguments are defined by declaring them in the action method

Argument data types are defined by type hint and documentation

MVC

/** * Action that displays one single post * * @param \F3\Blog\Domain\Model\Post $post The post to display * @return void * @author Robert Lemke <[email protected]> */ public function showAction(\F3\Blog\Domain\Model\Post $post) {

Mittwoch, 20. Mai 2009

Page 26: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

DEMO

Mittwoch, 20. Mai 2009

Page 27: T3DD09: Hitchhiker’s Guide to FLOW3

Mittwoch, 20. Mai 2009

Page 28: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Validation

Mittwoch, 20. Mai 2009

Page 29: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Validating ArgumentsAll arguments passed to an Action Controller are automatically validated

White List policy: Only registered arguments are available

Accessing the $_GET and $_POST super globals is dangerous, dirty, deprecated and will probably be intercepted in the future

Mittwoch, 20. Mai 2009

Page 30: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Validating ArgumentsFLOW3 comes with a bunch of built in validators:

AlphaNumeric, EmailAddress, Float, Integer, NotEmpty, Number, NumberRange, RegularExpression, UUID, Text

Custom validators can be created (especially for Domain Models)

All validators can be chained (and nested)

Mittwoch, 20. Mai 2009

Page 31: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

class Blog {

/** * The blog's name. Also acts as the identifier. * * @var string * @validate Alphanumeric, Length(minimum = 3, maximum = 50) * @identity */ protected $name = '';

/** * A short description of the blog * * @var string * @validate Text, Length(maximum = 150) */ protected $description = '';

Validation Rules DefinitionAll validation rules are defined by annotations in place

Additional rules may be defined programmatically

Mittwoch, 20. Mai 2009

Page 32: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

/** * Create action for this controller. * * @param string $emailAddress * @return string The rendered view * @author Robert Lemke <[email protected]> * @validate $emailAddress EmailAddress */ public function createAction($emailAddress) { }

Validation Rules Definition

Mittwoch, 20. Mai 2009

Page 33: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

DEMO

Mittwoch, 20. Mai 2009

Page 34: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Security

Mittwoch, 20. Mai 2009

Page 35: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Routing

Mittwoch, 20. Mai 2009

Page 36: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Caching

Mittwoch, 20. Mai 2009

Page 37: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareDevelopment with FLOW3

Progress

Developing TYPO3 5.0 ...

Mittwoch, 20. Mai 2009

Page 38: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

DEMO

Mittwoch, 20. Mai 2009

Page 39: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Playground

Mittwoch, 20. Mai 2009

Page 40: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Things to play with

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

Mittwoch, 20. Mai 2009

Page 41: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Things to play with

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

Mittwoch, 20. Mai 2009

Page 42: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Things to play with

TestrunnerExperiment with Test-Driven Development and watch the tests inFLOW3's test runner

Mittwoch, 20. Mai 2009

Page 43: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

LinksFLOW3 Websitehttp://flow3.typo3.org

TYPO3 Forgehttp://forge.typo3.org

Coding Guidelineshttp://flow3.typo3.org/documentation/coding-guidelines/

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

Mittwoch, 20. Mai 2009

Page 44: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

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

Beathttp://beat.typo3.org

Mittwoch, 20. Mai 2009

Page 45: T3DD09: Hitchhiker’s Guide to FLOW3

Inspiring people toshareHitchhiker's Guide to FLOW3

Questions

Mittwoch, 20. Mai 2009

Page 46: T3DD09: Hitchhiker’s Guide to FLOW3

Mittwoch, 20. Mai 2009

Page 47: T3DD09: Hitchhiker’s Guide to FLOW3

Mittwoch, 20. Mai 2009