Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Planning for the Unplannable
Framework-Grade Architecture
Robert Lemke - TechDivision GmbH
TEXT HERE
Robert Lemke
!
38 years old
developer for 27 years
lives in Lübeck, Germany
software architect at TechDivision
T...
Framework-Grade?
Architecture?
Image © Arquivo Nacional Brasil
Image © 2014 Landsat / © 2014 GoogleImage © 2014 SIO, NOAA, U.S. Navy, NGA, GEBCO, Landsat, Google, Inav/Geosistemas SRL, ...
TEXT HERE
„this experiment was
not successful”
Oscar Niemeyer 2001
Photo © Marcelo Coelho
TEXT HERE
If you know that you can’t plan

for something, just

plan for the unplannable.
Flexibility and quality are key
Experience
Design Patterns
Loose Coupling
High Cohesion
Law of Demeter
- each unit should have only limited knowledge about other
units: only units "closely" related to the curre...
Code against interfaces
Dependency Injection
!
class IsbnLookupService {	
	
protected static $instance;	
	
public function getInstance() {	
if (self::$instance === NUL...
class ServiceLocator {	
	
protected static $services = array();	
	
public function getInstance($name) {	
return self::$ser...
class BookSearchController extends ActionController {	
!
/**	
* @var IsbnLookupService	
*/	
protected $isbnLookupService;	...
class BookSearchController extends ActionController {	
!
/**	
* @var IsbnLookupService	
*/	
protected $isbnLookupService;	...
class BookSearchController extends ActionController {	
!
/**	
* @FlowInject	
* @var IsbnLookupService	
*/	
protected $isbn...
class BookSearchController extends ActionController {	
!
/**	
* @FlowInject	
* @var IsbnLookupServiceInterface	
*/	
protec...
AcmeControllerBookSearchController:	
properties:	
isbnLookupService:	
className: AmazonServiceIsbnLookupService
Planned and Unplanned
Extensibility
Configuration
Signal-Slot Pattern
Observer, Dispatcher, Publish-
Subscribe, Event-Notifier,

Event Sourcing …
Define a public API
with @api
Aspect-Oriented Programming
Dependency Management:
Composer, requirejs, …
Reinvent the Wheel!
Unit Tests
Functional Tests
System / Behavior Tests
Understanding other

people’s code
Code Ownership
Software Rot
Be picky!

Fix broken windows!
Remove unused code
Write code because it adds value

(not only because you can)
But maybe we need it (YAGNI)
Be canny with configuration
Reviews
Change your perspective
Readable Code
TYPO3FlowCodingGuidelinesononepage
<?php
namespaceAcmeTestPackage;
/* *
*ThisscriptbelongstotheTYPO3Flowpackage"Acme.TestP...
Naming
$path
$pathAndFilename
$filename
$directory
$directoryName
$class
$className
© „davic” (Flickr)
© „¡Carlitos” (Flickr)
borrowed a lot from:

The pragmatic programmer
Code complete
All Martin Fowler Books (PoEAA)
TEXT HERE
@robertlemke
!
robertlemke.com
flow.typo3.org
neos.typo3.org
techdivision.com
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Planning for the Unplannable (IPC14 SE)
Upcoming SlideShare
Loading in …5
×

Planning for the Unplannable (IPC14 SE)

1,781 views

Published on

Long running projects, be it software or city planning, have something in common: the constant change to their environment. The problems to solve in one, two, or even five years from now will be different from those at hand now – and they are yet unknown. Thus dealing with uncertainty is one of the key issues and a well-chosen set of development techniques can help with that. Even if you don't plan to develop a framework, there's a lot you can learn from the development processes for creating your own stable and performant applications.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Planning for the Unplannable (IPC14 SE)

  1. 1. Planning for the Unplannable Framework-Grade Architecture Robert Lemke - TechDivision GmbH
  2. 2. TEXT HERE Robert Lemke ! 38 years old developer for 27 years lives in Lübeck, Germany software architect at TechDivision TYPO3 Association co-founder TYPO3 Flow & TYPO3 Neos project founder
 1 wife, 2 daughters, 1 espresso machine
  3. 3. Framework-Grade?
  4. 4. Architecture?
  5. 5. Image © Arquivo Nacional Brasil
  6. 6. Image © 2014 Landsat / © 2014 GoogleImage © 2014 SIO, NOAA, U.S. Navy, NGA, GEBCO, Landsat, Google, Inav/Geosistemas SRL, Mapcity
  7. 7. TEXT HERE
  8. 8. „this experiment was not successful” Oscar Niemeyer 2001 Photo © Marcelo Coelho
  9. 9. TEXT HERE
  10. 10. If you know that you can’t plan
 for something, just
 plan for the unplannable.
  11. 11. Flexibility and quality are key
  12. 12. Experience
  13. 13. Design Patterns
  14. 14. Loose Coupling
  15. 15. High Cohesion
  16. 16. Law of Demeter - each unit should have only limited knowledge about other units: only units "closely" related to the current unit.
 - each unit should only talk to its friends;
 don't talk to strangers.
 - only talk to your immediate friends.
  17. 17. Code against interfaces
  18. 18. Dependency Injection
  19. 19. ! class IsbnLookupService { protected static $instance; public function getInstance() { if (self::$instance === NULL) { self::$instance = new self; } return self::$instance; } } ! ! class BookSearchController { public function action() { $service = IsbnLookupService::getInstance(); … } }
  20. 20. class ServiceLocator { protected static $services = array(); public function getInstance($name) { return self::$service[$name]; } ! } ! ! class BookSearchService { public function action() { $service = ServiceLocater::getInstance("IsbnLookupService"); … } }
  21. 21. class BookSearchController extends ActionController { ! /** * @var IsbnLookupService */ protected $isbnLookupService; /** * @param IsbnLookupService $isbnLookupService */ public function __construct(IsbnLookupService $service) { $this->isbnLookupService = $service; } }
  22. 22. class BookSearchController extends ActionController { ! /** * @var IsbnLookupService */ protected $isbnLookupService; /** * @param IsbnLookupService $isbnLookupService */ public function injectLookupService(IsbnLookupService $service) { $this->isbnLookupService = $service; } }
  23. 23. class BookSearchController extends ActionController { ! /** * @FlowInject * @var IsbnLookupService */ protected $isbnLookupService; ! }
  24. 24. class BookSearchController extends ActionController { ! /** * @FlowInject * @var IsbnLookupServiceInterface */ protected $isbnLookupService; ! }
  25. 25. AcmeControllerBookSearchController: properties: isbnLookupService: className: AmazonServiceIsbnLookupService
  26. 26. Planned and Unplanned Extensibility
  27. 27. Configuration
  28. 28. Signal-Slot Pattern
  29. 29. Observer, Dispatcher, Publish- Subscribe, Event-Notifier,
 Event Sourcing …
  30. 30. Define a public API with @api
  31. 31. Aspect-Oriented Programming
  32. 32. Dependency Management: Composer, requirejs, …
  33. 33. Reinvent the Wheel!
  34. 34. Unit Tests
  35. 35. Functional Tests
  36. 36. System / Behavior Tests
  37. 37. Understanding other
 people’s code
  38. 38. Code Ownership
  39. 39. Software Rot
  40. 40. Be picky!
 Fix broken windows!
  41. 41. Remove unused code
  42. 42. Write code because it adds value
 (not only because you can)
  43. 43. But maybe we need it (YAGNI)
  44. 44. Be canny with configuration
  45. 45. Reviews
  46. 46. Change your perspective
  47. 47. Readable Code
  48. 48. TYPO3FlowCodingGuidelinesononepage <?php namespaceAcmeTestPackage; /* * *ThisscriptbelongstotheTYPO3Flowpackage"Acme.TestPackage". * * * *Itisfreesoftware;youcanredistributeitand/ormodifyitunder * *thetermsoftheGNUGeneralPublicLicense,eitherversion3ofthe * *License,or(atyouroption)anylaterversion. * * * *TheTYPO3project-inspiringpeopletoshare! * * */ useAcmeTestPackageServiceFooGenerator; useTYPO3FlowAnnotationsasFlow; /** *Heregoesthedescriptionoftheclass.Itshouldexplainwhatthemain *purposeofthisclassis... * *@FlowScope(”singleton”) */ classUniverseAnalyzerextendsBaseClassimplementsSomeInterface{ /** *Someinjecteddependency * *@FlowInject *@varFooGenerator */ protected$someDependency=NULL; /** *ShowsifyouareaddictedtoTYPO3Flow * *@varboolean */ staticprotected$addictedToFlow=TRUE; /** *ShowsifyouareafanofTYPO3Flow * *@varboolean */ protected$fanOfFlow; /** *Agreatmethodwhichshowshowtoindentcontrolstructures. Descriptionoftheclass.Makeitas longasneeded,feelfreetoexplain howtouseit. Namespacestartswithvendorname followedbypackagekey(name)and subpartsasneeded UpperCamelCaseclassname.Class namesshouldbenouns. Inotherpackages,import AcmeTestPackageUniverseAnalyzer andrefertoitasUniverseAnalyer. Use@vartag.Optionaldescription goesinthefirstcommentline followedbyablankcommentline. Descriptionofthemethod.Makeit aslongasneeded. Methodnamesshouldbeverbs. Oneusestatementperline. Oneusestatementpernamespace. Orderstatementsalphabetically. Don'timportnamespacesunlessyou usethem. NoemptylinebetweenDocComment andclass,membervarormethod. Preferrelativenamespaces,unless FullyQualifiedNamespaceismore readable List@Flow*beforeothertags: @var,@param,@return,@throws, @api,@since,@deprecated Capturethejoyofcodingasyou createexcellentwebsolutions. Enjoycoding.EnjoyFlow. http://rlmk.me/flowcgl
  49. 49. Naming
  50. 50. $path $pathAndFilename $filename $directory $directoryName $class $className
  51. 51. © „davic” (Flickr)
  52. 52. © „¡Carlitos” (Flickr)
  53. 53. borrowed a lot from:
 The pragmatic programmer Code complete All Martin Fowler Books (PoEAA)
  54. 54. TEXT HERE @robertlemke ! robertlemke.com flow.typo3.org neos.typo3.org techdivision.com

×