CC BY-SA, James Hammond
https://www.flickr.com/photos/jameshammond/8732132809
Bringing TYPO3 Legacy
Applications into the ...
Martin Helmich
Software Architect at Mittwald
@martin-helmich
@mittwald
CC BY-SA, Wolfgang Wagner
https://www.flickr.com/p...
Legacy
Applications
CC BY-SA, Photones
http://commons.wikimedia.org/wiki/File:Heureka_(Plastik).jpg
CC BY-SA, Gerwin Sturm
https://www.flickr.com/photos/scarygami/5518831238
CC BY, Dude of Lego
https://www.flickr.com/photos/dudeoflego/5105352800
Option #1
Rewrite
From Scratch
CC BY-SA, D464-Darren Hall
http://commons.wikimedia.org/wiki/File:Demolition_in_Ballymun_-_Flickr_-_D464-Darren_Hall.jpg
Option #2
Migrate
Existing Code
CC BY-SA, Wolfe House & Building Movers
http://en.wikipedia.org/wiki/File:Hydrolic_dollies_relocate_house_in_Newark,_Delaw...
TYPO3
FLOW
TYPO3
NEOS
?
TYPO3
CMS
TYPO3
FLOW
TYPO3
NEOS
?
TYPO3
CMS
TYPO3
Extbase
Extbase
pibase
3rd party
Frameworks
TYPO3
FLOW
TYPO3
CMS
Extbase
pibase
3rd party
Frameworks
TYPO3
FLOW
TYPO3
CMS
Extbase
pibase
3rd party
Frameworks
TYPO3
FLOW
TYPO3
CMS
Extbase
pibase
3rd party
Frameworks
TYPO3
FLOW
TYPO3
CMS
When
NOT
to migrate
from CMS
to Flow
Public Domain (both)
http://pixabay.com/de/roter-apfel-apple-lecker-di%C3%A4t-83085/ and http://commons.wikimedia.org/wiki...
namespace	
  MyExtDomainModel;	
  
use	
  TYPO3FlowAnnotations	
  as	
  Flow;	
  
use	
  DoctrineORMMapping	
  as	
  ORM;	...
namespace	
  MyExtDomainModel;	
  
use	
  TYPO3FlowAnnotations	
  as	
  Flow;	
  
use	
  DoctrineORMMapping	
  as	
  ORM;	...
namespace	
  MyExtDomainModel;	
  
use	
  TYPO3FlowAnnotations	
  as	
  Flow;	
  
use	
  DoctrineORMMapping	
  as	
  ORM;	...
namespace	
  MyExtDomainModel;	
  
use	
  TYPO3FlowAnnotations	
  as	
  Flow;	
  
use	
  DoctrineORMMapping	
  as	
  ORM;	...
TYPO3 CMS
Manual
Migration
TYPO3 Flow
TYPO3 CMS
Manual
Migration
TYPO3 Flow
Largely
unusable
TYPO3 CMS TYPO3 Flow
Double
maintenance
TYPO3 CMS TYPO3 Flow
TYPO3 CMS TYPO3 Flow
Dependencies
between packages
CC BY, Mirko-Tobias Schäfer
https://www.flickr.com/photos/gastev/2174504149
Automation
https://github.com/
mittwald/flow-metamorph
composer require mittwald-typo3/flow-metamorph
composer require mittwald-typo3/flow-metamorph-pibase
Installation
<?php	
  
