Development with TYPO3 5.0

1,411 views

Published on

This session from the TYPO3 Conference 2007 gives you a peek into the current development state of the TYPO3 Framework and its main features such as Aspect Oriented Programming, Dependency Injection and the Model View Controller Framework. Bottom line of all development with 5.0 is: Domain Driven Design.

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

  • Be the first to like this

No Downloads
Views
Total views
1,411
On SlideShare
0
From Embeds
0
Number of Embeds
102
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Development with TYPO3 5.0

  1. 1. Development with TYPO3 5.0T3CON07 – Karlsruhe, Germany
  2. 2. Brought your own towel?„ A towel is about the most useful thing an interstellar hitch hiker can carry. ” Douglas Adams Inspiring people to share
  3. 3. Brought your own code?„ The TYPO3 Framework is about the most useful thing a PHP developer can use. ” Robert Lemke Inspiring people to share
  4. 4. TopictextThe Guide One manual for all available at http://5-0.dev.typo3.org Inspiring people to share
  5. 5. Overview What happened so far ... System overview Domain Driven Design Model View Controller Voodoo Got Arguments? Components: playing LEGO™ The aspect of security Future and other timing issues Inspiring people to share
  6. 6. What happened so far Inspiring people to share
  7. 7. What happened so farBuy none get two for free. CMS k 1.0 5.0 ewor Fram Inspiring people to share
  8. 8. What happened so farThe results so far General design decisions, directory layout, coding guidelines TYPO3 Framework consisting of: Component Manager (supports Dependency Injection) AOP Framework Package Manager (basic functionality) MVC Framework (alpha ...) Property Editor / Validation / Data Types (early dev phase) Inspiring people to share
  9. 9. What happened so farThe results even so farer Testing package (contains a PHPUnit testrunner) TYPO3 CR dropped Java implementation – started PHP implementation support JSR-283 instead of JSR-170 Storing and Retrieving nodes works Inspiring people to share
  10. 10. What happened so farThe results finally TypoScript package improved and enhanced syntax: TypoScript 2.0 fully object oriented and consistent self-documenting contains a working TS parser CMS package contains a few TS objects and stdWrap ports (processors) Inspiring people to share
  11. 11. Read before first useSystem Overview Inspiring people to share
  12. 12. System OverviewInstallation You need PHP6 You dont need Java Current installation options: svn checkout http://5-0.dev.typo3.org/svn/TYPO3/ download the TYPO3 installer Inspiring people to share
  13. 13. System Overview: InstallationInstalling PHP6 Inspiring people to share
  14. 14. System Overview: InstallationInstalling TYPO3 Inspiring people to share
  15. 15. System Overview: InstallationFile structure Inspiring people to share
  16. 16. System Overview: InstallationFile structure Inspiring people to share
  17. 17. System OverviewComponents Components are re-usable, properly encapsulated objects The lifecycle of a component and the combination of active components is managed by the Component Manager All classes in the TYPO3 context are considered as components Components are configurable Inspiring people to share
  18. 18. System Overview: ComponentsClass ≙ Component Classes are automatically registered as components if they reside in the Classes directory of a package and their name follows the TYPO3 naming conventions Inspiring people to share
  19. 19. System Overview: ComponentsExample Inspiring people to share
  20. 20. System OverviewPackage Manager Like the good old Extension Manager - but without UI yet Scans the Packages directory for packages Registers classes as components and partly configures them Will connect to T3PR (TYPO3 Package Repository) Package file format is just plain .zip Will provide access via Web / CLI and offer Web Services Inspiring people to share
  21. 21. System OverviewModel View Controller yes, has it – but what flavor? index.php contains a tiny bootstrap the Framework package handles requests, provides a Front Controller and a Dispatcher which dispatches requests to the Action Controllers more about that later Inspiring people to share
  22. 22. System Overview: Model View Controllerindex.php Inspiring people to share
  23. 23. 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 Inspiring people to share
  24. 24. Tower of Babel
  25. 25. Domain Driven DesignUbiquitous language The common vocabulary is an important prerequisite for successful collaboration Use the same words for discussion, modeling, development and documentation Inspiring people to share
  26. 26. Domain Driven DesignPhone Book Domain Model Inspiring people to share
  27. 27. Domain Driven DesignPhone Book Domain Model Inspiring people to share
  28. 28. Domain Driven DesignMore phone book actions show phone book entries check if user may delete phone book entry export phone book entries log phone book actions Inspiring people to share
  29. 29. ✘Domain Driven DesignMore phone book actions show phone book entries not in domain check if user may delete phone book entry the export phone book entries of a phone log phone book actions book Inspiring people to share
  30. 30. Domain Driven DesignLayered Architecture View Presentation Controller Application Logic (Service Layer) Domain Domain Model (Domain Layer) Data Mapper (part of Content Repository) Data source Data Source Abstraction Inspiring people to share
  31. 31. Domain Driven DesignLayered Architecture View Presentation Controller Application Logic (Service Layer) Domain Domain Model (Domain Layer) Data Mapper (part of Content Repository) Data source Data Source Abstraction Inspiring people to share
  32. 32. Creating a new package
  33. 33. Domain Driven DesignPhoneBook DEMO Inspiring people to share
  34. 34. Domain Driven DesignPhoneBookEntries DEMO Inspiring people to share
  35. 35. Model View Controller VoodooBasic recipe Domain Model our phone book – contains the data and knows everything about the domain Action Controller can handle requests for taking actions - show the phone book entries, create new ones etc. View Render the requested output by using the model Inspiring people to share
  36. 36. Model View Controller VoodooPhone Book Action Controller DEMO Inspiring people to share
  37. 37. Model View Controller VoodooSimple Phone Book View DEMO Inspiring people to share
  38. 38. Model View Controller VoodooTemplate View Inspiring people to share
  39. 39. Model View Controller VoodooTemplate View Inspiring people to share
  40. 40. Model View Controller VoodooTemplate View DEMO Inspiring people to share
  41. 41. Model View Controller VoodooFlexible recipe Domain Model our phone book – contains the data and knows everything about the domain Action Controller can handle requests for taking actions - show the phone book entries, create new ones etc. Views / Widgets Render the requested output by using the model Inspiring people to share
  42. 42. Model View Controller VoodooWidgets In TYPO3 a Widget is a reusable composite of a Presentation Model (Model) a Widget View (View) a Presentation Controller (Presenter) Widgets serve as re-usable design elements and as part of the user interface Inspiring people to share
  43. 43. Model View Controller VoodooWidgets The advantages of widgets: Consistent look and feel for standard presentation elements (tables, lists, forms, texts, images, ...) Centralized templating, can be overridden for special cases Automatic support for different request / response types so easy! Inspiring people to share
  44. 44. Model View Controller VoodooPresentation Controller Action Controller Presentation Controller is configured with a Presentation Model, receives a request, takes the required prepares the presentation and returns actions and prepares a response the rendered result can handle (web- / CLI- / ...) requests can render the widget handleRequest($request, $response) render() Inspiring people to share
  45. 45. Model View Controller VoodooRequest / Response Request Handler Web Request Web Request Web Request Resolver Handler Builder Inspiring people to share
  46. 46. Model View Controller VoodooWidget-based Action Controller Implement the widget based Action Controller Inspiring people to share
  47. 47. Model View Controller VoodooWidget-based Action Controller Show that widget also renders at command line Inspiring people to share
  48. 48. Got arguments? GET and POST arguments are the No.1 source for XSS and injection attacks TYPO3 5.0 takes special care of all user input and HTML output Data Types and Property Editors are used for type conversion at defined stages Controllers only get access to arguments they registered on beforehand Inspiring people to share
  49. 49. Got arguments?Properties & Data Types Work in progress (still hot) We use Property objects instead of string, integer etc. in certain areas Property objects can be combined (XHTML object + Text object + ....) "Property editors" are used to transform properties depending on the context Inspiring people to share
  50. 50. Got arguments?Validation A concept for validation is in place but not fully implemented yet We work with "Data Binding" More details ... this winter. Inspiring people to share
  51. 51. Got arguments?Registering arguments Practical example how to register POST arguments. Inspiring people to share
  52. 52. Components Inspiring people to share
  53. 53. ComponentsPlaying with building blocks The combination of components used is configurable (orchestration) The less components 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 components! Inspiring people to share
  54. 54. ComponentsComponent Dependencies Components seldomly come alone Components depend on other components which depend on other components which ... Inspiring people to share
  55. 55. ComponentsComponent Dependencies Components seldomly come alone Components depend on other components which depend on other components which ... Problem: Components explicitly refer to other components: $phoneBookManager = new PhoneBookManager Inspiring people to share
  56. 56. ComponentsDependency Injection A component doesnt ask for the instance of another component 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 Inspiring people to share
  57. 57. ComponentsPractical examples for DI Example using ... Constructor Injection Setter Injection Autowiring Inspiring people to share
  58. 58. Aspect Oriented Programming AOP is a programming paradigm complements OOP by separating concerns to improve modularization OOP modularizes concerns: methods, classes, packages AOP addresses cross-cutting concerns Inspiring people to share
  59. 59. Aspect Oriented ProgrammingCross-cutting concerns Presentation Domain Data source Inspiring people to share
  60. 60. Aspect Oriented ProgrammingCross-cutting concerns Presentation The concerns live here Domain Data source Inspiring people to share
  61. 61. Aspect Oriented ProgrammingCross-cutting concerns Phone Book Domain Model Security Logging Inspiring people to share
  62. 62. Aspect Oriented ProgrammingAspects in action Practical example Inspiring people to share
  63. 63. Beautiful errors Exception handling and error handling is (basically) implemented Special AOP-supported tools for debugging will be available Verbose debug messages and exception handlers Inspiring people to share
  64. 64. Topictext Inspiring people to share
  65. 65. Future and other timing issues Well switch from a road map to a country map Next steps are: Finish MVC implementation Properties, Data Types, Validation, Data Binding Implement Widgets, GUI and an initial Backend package Continue developing TYPO3 CR Inspiring people to share
  66. 66. For Patrick GaumondFuture and other timing issues Speeeed will be implemented as well Inspiring people to share
  67. 67. Recommended literature Inspiring people to share
  68. 68. Recommended literature Eric Evans: Domain Driven Design Tackling Complexity in the Heart of Software Addison Wesley 2002 Inspiring people to share
  69. 69. Recommended literature Martin Fowler: Patterns of Enterprise Application Architecture Addison Wesley 2002 Inspiring people to share
  70. 70. Recommended literature Jimmy Nilsson: Applying Domain-Driven Design and Patterns Addison Wesley 2006 Inspiring people to share
  71. 71. Links TYPO3 5.0 Subsite http://typo3.org/gimmefive TYPO3 5.0 Development Website http://5-0.dev.typo3.org TYPO3 5.0 Documentation http://5-0.dev.typo3.org/guide Jochen Weiland PHP 6 Hosting http://www.jweiland.net Inspiring people to share
  72. 72. So long and thanks for the fishQuestions Inspiring people to share beer

×