Hidee guesss!                  T3CON09 – Big D, USASamstag, 18. April 2009
The History of FLOW3                                (short version)Samstag, 18. April 2009
The TYPO3 Family                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                       ...
Hitchhikers Guide to TYPO3 v5   Inspiring people to                                                 shareSamstag, 18. Apri...
TYPO3 and FLOW3                          FLOW3 acts as a reliable basis for any kind of web application                   ...
FLOW3 sub packages                          AOP             Log           Reflection                          Component    ...
Samstag, 18. April 2009
Samstag, 18. April 2009
The FLOW3 experience                     Flow [fl!] The mental state of operation in which the person is fully immersed in...
FLOW3 = Application Framework                          Not just a collection of components or code snippet library        ...
Get the FLOW experience                          Intuitive APIs                          Readable source code (like a book...
Getting Started                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                        ...
Getting Started                 Requirements                          Some webserver (tested with Apache and IIS)         ...
Getting Started                 Download                          Currently available through Subversion                  ...
Getting Started                 Grant File Permissions                          The webserver needs                       ...
DEMO                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                                 sh...
Model - View - Controller                Hitchhikers Guide to TYPO3 v5   Inspiring people to                              ...
The MVC Pattern                 Model                          an object which contains data and business logic of a      ...
The MVC Pattern                 View                          represents the display of the model on the web or another   ...
The MVC Pattern                 Controller                          reacts on user input, selects and manipulates the mode...
MVC                 Action Controller                          An action controller                            accepts a r...
MVC                 Action Controller: Important Methods                          Actions - methods just need an "Action" ...
MVC                 Action Arguments                          Arguments are defined by declaring them in the action method ...
DEMO                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                                 sh...
Samstag, 18. April 2009
Domain Driven Design                          A domain is the activity or business of the user                          Do...
Samstag, 18. April 2009
Domain Driven Design                 Ubiquitous language                          The common vocabulary is an important pr...
Domain Driven Design                 Phone Book Domain Model                Hitchhikers Guide to TYPO3 v5   Inspiring peop...
Domain Driven Design                 Phone Book Domain Model                Hitchhikers Guide to TYPO3 v5   Inspiring peop...
Domain Driven Design                 More phone book actions                          show phone book entries             ...
!                 Domain Driven Design                 More phone book actions                          show phone book en...
Domain Driven Design                 Layered Architecture                                         View                    ...
Domain Driven Design                 Layered Architecture                                         View                    ...
Validation                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                             ...
Validating Arguments                          All arguments passed to an Action Controller are automatically validated    ...
Validating Arguments                          FLOW3 comes with a bunch of built in validators:                            ...
Validation Rules Definition                          All validation rules are defined by annotations in place              ...
Validation Rules Definition                          /**                            * Create action for this controller.  ...
DEMO                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                                 sh...
Security                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                               ...
Objects                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                                ...
Objects                 Managed Objects                           The lifecycle of an object and the combination of active...
Objects                 Playing with building blocks                           The combination of objects used is configura...
Objects                 Class Dependencies                           Classes seldomly come alone                          ...
Objects                 Dependency Injection                           A class doesnt ask for the instance of another clas...
Objects                 Constructor without Dependency Injection                          /**                           * ...
Objects                 Class with Constructor Injection                          /**                           * @var F3M...
Objects                 Class with Setter Injection                          /**                           * @var F3MyPack...
Objects                 Class with Property Injection                          /**                           * @var F3MyPa...
Objects                 Autowiring                           FLOW3s framework tries to autowire constructor arguments,    ...
Objects                 Fetching components manually                           Although Dependency Injection is strongly r...
Objects                 Object Scope                           Objects always live in a certain scope                     ...
Objects                 Object Scope                           The scope can be defined through                            ...
Objects                 Creating Prototypes                           Dependency Injection can be used in almost any case,...
Objects                 Creating Prototypes                              Solution: Call the Object Factorys createObject()...
REST Services                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                          ...
Representational State Transfer                          Style of network architecture principles                         ...
RESTful Principles                          Resource-Oriented                          Uniform Interface                  ...
DEMO                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                                 sh...
Progress                             Developing TYPO3 5.0 ...                Development with FLOW3                  Inspi...
DEMO                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                                 sh...
Playground                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                             ...
Things to play with                 F3BLOG                          Try out the Blog Example:                          svn...
Things to play with                 TYPO3CR Admin                          Play with persistence and watch your object in ...
Things to play with                 Testrunner                          Experiment with Test-Driven Development and watch ...
Links                          FLOW3 Website                          http://flow3.typo3.org                          TYPO3...
Further Reading                 http://flow3.typo3.org/about/principles/further-reading/                 Beat             ...
Questions                Hitchhikers Guide to TYPO3 v5   Inspiring people to                                              ...
Samstag, 18. April 2009
Samstag, 18. April 2009
Upcoming SlideShare
Loading in …5
×

T3CON09 Dallas: Hitchhikersguide

1,038 views

Published on

The next major version of TYPO3 is slowly appearing at the horizon. Being in the works for two years now, the TYPO3 v5 core team mainly focused on the development of the foundation for the next generation CMS. As an offspring from the TYPO3 development, a completely new application framework has been developed. "FLOW3" has become a modern, powerful and sophisticated web application framework with many important features tailored for the next generation TYPO3 CMS and stand-alone enterprise applications.

In this session I’ll took the audience on a tour through TYPO3 v5 and FLOW3 how it’s today and give you an impression of how you’ll be able to use it in the near future.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,038
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

T3CON09 Dallas: Hitchhikersguide

  1. 1. Hidee guesss! T3CON09 – Big D, USASamstag, 18. April 2009
  2. 2. The History of FLOW3 (short version)Samstag, 18. April 2009
  3. 3. The TYPO3 Family Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  4. 4. Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  5. 5. TYPO3 and FLOW3 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 Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  6. 6. FLOW3 sub packages AOP Log Reflection Component Monitor Resource Configuration MVC Session Cache Object SignalSlot Error Package Validation Locale Persistence ... and more Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  7. 7. Samstag, 18. April 2009
  8. 8. Samstag, 18. April 2009
  9. 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. Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  10. 10. FLOW3 = Application Framework Not just a collection of components or code snippet library Comes with ready-to-go default configuration Package based Runs with PHP 5.3 or later Comes with a powerful JSR-283 based Content Repository Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  11. 11. Get the FLOW experience Intuitive 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 Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  12. 12. Getting Started Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  13. 13. Getting Started Requirements Some 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) Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  14. 14. 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 as soon as weve set up our release mechanism Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  15. 15. 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 Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  16. 16. DEMO Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  17. 17. Model - View - Controller Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  18. 18. The MVC Pattern Model an object which contains data and business logic of a certain domain doesnt 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 Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  19. 19. The MVC Pattern View represents the display of the model on the web or another output channel views only display data, they dont build or modify it Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  20. 20. The MVC Pattern Controller reacts on user input, selects and manipulates the model as accordingly selects a view and passes it the prepared model for rendering Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  21. 21. MVC Action Controller An action controller accepts a request evaluates arguments calls the action defined in the request and adds output to the response Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  22. 22. MVC Action Controller: Important Methods Actions - 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() { … } Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  23. 23. MVC Action Arguments Arguments are defined by declaring them in the action method Argument data types are defined by type hint and documentation /** * Action that displays one single post * * @param F3BlogDomainModelPost $post The post to display * @return void * @author Robert Lemke <robert@typo3.org> */ public function showAction(F3BlogDomainModelPost $post) { Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  24. 24. DEMO Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  25. 25. Samstag, 18. April 2009
  26. 26. Domain Driven Design A domain is the activity or business of the user Domain Driven Design is about focussing on the domain and domain logic accurately mapping the domain concepts to software forming a ubiquitous language among the project members Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  27. 27. Samstag, 18. April 2009
  28. 28. Domain Driven Design Ubiquitous language The common vocabulary is an important prerequisite for successful collaboration Use the same words for discussion, modeling, development and documentation Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  29. 29. Domain Driven Design Phone Book Domain Model Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  30. 30. Domain Driven Design Phone Book Domain Model Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  31. 31. Domain Driven Design More phone book actions show phone book entries check if user may delete phone book entry export phone book entries log phone book actions Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  32. 32. ! Domain Driven Design More phone book actions show phone book entries notentryn check if user may delete phone book i the export phone book entries of a p domain hone b log phone book actions ook Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  33. 33. Domain Driven Design Layered Architecture View Presentation Controller Application Logic (Service Layer) Domain Domain Model (Domain Layer) Data Mapper (part of Content Repository) Data source Data Source Abstraction Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  34. 34. Domain Driven Design Layered Architecture View Presentation Controller Application Logic (Service Layer) Domain Domain Model (Domain Layer) Data Mapper (part of Content Repository) Data source Data Source Abstraction Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  35. 35. Validation Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  36. 36. Validating Arguments All 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 Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  37. 37. Validating Arguments FLOW3 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) Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  38. 38. Validation Rules Definition All validation rules are defined by annotations in place Additional rules may be defined programmatically class Blog { /** * The blogs 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) Hitchhikers Guide to TYPO3 v5 */ Inspiring people to protected $description = ; shareSamstag, 18. April 2009
  39. 39. Validation Rules Definition /** * Create action for this controller. * * @param string $emailAddress * @return string The rendered view * @author Robert Lemke <robert@typo3.org> * @validate $emailAddress EmailAddress */ public function createAction($emailAddress) { } Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  40. 40. DEMO Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  41. 41. Security Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  42. 42. Objects Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  43. 43. Objects Managed Objects The lifecycle of an object and the combination of active objects is managed by the Object Manager The behavior of objects in FLOW3 is configurable Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  44. 44. Objects Playing with building blocks The combination of objects used is configurable (orchestration) The less classes know about each other the easier it is to reuse them in a variety of contexts Create your own LEGO set by creating cleanly separated, decoupled classes! Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  45. 45. Objects Class Dependencies Classes seldomly come alone Classes depend on other classes which depend on other classes which ... Problem: Classes explicitly refer to other classes: $phoneBookManager = new PhoneBookManager Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  46. 46. Objects Dependency Injection A class doesnt ask for the instance of another class but gets it injected This methodology is referred to as the "Hollywood Principle": "Dont call us, well call you" Enforces loose coupling and high cohesion Makes you a better programmer Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  47. 47. Objects Constructor without Dependency Injection /** * @var F3MyPackageModelCustomerRepository */ protected $customerRepository; /** * Constructor * * @author Robert Lemke <robert@typo3.org> */ public function __construct() { $this->customerRepository = F3MyPackageModelCustomerRepository::getInstance(); } Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  48. 48. Objects Class with Constructor Injection /** * @var F3MyPackageModelCustomerRepository */ protected $customerRepository; /** * Constructor * * @author Robert Lemke <robert@typo3.org> */ public function __construct(F3MyPackageModelCustomerRepository $customerRepository) { $this->customerRepository = $customerRepository; } Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  49. 49. Objects Class with Setter Injection /** * @var F3MyPackageModelCustomerRepository */ protected $customerRepository; /** * Injects the customer repository * * @author Robert Lemke <robert@typo3.org> */ public function injectCustomerRepository(F3MyPackageModelCustomerRepository $customerRepository) { $this->customerRepository = $customerRepository; } Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  50. 50. Objects Class with Property Injection /** * @var F3MyPackageModelCustomerRepository * @inject */ protected $customerRepository; Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  51. 51. Objects Autowiring FLOW3s framework tries to autowire constructor arguments, arguments of inject* methods and annotated properties 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 Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  52. 52. Objects Fetching components manually Although Dependency Injection is strongly recommended, there might be cases in which objects need to be created or retrieved manually Use the getComponent() method in these cases. $component = $componentManager->getComponent($componentName, $arg1, $arg2, ...); Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  53. 53. Objects Object Scope Objects always live in a certain scope Currently supported scopes are: Singleton - Only one instance exists during one script run Prototype - Multiple instances exist Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  54. 54. Objects Object Scope The scope can be defined through a @scope annotation in the class (recommended) through the object configuration in a Objects.yaml file The default scope is "Singleton" Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  55. 55. Objects Creating Prototypes Dependency Injection can be used in almost any case, theres no need to call getObject() But what if you need to instantiate a class within a method? Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  56. 56. Objects Creating Prototypes Solution: Call the Object Factorys createObject() method /** * Create action for this controller. * * @param string $emailAddress * @return string The rendered view * @author Robert Lemke <robert@typo3.org> * @validate $emailAddress EmailAddress */ public function createAction($emailAddress) { $customer = $this->objectFactory->create(F3DemoCustomer, $emailAddress); $this->customerRepository->add($customer); } Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  57. 57. REST Services Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  58. 58. Representational State Transfer Style of network architecture principles Mostly for building web services Introduced in 2000 by Roy Fielding Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  59. 59. RESTful Principles Resource-Oriented Uniform Interface Stateless Accessible through a uniform interface Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  60. 60. DEMO Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  61. 61. Progress Developing TYPO3 5.0 ... Development with FLOW3 Inspiring people to shareSamstag, 18. April 2009
  62. 62. DEMO Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  63. 63. Playground Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  64. 64. Things to play with F3BLOG Try out the Blog Example: svn co https://svn.typo3.org/FLOW3/Distribution/branches/BlogExample/ Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  65. 65. Things to play with TYPO3CR Admin Play with persistence and watch your object in the TYPO3CR Admin Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  66. 66. Things to play with Testrunner Experiment with Test-Driven Development and watch the tests in FLOW3s test runner Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  67. 67. Links FLOW3 Website http://flow3.typo3.org TYPO3 Forge http://forge.typo3.org Coding Guidelines http://flow3.typo3.org/documentation/coding-guidelines/ Further Reading http://flow3.typo3.org/about/principles/further-reading/ Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  68. 68. Further Reading http://flow3.typo3.org/about/principles/further-reading/ Beat http://beat.typo3.org Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  69. 69. Questions Hitchhikers Guide to TYPO3 v5 Inspiring people to shareSamstag, 18. April 2009
  70. 70. Samstag, 18. April 2009
  71. 71. Samstag, 18. April 2009

×