class	
  FooTastic	
  {	
  
	
  	
  public	
  function	
  
hello($who)	
  {	
  
	
  	
  	
  	
  echo	
  "Hello	
...
<?php	
  
class	
  FooTastic	
  {	
  
	
  	
  public	
  function	
  
hello($who)	
  {	
  
	
  	
  	
  	
  echo	
  "Hello	
...
<?php	
  
class	
  FooTastic	
  {	
  
	
  	
  public	
  function	
  
hello($who)	
  {	
  
	
  	
  	
  	
  echo	
  "Hello	
...
class	
  Tx_MyExt_Domain_Model_Car	
  extends	
  	
  
	
  	
  Tx_Extbase_DomainObject_AbstractEntity	
  {	
  
	
  	
  /**	...
class	
  Tx_MyExt_Domain_Model_Car	
  extends	
  	
  
	
  	
  Tx_Extbase_DomainObject_AbstractEntity	
  {	
  
	
  	
  /**	...
<?php	
  
class	
  FooTastic	
  {	
  
	
  	
  public	
  function	
  
hello($who)	
  {	
  
	
  	
  	
  	
  echo	
  "Hello	
...
<?php	
  
class	
  FooTastic	
  {	
  
	
  	
  public	
  function	
  
hello($who)	
  {	
  
	
  	
  	
  	
  echo	
  "Hello	
...
<?php	
  
class	
  FooTastic	
  {	
  
	
  	
  public	
  function	
  
hello($who)	
  {	
  
	
  	
  	
  	
  echo	
  "Hello	
...
<?php	
  
class	
  FooTastic	
  {	
  
	
  	
  public	
  function	
  
hello($who)	
  {	
  
	
  	
  	
  	
  echo	
  "Hello	
...
namespace	
  MyExtDomainModel;	
  
use	
  TYPO3FlowAnnotations	
  as	
  Flow;	
  
use	
  DoctrineORMMapping	
  as	
  ORM;	...
namespace
name=MwMyExtDomainModel
uses
use
name=Mw...AbstractVehicle
alias=AbstractVehicle
stmts
class
name=Car
abstract=f...
TYPO3 CMS TYPO3 Flow
Compatibility
Automated
Migration
TYPO3 CMS
Old Code, but
Feature Complete
TYPO3 Flow
Compatibility
Automated
Migration
TYPO3 Flow
Compatibility
TYPO3 CMS
Rewrite
iteratively
TYPO3 Flow
Compatibility
TYPO3 CMS
Rewrite
iteratively New
features
Compatibility
TYPO3 CMS
Rewrite
iteratively
Decomission the
old Application
TYPO3 Flow
TYPO3 Flow
Compatibility
TYPO3 CMS
Rewrite
iteratively
Migrate
continuouslyContinue to maintain
old Application
Automated
Code Transformation
Merge
Manual
correction
Open Problems
Proof of correctness
„How do I know that the
auto-generated code is
correct?“
Open Problems
Ease of Extensibility
„I want to migrate from Zend
to Flow, but writing new
transformation rules is just too...
Open Problems
Efficiency
„Wouldn’t it be easier to just
migrate all my code by hand?“
CC BY-SA, Max Mustermann
http://mustermann.de
http://slideshare.net/mhelmich/migrating-from-typo3-
cms-to-typo3-flow
https://speakerdeck.com/kdambekalns/migrating-
from...
Thank you
This work is licensed under a Creative Commons Attribution-
ShareAlike 4.0 International License.
m.helmich@mitt...
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow
Nächste SlideShare
Wird geladen in …5
×

InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow

2.209 Aufrufe

Veröffentlicht am

Slides of my presentation held at the Inspiring Conference in Kolbermoor on March 28th, 2015.

Veröffentlicht in: Software
0 Kommentare
0 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Keine Downloads
Aufrufe
Aufrufe insgesamt
2.209
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
171
Aktionen
Geteilt
0
Downloads
6
Kommentare
0
Gefällt mir
0
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

InspiringCon15: Bringing TYPO3 Legacy Applications into the Flow

  1. 1. CC BY-SA, James Hammond https://www.flickr.com/photos/jameshammond/8732132809 Bringing TYPO3 Legacy Applications into the Flow Martin Helmich m.helmich@mittwald.de @martin-helmich Inspiring Conference 2015, Kolbermoor March 28th, 2015
  2. 2. Martin Helmich Software Architect at Mittwald @martin-helmich @mittwald CC BY-SA, Wolfgang Wagner https://www.flickr.com/photos/wolfgang-wagner/16958684785
  3. 3. Legacy Applications
  4. 4. CC BY-SA, Photones http://commons.wikimedia.org/wiki/File:Heureka_(Plastik).jpg
  5. 5. CC BY-SA, Gerwin Sturm https://www.flickr.com/photos/scarygami/5518831238
  6. 6. CC BY, Dude of Lego https://www.flickr.com/photos/dudeoflego/5105352800
  7. 7. Option #1 Rewrite From Scratch
  8. 8. CC BY-SA, D464-Darren Hall http://commons.wikimedia.org/wiki/File:Demolition_in_Ballymun_-_Flickr_-_D464-Darren_Hall.jpg
  9. 9. Option #2 Migrate Existing Code
  10. 10. CC BY-SA, Wolfe House & Building Movers http://en.wikipedia.org/wiki/File:Hydrolic_dollies_relocate_house_in_Newark,_Delaware.jpg
  11. 11. TYPO3 FLOW TYPO3 NEOS ? TYPO3 CMS
  12. 12. TYPO3 FLOW TYPO3 NEOS ? TYPO3 CMS TYPO3 Extbase
  13. 13. Extbase pibase 3rd party Frameworks TYPO3 FLOW TYPO3 CMS
  14. 14. Extbase pibase 3rd party Frameworks TYPO3 FLOW TYPO3 CMS
  15. 15. Extbase pibase 3rd party Frameworks TYPO3 FLOW TYPO3 CMS
  16. 16. Extbase pibase 3rd party Frameworks TYPO3 FLOW TYPO3 CMS
  17. 17. When NOT to migrate from CMS to Flow
  18. 18. Public Domain (both) http://pixabay.com/de/roter-apfel-apple-lecker-di%C3%A4t-83085/ and http://commons.wikimedia.org/wiki/File:Citrus_reticulata.jpg
  19. 19. namespace  MyExtDomainModel;   use  TYPO3FlowAnnotations  as  Flow;   use  DoctrineORMMapping  as  ORM;   /**    *  @FlowEntity    */   class  Car  {      /**        *  @var  string        *  @FlowValidate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORMManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  20. 20. namespace  MyExtDomainModel;   use  TYPO3FlowAnnotations  as  Flow;   use  DoctrineORMMapping  as  ORM;   /**    *  @FlowEntity    */   class  Car  {      /**        *  @var  string        *  @FlowValidate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORMManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  21. 21. namespace  MyExtDomainModel;   use  TYPO3FlowAnnotations  as  Flow;   use  DoctrineORMMapping  as  ORM;   /**    *  @FlowEntity    */   class  Car  {      /**        *  @var  string        *  @FlowValidate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORMManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  22. 22. namespace  MyExtDomainModel;   use  TYPO3FlowAnnotations  as  Flow;   use  DoctrineORMMapping  as  ORM;   /**    *  @FlowEntity    */   class  Car  {      /**        *  @var  string        *  @FlowValidate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORMManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  23. 23. TYPO3 CMS Manual Migration TYPO3 Flow
  24. 24. TYPO3 CMS Manual Migration TYPO3 Flow Largely unusable
  25. 25. TYPO3 CMS TYPO3 Flow Double maintenance
  26. 26. TYPO3 CMS TYPO3 Flow
  27. 27. TYPO3 CMS TYPO3 Flow Dependencies between packages
  28. 28. CC BY, Mirko-Tobias Schäfer https://www.flickr.com/photos/gastev/2174504149 Automation
  29. 29. https://github.com/ mittwald/flow-metamorph
  30. 30. composer require mittwald-typo3/flow-metamorph composer require mittwald-typo3/flow-metamorph-pibase Installation
  31. 31. <?php   class  FooTastic  {      public  function   hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File
  32. 32. <?php   class  FooTastic  {      public  function   hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser
  33. 33. <?php   class  FooTastic  {      public  function   hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Abstract Syntax Tree
  34. 34. class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } Source Code
  35. 35. class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } class name=Tx_..._Car abstract=false final=false extends name=Tx_..._AbstractEntity stmts property name=licenseNumber docComment="/**n..." property name=manufacturer docComment="/**n..." Source Code Syntax Tree
  36. 36. <?php   class  FooTastic  {      public  function   hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Abstract Syntax Tree
  37. 37. <?php   class  FooTastic  {      public  function   hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Transformation Rules Trans- former Abstract Syntax Tree
  38. 38. <?php   class  FooTastic  {      public  function   hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser Transformation Rules Trans- former Printer <?php   namespace  Foo;   class  FooTastic  {      /**  @FlowInject  */      protected  $greeter;      public  function   hello($who)  {          $this-­‐>greeter-­‐ >greet($who);      } hello_improved.php output Source File(s) Abstract Syntax Tree
  39. 39. <?php   class  FooTastic  {      public  function   hello($who)  {          echo  "Hello   $who!";      }   }   hello.php Input Source File Parser class  FooTastic:      def  hello(who):          print  "Hello  %s"                                  %  who   hello.py Transformation Rules Trans- former Printer <?php   namespace  Foo;   class  FooTastic  {      /**  @FlowInject  */      protected  $greeter;      public  function   hello($who)  {          $this-­‐>greeter-­‐ >greet($who);      } hello_improved.php output Source File(s) Abstract Syntax Tree
  40. 40. namespace  MyExtDomainModel;   use  TYPO3FlowAnnotations  as  Flow;   use  DoctrineORMMapping  as  ORM;   /**    *  @FlowEntity    */   class  Car  {      /**        *  @var  string        *  @FlowValidate('NotEmpty')        */      protected  $licenseNumber;      /**        *  @var  Manufacturer        *  @ORMManyToOne        */      protected  $manufacturer;   } class  Tx_MyExt_Domain_Model_Car  extends        Tx_Extbase_DomainObject_AbstractEntity  {      /**        *  @var  string        *  @validate  notempty        */      protected  $licenseNumber;      /**        *  @var  Tx_MyExt_Domain_Model_Manufacturer        */      protected  $manufacturer;   } TYPO3 CMS (Extbase) TYPO3 Flow
  41. 41. namespace name=MwMyExtDomainModel uses use name=Mw...AbstractVehicle alias=AbstractVehicle stmts class name=Car abstract=false final=false extends name=AbstractVehicle stmts BEFORE AFTER „Rename Tx_MyExt_Domain_Model_Car to MwMyExtDomainModelCar“ class name=Tx_..._Car abstract=false final=false extends name=Tx_..._AbstractVehicle stmts property name=licenseNumber docComment="/**n..." property name=manufacturer docComment="/**n..."
  42. 42. TYPO3 CMS TYPO3 Flow Compatibility Automated Migration
  43. 43. TYPO3 CMS Old Code, but Feature Complete TYPO3 Flow Compatibility Automated Migration
  44. 44. TYPO3 Flow Compatibility TYPO3 CMS Rewrite iteratively
  45. 45. TYPO3 Flow Compatibility TYPO3 CMS Rewrite iteratively New features
  46. 46. Compatibility TYPO3 CMS Rewrite iteratively Decomission the old Application TYPO3 Flow
  47. 47. TYPO3 Flow Compatibility TYPO3 CMS Rewrite iteratively Migrate continuouslyContinue to maintain old Application
  48. 48. Automated Code Transformation Merge Manual correction
  49. 49. Open Problems Proof of correctness „How do I know that the auto-generated code is correct?“
  50. 50. Open Problems Ease of Extensibility „I want to migrate from Zend to Flow, but writing new transformation rules is just too complex!“
  51. 51. Open Problems Efficiency „Wouldn’t it be easier to just migrate all my code by hand?“
  52. 52. CC BY-SA, Max Mustermann http://mustermann.de
  53. 53. http://slideshare.net/mhelmich/migrating-from-typo3- cms-to-typo3-flow https://speakerdeck.com/kdambekalns/migrating- from-typo3-cms-to-typo3-neos Resources
  54. 54. Thank you This work is licensed under a Creative Commons Attribution- ShareAlike 4.0 International License. m.helmich@mittwald.de @martin-helmich https://github.com/martin-helmich https://github.com/mittwald/flow-metamorph

×