Überblick über FLOW3, Fluid und die Relation TYPO3 v4 und TYPO3 v5.
Es werden wichtige Konzepte wie Dependecy Injection, AOP, TDD vorgestellt. Desweiteren wird Fluid präsentiert.
10. - ACHTUNG -
TYPO3-Evangelist
Inspiring people to
FLOW3 - der aktuelle Stand share
11. Inhalt Test Driven
TYPO3 - Einführung Development
Dependency
FLOW3 Injection
Aspektorientierte
Programmierung
Fluid - The Zen of Templating
Domain Driven
Synergien TYPO3 v4 und v5 Design & MVC
Inspiring people to
FLOW3 - der aktuelle Stand share
12. Inhalt Test Driven
TYPO3 - Einführung Development
Dependency
FLOW3 Injection
Aspektorientierte
Programmierung
Fluid - The Zen of Templating
Domain Driven
Synergien TYPO3 v4 und v5 Design & MVC
Inspiring people to
FLOW3 - der aktuelle Stand share
13. TYPO3
Open Source Content Management System
Aktuelle stabile Version: TYPO3 4.2.3
60.000 bis 80.000 Downloads pro Monat
mehr als 30.000 Nutzer auf typo3.org registriert
Höchste Verbreitung im Mittelstand, jedoch auch Nutzung in großen Firmen:
Dassault Systems, 3M, Sixt, Unesco, Unicef, WWF
Inspiring people to
FLOW3 - der aktuelle Stand share
14. Die Geschichte von TYPO3
seit 1998
33 Kernentwickler
bisher 500.000 Zeilen Code committed
aktuelle Codebase: 300.000 Zeilen
Inspiring people to
FLOW3 - der aktuelle Stand share
15. Warum benötigen wir TYPO3 v5?
Inspiring people to
FLOW3 - der aktuelle Stand share
16. TYPO3 Heute
TYPO3 v4 ist nahezu vollständig ausgereift
Letzte Releases: Fokus auf Usability-Verbesserungen für Benutzer
Inspiring people to
FLOW3 - der aktuelle Stand share
18. TYPO3 Heute
TYPO3 v4 ist nahezu vollständig ausgereift
Letzte Releases: Fokus auf Usability-Verbesserungen für Benutzer
Gewachsene Architektur, keine Unit Tests
Große Änderungen sind daher risikoreich / unmöglich
TYPO3 wird oft als Anwendungsframework verwendet - es ist jedoch ein CMS
Inspiring people to
FLOW3 - der aktuelle Stand share
19. TYPO3 in der Zukunft?
Inspiring people to
FLOW3 - der aktuelle Stand share
20. Warum sollte man von Null anfangen?
Inspiring people to
FLOW3 - der aktuelle Stand share
26. Inhalt Test Driven
TYPO3 - Einführung Development
Dependency
FLOW3 Injection
Aspektorientierte
Programmierung
Fluid - The Zen of Templating
Domain Driven
Synergien TYPO3 v4 und v5 Design & MVC
Inspiring people to
FLOW3 - der aktuelle Stand share
27. Flow [flō] (engl. fließen, rinnen, strömen)
bedeutet das Gefühl des völligen Aufgehens in
einer Tätigkeit. In diesem Zustand besteht
völlige Harmonie zwischen dem limbischen
System, das die Emotionen steuert, und dem
kortikalen System, dem der Sitz für Bewusstsein
und Verstand zugeordnet wird.
FLOW3 [flō'three] Das Web-
Anwendungsframework, welches
alle Schwierigkeiten löst, sodass
man sich auf das Wesentliche
konzentrieren kann.
Inspiring people to
FLOW3 - der aktuelle Stand share http://www.sxc.hu/photo/768249
28. FLOW3 = Anwendungsframework
Nicht nur eine Zusammenstellung von Komponenten oder eine „Snippet-Library“
geliefert mit einsatzfähiger Standardkonfiguration
Paketbasiert
Alph
benötigt mindestens PHP 5.3 a3
mit einem mächtigen JSR-283-basierten Content Repository geliefert
Inspiring people to
FLOW3 - der aktuelle Stand share
29. Genieße das FLOW3-Erlebnis
Intuitive APIs
Lesbarer Quellcode (wie ein Buch)
Konsistente Benennung für Klassen, Methoden und Eigenschaften
Inspiring people to
FLOW3 - der aktuelle Stand share
31. Die Grundpfeiler von FLOW3
Test Driven Dependency Aspect Oriented
Development Injection Programming
Inspiring people to
FLOW3 - der aktuelle Stand share
32. Die Grundpfeiler von FLOW3
Test Driven Development
... means that you write an automated test, then
you write just enough code to make that one
test pass, then you refactor the code primarily
to improve readability and remove duplication.
«
Henrik Kniberg
SCRUM and XP from the trenches
Inspiring people to
FLOW3 - der aktuelle Stand share
33. Die Grundpfeiler von FLOW3
Test Driven Development
» ... means that you write an automated test, then
you write just enough code to make that one
test pass, then you refactor the code primarily
to improve readability and remove duplication.
«
Henrik Kniberg
SCRUM and XP from the trenches
Inspiring people to
FLOW3 - der aktuelle Stand share
34. Die Grundpfeiler von FLOW3
Test Driven Development
Test Case FAIL Implementation OK Refactoring OK
Inspiring people to
FLOW3 - der aktuelle Stand share
35. Die Grundpfeiler von FLOW3
Test Driven Development - Demonstration
Eine Klasse schreiben, welche eine „square“-Methode besitzt. Diese multipliziert
eine Zahl mit sich selbst und gibt das Ergebnis zurück.
Akademisches
Beispiel!
Inspiring people to
FLOW3 - der aktuelle Stand share
44. Die Grundpfeiler von FLOW3
Test Driven Development
zuerst Unit Tests schreiben, dann den zu testenden Code
Software-Designer
Programmierer
Inspiring people to
FLOW3 - der aktuelle Stand share
45.
46. Die Grundpfeiler von FLOW3
Dependency Injection
Hollywood Principle: „Don‘t call us, we call you“
Anwendung des „Inversion of Control“-Patterns für die Erzeugung und
Initialisierung von Objekten
Inspiring people to
FLOW3 - der aktuelle Stand share
47. Die Grundpfeiler von FLOW3
Ohne Dependency Injection
BookingWeb public function __construct() {
Service // Prototype
$this->logger = new Logger();
// oder als Singleton:
<<create>> $this->logger = Logger->getInstance()
}
Logger Objekt 3
Inspiring people to
FLOW3 - der aktuelle Stand share
48. Die Grundpfeiler von FLOW3
Ohne Dependency Injection
Wie schreibt man Unit Tests public function __construct() {
für solch einen Code? // Prototype
$this->logger = new Logger();
Wie entscheidet man zur Laufzeit,
welcher Logger instanziert wird? // oder als Singleton:
$this->logger = Logger->getInstance()
}
Inspiring people to
FLOW3 - der aktuelle Stand share
49. Die Grundpfeiler von FLOW3
Mit Dependency Injection
BookingWeb Jedes Objekt deklariert, welche anderen
Service Objekte es benötigt
Der IoC Container ...
... gibt dem Objekt fertig initialisierte
<<needs>> Objekte
... entscheidet zur Laufzeit, welche
Logger Objekt 3 Klassen instanziert werden
IoC Container
Inspiring people to
FLOW3 - der aktuelle Stand share
50. Die Grundpfeiler von FLOW3
Mit Dependency Injection
Constructor Injection
public function __construct(F3FLOW3LogLogger $logger) {
$this->logger = $logger;
} Das
Framework
injiziert den
Logger
Inspiring people to
FLOW3 - der aktuelle Stand share
51. Die Grundpfeiler von FLOW3
Mit Dependency Injection
Setter Injection
public function injectLogger(F3FLOW3LogLogger $logger) {
$this->logger = $logger;
} Das
Framework
injiziert den
Logger
Inspiring people to
FLOW3 - der aktuelle Stand share
52. Die Grundpfeiler von FLOW3
Mit Dependency Injection
Jede Klasse ist einzeln testbar, indem man die benötigten Abhängigkeiten mit
Mocks / Stubs simuliert
Man kann konfigurieren, ob Klassen sich wie Singletons oder Prototypes verhalten
@scope singleton (Standard)
@scope prototype
Inspiring people to
FLOW3 - der aktuelle Stand share
53. Die Grundpfeiler von FLOW3
Mit Dependency Injection
Man kann zur Laufzeit entscheiden, welche Klasse verwendet werden soll
BookingWeb LoggerInterface
Service
FileLogger DatabaseLogger
Inspiring people to
FLOW3 - der aktuelle Stand share
54.
55. Die Grundpfeiler von FLOW3
Aspektorientierte Programmierung
AOP ist ein Programmierparadigma
ergänzt OOP
OOP modularisiert „concerns“ (Aufgabenbereiche): durch Pakete, Klassen,
Methoden
AOP: cross-cutting concerns
Inspiring people to
FLOW3 - der aktuelle Stand share
59. Aspektorientierte Programmierung
PHP‘s fehlende Funktionalität
Mit AOP kann man:
alle „cross-cutting concerns“ zentralisieren und sauber separieren
beliebige Methodenaufrufe abfangen
neue Funktionalität zu Code hinzufügen, ohne diesen zu verändern
... viele weitere Tricks anwenden
Inspiring people to
FLOW3 - der aktuelle Stand share
60. Aspektorientierte Programmierung
Exkurs: Das Security-Framework
Presentation $customer->setName(...)
changeCustomerAction
Security Framework
Domain Customer
Data source
Touchless Security!
Inspiring people to
FLOW3 - der aktuelle Stand share
61.
62. FLOW3-Module
AOP Locale Reflection
Object Log Resource
Configuration MVC Session
Cache Package Utility
Error Persistence Validation
Event Property ... und mehr
Inspiring people to
FLOW3 - der aktuelle Stand share
64. Domain Driven Design
Domäne = Aktivität oder Geschäft des Benutzers
Es geht um...
den Fokus auf die Domäne, und die Logik der Domäne
die genaue Abbildung der Domänenregeln in Software
das Schaffen einer universellen Sprache („Ubiquitous language“) zwischen den
Projektmitgliedern
Inspiring people to
FLOW3 - der aktuelle Stand share
66. Domain Driven Design
Ubiquitous language
Gemeinsames Vokabular ist eine wichtige Grundvoraussetzung, um miteinander zu
arbeiten
Benutze die selben Wörter für Diskussion, Modellierung, Entwicklung und
Dokumentation
Inspiring people to
FLOW3 - der aktuelle Stand share
68. Domain Driven Design
Beispiel: Phone Book
showEntries()
checkIfUserCanDeleteEntry()
exportPhoneBook()
logChanges()
Inspiring people to
FLOW3 - der aktuelle Stand share
69. Domain Driven Design
Beispiel: Phone Book
Nicht in der showEntries()
PhoneBook- checkIfUserCanDeleteEntry()
exportPhoneBook()
Domäne! logChanges()
Inspiring people to
FLOW3 - der aktuelle Stand share
71. Domain Driven Design
Schichtenarchitektur
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
FLOW3 - der aktuelle Stand share
72. Domain Driven Design
Schichtenarchitektur
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
FLOW3 - der aktuelle Stand share
74. MVC
Model
Objekt, welches Daten und Geschäftslogik einer bestimmten Domäne enthält
enthält keine Informationen über die Darstellung der Daten, sondern definiert das
Verhalten
in FLOW3 nutzen wir Domain Models
Inspiring people to
FLOW3 - der aktuelle Stand share
75. MVC
View
Darstellung des Models im Web oder in anderen Ausgabemedien
Stellen nur Daten dar, verändern diese nicht.
Inspiring people to
FLOW3 - der aktuelle Stand share
76. MVC
Controller
Reagiert auf Benutzereingaben
Wählt das Model und verändert dieses wie benötigt
Wählt den View aus und gibt diesem die Daten, die er rendern soll
Der Standard-Controller für FLOW3 ist der ActionController
Inspiring people to
FLOW3 - der aktuelle Stand share
77.
78. MVC und DDD mit FLOW3
Inspiring people to
FLOW3 - der aktuelle Stand share
79. DEMO
Inspiring people to
FLOW3 - der aktuelle Stand share
80. MVC und DDD mit FLOW3
Dateistruktur
Inspiring people to
FLOW3 - der aktuelle Stand share
81. MVC und DDD mit FLOW3
Domain Model
Inspiring people to
FLOW3 - der aktuelle Stand share
82. MVC und DDD mit FLOW3
Domain Model
Inspiring people to
FLOW3 - der aktuelle Stand share
83.
84.
85.
86.
87. MVC und DDD mit FLOW3
Domain Model
Inspiring people to
FLOW3 - der aktuelle Stand share
88. MVC und DDD mit FLOW3
Domain Model
Inspiring people to
FLOW3 - der aktuelle Stand share
89. MVC und DDD mit FLOW3
Domain Model
Inspiring people to
FLOW3 - der aktuelle Stand share
90. MVC und DDD mit FLOW3
Aber - Persistenz?
durch einen Persistence Manager werden Objekte gespeichert
Transparent für den Programmierer
Inspiring people to
FLOW3 - der aktuelle Stand share
91. MVC und DDD mit FLOW3
Aber - Persistenz?
Anwendung Anwendung
Persistence Manager
JSR-283 Content Repository
PDO ...
MySQL Postgres SQLite
Inspiring people to
FLOW3 - der aktuelle Stand share
92. DEMO
Inspiring people to
FLOW3 - der aktuelle Stand share
93. MVC und DDD mit FLOW3
Controller
Normal: Erben von F3FLOW3MVCControllerActionController
public function indexAction() {
// ...
}
public function listAction() {
// ...
}
Inspiring people to
FLOW3 - der aktuelle Stand share
94.
95.
96.
97.
98. MVC und DDD mit FLOW3
Controller-Argumente
Jedes Argument muss explizit deklariert werden
Zugriff auf $_GET, $_POST ist nicht erlaubt und wird abgefangen!
Inspiring people to
FLOW3 - der aktuelle Stand share
99. MVC und DDD mit FLOW3
Controller-Argumente Argumentregistrierung
Argument-Mapping von einfachen Argumenten wird noch schöner!
public function initializeArguments() {
$this->arguments->addNewArgument(“tag”, “Text“);
}
public function listByTagAction() {
$tag = $this->arguments[‘tag’]->getValue();
// $tag ist ein String!
}
Inspiring people to
FLOW3 - der aktuelle Stand share
100. MVC und DDD mit FLOW3
Controller-Argumente
Argument-Mapping von einfachen Argumenten
public function initializeArguments() {
$this->arguments->addNewArgument(“tag”, “UUID“);
}
public function listByTagAction() {
$tag = $this->arguments[‘tag’]->getValue();
// $tag ist eine UUID!
}
Inspiring people to
FLOW3 - der aktuelle Stand share
101. MVC und DDD mit FLOW3
Controller-Argumente
Argument-Mapping von komplexen Argumenten
public function initializeArguments() {
$this->arguments->addNewArgument(“comment”, “F3BlogDomainComment“);
}
public function addNewCommentAction() {
$comment = $this->arguments[‘comment’]->getValue();
// $comment ist ein Comment-Objekt!
}
Inspiring people to
FLOW3 - der aktuelle Stand share
102. MVC und DDD mit FLOW3
View
... ist eine PHP-Klasse, welche von F3FLOW3MVCViewAbstractView erbt
es gibt Standardklassen für marker-basierte Views, Smarty-basierte Views, und...
Fluid!
Inspiring people to
FLOW3 - der aktuelle Stand share
103.
104. Fluid - The Zen of Templating
Inspiring people to
FLOW3 - der aktuelle Stand share
105. Inhalt Test Driven
TYPO3 - Einführung Development
Dependency
FLOW3 Injection
Aspektorientierte
Programmierung
Fluid - The Zen of Templating
Domain Driven
Synergien TYPO3 v4 und v5 Design & MVC
Inspiring people to
FLOW3 - der aktuelle Stand share
106. Fluid
Was ist eine Template-Engine?
übernimmt die Darstellung von Daten
lebt in der View-Komponente
Bekannte Engines
Smarty
*TAL
Velocity
Designer schreiben kein PHP, sondern HTML
Inspiring people to
FLOW3 - der aktuelle Stand share
108. Fluid
Nachteile existierender Template Engines
nicht komplett OOP / brechen OOP-Paradigmen an einigen Stellen
schwierig für nicht-HTML-basierte Templates nutzbar
keine Autovervollständigung in Editoren
nicht einfach erweiterbar
Inspiring people to
FLOW3 - der aktuelle Stand share
109. The Zen of
Templating
simpel mächtig
http://www.sxc.hu/photo/821903
110. The Zen of
Templating
intuitiv einfach erlernbar
http://www.sxc.hu/photo/821903
111. Einfachheit ist die ultimative Vollkommenheit.
Leonardo Da Vinci
«
Inspiring people to
FLOW3 - der aktuelle Stand share
112. » Einfachheit ist die ultimative Vollkommenheit.
Leonardo Da Vinci
«
Inspiring people to
FLOW3 - der aktuelle Stand share
113. Fluid
Ziel
Einfache, elegante Template Engine
vielfältige Unterstützung für den Template-Schreiber
einfache und saubere Erweiterbarkeit
vielerlei Ausgabemedien möglich
Inspiring people to
FLOW3 - der aktuelle Stand share
114. Fluid
Grundkonzepte
Namespace-
Ausgabelogik ist in View Helpers (Tags) gekapselt Deklaration
{namespace f3=F3FluidViewHelpers}
<f3:link action=“someAction“>Administrationsoberfläche</f3:link>
Aufruf eines
Tags
Fluid Core enthält keine Ausgabelogik!
Inspiring people to
FLOW3 - der aktuelle Stand share
118. Fluid
Grundkonzepte
Variablen
$this->view->assign(‘blogTitle’, $blog->getTitle());
<h1>Der Name des Blogs ist: {blogTitle}</h1>
Inspiring people to
FLOW3 - der aktuelle Stand share
119. Fluid
Grundkonzepte
Object Accessors
$this->view->assign(‘blog’, $blog);
<h1>Der Name des Blogs ist: {blog.title}</h1>
Autor: {blog.author}
Geht auch weiter
Getter / Setter werden automatisch aufgerufen
verschachtelt
Inspiring people to
FLOW3 - der aktuelle Stand share
120. Fluid
Grundkonzepte
Arrays
<f3:link action=“show“ arguments=“{id: blog.id, name: ‘Hallo’}“>Posting
anzeigen</f3:link>
JSON-Objektsyntax
Inspiring people to
FLOW3 - der aktuelle Stand share
121. Ein Beispiel
Inspiring people to
FLOW3 - der aktuelle Stand share
128. Fluid
Autovervollständigung
Generierung von XML Schema aus Quellcode-Kommentaren
funktioniert damit in allen XML-fähigen Editoren (z.B. Eclipse)
Inspiring people to
FLOW3 - der aktuelle Stand share
129. Fluid
Aufbau
TemplateView View Helpers (Tags)
Fluid Core
Inspiring people to
FLOW3 - der aktuelle Stand share
130. Fluid
Backport
Fluid wird in TYPO3 4.4 integriert
warscheinlich: Standalone-Lösung
Inspiring people to
FLOW3 - der aktuelle Stand share
131. Fluid
Nächste Schritte
Caching
Tag-Library dokumentieren und ausbauen
Portierung auf TYPO3 v4
Inspiring people to
FLOW3 - der aktuelle Stand share
134. Fluid
Weitere Informationen
http://forge.typo3.org/projects/package-fluid
https://svn.typo3.org/FLOW3/Packages/Fluid
Inspiring people to
FLOW3 - der aktuelle Stand share
135.
136. FLOW3 - der aktuelle Stand
Inspiring people to
FLOW3 - der aktuelle Stand share
137. Progress
Progress
Developing TYPO3 5.0 ...
Inspiring people to
FLOW3 - der aktuelle Stand share
138. Der aktuelle Stand
AOP
Object
Configuration
Cache
Error
Event
0 25 50 75 100
Inspiring people to
FLOW3 - der aktuelle Stand share
139. Der aktuelle Stand
Locale
Log
MVC
Package
Persistence
Property
0 25 50 75 100
Inspiring people to
FLOW3 - der aktuelle Stand share
140. Der aktuelle Stand
Reflection
Resource
Session
Utility
Validation
0 25 50 75 100
Inspiring people to
FLOW3 - der aktuelle Stand share
141. Nächste Schritte
erste FLOW3-Beta: In den nächsten 1-2 Monaten
erste Pilotprojekte: jetzt
Weiterentwicklung des CMS
Geplanter Beta-Release von TYPO3 5.0: Ende 2009
Inspiring people to
FLOW3 - der aktuelle Stand share
142. Wir suchen...
Fluid-Mitentwickler, Tester, ...
FLOW3-Entwickler
(bald) TYPO3 5.0 Mitentwickler
Inspiring people to
FLOW3 - der aktuelle Stand share
143. Weitere Informationen
http://flow3.typo3.org
http://flow3.typo3.org/documentation/reference
https://svn.typo3.org/FLOW3/Distribution/trunk
https://svn.typo3.org/FLOW3/Distribution/branches/BlogExample
Inspiring people to
FLOW3 - der aktuelle Stand share
144. Inhalt Test Driven
TYPO3 - Einführung Development
Dependency
FLOW3 Injection
Aspektorientierte
Programmierung
Fluid - The Zen of Templating
Domain Driven
Synergien TYPO3 v4 und v5 Design & MVC
Inspiring people to
FLOW3 - der aktuelle Stand share
145. Synergien TYPO3 v4 und TYPO3 v5
Inspiring people to
FLOW3 - der aktuelle Stand share
154. TYPO3 Transition Days
The Berlin Manifesto
We, the participants of the T3TD08 state that ...
TYPO3 v4 continues to be actively developed
v4 development will continue after the the
release of v5
Future releases of v4 will see its features
converge with those in TYPO3 v5
Inspiring people to
FLOW3 - der aktuelle Stand share
155. TYPO3 Transition Days
The Berlin Manifesto
We, the participants of the T3TD08 state that ...
TYPO3 v5 will be the successor to TYPO3 v4
Migration of content from TYPO3 v4 to TYPO3
v5 will be easily possible
Inspiring people to
FLOW3 - der aktuelle Stand share
156. TYPO3 Transition Days
The Berlin Manifesto
We, the participants of the T3TD08 state that ...
TYPO3 v5 will introduce many new concepts
and ideas. Learning never stops and we'll help
with adequate resources to ensure a smooth
transition.
Inspiring people to
FLOW3 - der aktuelle Stand share
157.
158. Patrick Broens, Karsten Dambekalns, Dmitry Dulepov, Andreas
Förthner, Oliver Hader, Martin Herr, Christian Jul Jensen, Thorsten
Kahler, Steffen Kamper, Christian Kuhn, Sebastian Kurfürst, Martin
Kutschker, Robert Lemke, Tobias Liebig, Benjamin Mack, Peter
Niederlag, Jochen Rau, Ingo Renner, Ingmar Schlecht, Jeff Segars,
Michael Stucki, Bastian Waidelich
162. Synergien
MVC-Framework in 4.3
Das FLOW3-MVC-Framework wird auf Version 4.3 portiert
Ziele:
Neue Konzepte erlernbar machen
Schon jetzt mit „FLOW3-Paradigmen“ programmieren
Inspiring people to
FLOW3 - der aktuelle Stand share
163. Synergien
Fluid in 4.4
Fluid wird für Templates und Extension-Entwickler zur Verfügung stehen
Automatische Konvertierung vom Fluid-Kern
An TYPO3 v4 angepasste Tags
Inspiring people to
FLOW3 - der aktuelle Stand share