Your SlideShare is downloading. ×
0
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

TYPO3 Flow and the Joy of Development (FOSDEM 2013)

26,962

Published on

Six years ago, the TYPO3 community was seeking for a framework as a foundation for their new CMS. There was none satisfying their wishlist of features and architecture and thus a new one was made - …

Six years ago, the TYPO3 community was seeking for a framework as a foundation for their new CMS. There was none satisfying their wishlist of features and architecture and thus a new one was made - top notch, built without the pressure of day to day work. In the meantime TYPO3 Flow has become one of the “serious” PHP frameworks which is built on two paradigms: harness the complexity of enterprise applications but at the same time be concise and developer friendly. Or in short: Flow brings back the joy of development in PHP.

This session introduces some of the main features of TYPO3 Flow 2.0 and gives you an idea about how it relates to the well established frameworks on the market.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
26,962
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
28
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. The Joy of Development
  • 2. project founder ofFlow and Neoscoach, coder, consultantLübeck, Germany1 wife, 2 daughters, TEXT HERE1 espresso machinelikes drumming
  • 3. 2005
  • 4. modelviewcontroller
  • 5. HTTP
  • 6. Network Working Group R. FieldingRequest for Comments: 2616 UC IrvineObsoletes: 2068 J. GettysCategory: Standards Track Compaq/W3C J. Mogul Compaq H. Frystyk W3C/MIT L. Masinter Xerox P. Leach Microsoft T. Berners-Lee W3C/MIT June 1999 Hypertext Transfer Protocol -- HTTP/1.1Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet
  • 7. HTTP/1.1 has been designed to allow implementations of applications /** that do not depend on knowledge of ranges. * Represents a HTTP request */4 HTTP Message class Request extends Message {4.1 Message Types /** * @var string HTTP messages consist of requests from client to server and responses */ from server to client. protected $method = GET; HTTP-message = Request | Response ; HTTP/1.1 messages /** * @var TYPO3FlowHttpUri Request (section 5) and Response (section 6) messages use the generic */ message format of RFC 822 [9] for transferring entities (the payload protected $uri; of the message). Both types of message consist of a start-line, zero or more header fields (also known as "headers"), an empty line (i.e., /** a line with nothing preceding the CRLF) indicating the end of the * @var TYPO3FlowHttpUri header fields, and possibly a message-body. */ protected $baseUri; generic-message = start-line *(message-header CRLF) /** CRLF * @var array [ message-body ] */ start-line = Request-Line | Status-Line protected $arguments;
  • 8. $request->getHeader(User-Agent); # C64$request->setHeader(X-Coffee, too few);
  • 9. $now = new DateTime();$response->setLastModified($now);
  • 10. $response->getHeaders() ->setCacheControlDirective(s-max-age, 100);
  • 11. # set cookie in response:$response->setCookie(new Cookie(counter, 1)); # on next request, retrieve cookie:$cookie = $request->getCookie(counter);
  • 12. $response = $browser->request(http://robertlemke.com/home);$content = $response->getContent();
  • 13. $request = Request::create($storageUri, PUT);$request->setContent(fopen(myfavoritemovie.m4v, rb));$request->setHeader(X-Category, Sissy);$reponse = $browser->sendRequest($request);
  • 14. Model
  • 15. Domain-Driven Design /** * A Book *A methodology which ... * @FlowScope(“prototy pe”) * @FlowEntity */• results in rich domain models class Book { /**• provides a common language across * @var string the project team */ protected $title;• simplify the design of complex /** * @var string applications */ protected $isbn; /**Flow is the first PHP framework tailored * @var string */to Domain-Driven Design protected $description ; /** * @var integer */ protected $price;
  • 16. /** * A Book * * @FlowEntity */class Book { /** * The title * @var string * @FlowValidate(type="StringLength", options={ "minimum"=1, */ protected $title; /** * The price * @var integer * @FlowValidate(type="NumberRange", options={ "minimum"=1, */ protected $price;
  • 17. /** * Get the Books title * * @return string The Books title */public function getTitle() { return $this->title;}/** * Sets this Books title * * @param string $title The Books title * @return void */public function setTitle($title) { $this->title = $title;}
  • 18. /** * A repository for Books * * @FlowScope("singleton") */class BookRepository extends Repository { public function findBestSellers() { ... }}
  • 19. # Add a book$bookRepository->add($book); # Remove a book$bookRepository->remove($book); # Update a book$bookRepository->update($book);
  • 20. # Find one specific book$book = $bookRepository->findOneByTitle(Lord of the Rings); # Find multiple books by property$books = $bookRepository->findByCategory(Fantasy); # Find books through custom find method$bestsellingBooks = $bookRepository->findBestSellers();
  • 21. TEXT HERE
  • 22. TEXT HERE
  • 23. Controller
  • 24. class HelloWorldController extends ActionController { /** * @return string */ public function greetAction() { return Hello World!; }}
  • 25. Hello World! TEXT HERE
  • 26. /** * An action which sends greetings to $name * * @param string $name The name to mention * @return string */public function greetAction($name) { return "Hello $name!";}
  • 27. dev.demo.local/acme.demo/helloworld/greet.html?name=Robert dev.demo.local/acme.demo/helloworld/greet.html?name=RobertHello Robert!
  • 28. View
  • 29. <html lang="en"> <head> <title>Templating</title> </head> <body> Our templating engine is called Fluid </body></html>
  • 30. /** * @param string $name * @return void */public function greetAction($name) { $this->view->assign(name, $name);}
  • 31. <html> <head> <title>Fluid Example</title> </head> <body> <p>Hello, {name}!</p> </body></html>
  • 32. /** * Displays a list of best selling books * * @return void */public function indexAction() { $books = $this->bookRepository->findBestSellers(); $this->view->assign(books, $books);}
  • 33. <ul> <f:for each="{books}" as="book"> <li>{book.title} by {book.author.name}</li> </f:for></ul>
  • 34. <html xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers">
  • 35. <f:form action="create" name="newBook"> <ol> <li> <label for="name">Name</label> <f:form.textfield property="name" id="name" /> </li> <li> <f:form.submit value="Create" /> </li> </ol></f:form>
  • 36. /** * Adds the given new book to the BookRepository * * @param AcmeDemoDomainModelBook $newBook * @return void */public function createAction(Book $newBook) { $this->bookRepository->add($newBook); $this->addFlashMessage(Created a new book.); $this->redirect(index);}
  • 37. Resources
  • 38. Static Resources
  • 39. Static Resources
  • 40. Static Resources
  • 41. Persistent Resources
  • 42. Persistent Resources
  • 43. Dependency Injection
  • 44. class SomeService { protected static $instance; public function getInstance() { if (self::$instance === NULL) { self::$instance = new self; } return self::$instance; }}class SomeOtherController { public function action() { $service = SomeService::getInstance(); … }}
  • 45. class ServiceLocator { protected static $services = array(); public function getInstance($name) { return self::$service[$name]; }}class SomeOtherController { public function action() { $service = ServiceLocate::getInstance("SomeService"); … }}
  • 46. Flows 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)
  • 47. class BookController extends ActionController { /** * @var BookRepository */ protected $bookRepository; /** * @param BookRepository $bookRepository */ public function __construct(BookRepository $bookRepository) { $this->bookRepository = $bookRepository; }}
  • 48. class BookController extends ActionController { /** * @var BookRepository */ protected $bookRepository; /** * @param BookRepository $bookRepository */ public function injectBookRepository(BookRepository$bookRepository) { $this->bookRepository = $bookRepository; }}
  • 49. class BookController extends ActionController { /** * @FlowInject * @var BookRepository */ protected $bookRepository;}
  • 50. Aspect-Oriented Programming
  • 51. /** * An action which sends greetings to $name * * @param string $name The name to mention * @return string */public function greetAction($name) { return "Hello $name!";}
  • 52. dev.demo.local/acme.demo/helloworld/greet.html?name=Robert dev.demo.local/acme.demo/helloworld/greet.html?name=RobertHello Robert!
  • 53. /** * @FlowAspect */class DemoAspect { /** * @param TYPO3FlowAopJoinPointInterface $joinPoint * @return void * @FlowAround("method(.*->greetAction())") */ public function demoAdvice(JoinPointInterface $joinPoint) { $name = $joinPoint->getMethodArgument(name); return sprintf(%s, you are running out of time!); }}
  • 54. dev.demo.local/acme.demo/helloworld/greet.html?name=Robert dev.demo.local/acme.demo/helloworld/greet.html?name=RobertRobert, you are running out of time!
  • 55. Security
  • 56. resources: methods: BookManagementMethods: method(.*Controller->(new|create|edit|update|delete)Action())roles: Customer: [] Administrator: []acls: Administrator: methods: BookManagementMethods: GRANT
  • 57. Access Denied (in Development context)
  • 58. Sessions
  • 59. /** * A Basket * * @FlowScope("session") */class Basket { /** * The books * @var array */ protected $books; /** * Adds a book to the basket * * @param RoeBooksShopDomainModelBasketook $book * @return void * @FlowSession(autoStart=true) */ public function addBook (Book $book) { $this->books[] = $book; }
  • 60. TEXT HERE
  • 61. TEXT HERE
  • 62. TEXT HERE
  • 63. Rossmann• second biggest drug store in Germany• 5,13 billion € turnover• 31,000 employeesCustomer Database
  • 64. Amadeus• world’s biggest e-ticket provider• 217 markets• 948 million billable transactions / year• 2,7 billion € revenueSocial Media Suite
  • 65. World of Textile• textile print and finishing• 30,000 articles / day• 180 employeesE-Commerce Platform
  • 66. 2.0
  • 67. neos.typo3.org
  • 68. ?
  • 69. Thank you!Flow flow.typo3.orgSlides slideshare.net/robertlemkeBlog robertlemke.comTwitter @robertlemkeGoogle+ plus.robertlemke.com

×