• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
The framework as an implementation detail
 

The framework as an implementation detail

on

  • 4,078 views

What would your application look like if it were written by the people who write the testing frameworks? If unit tests make classes more modular, by forcing you to test it in isolation, then what is ...

What would your application look like if it were written by the people who write the testing frameworks? If unit tests make classes more modular, by forcing you to test it in isolation, then what is the effect of expanding this to a less granular level, the acceptance and functional test. The more modern application architecture evolves, the more we hear the very old patterns being rediscovered and re-adopted. 1979 Trygve's MVC is a classic example, so are the SOLID principles. In this talk we will look on how Symfony allows for a really decoupled, easy to test application, by following on the footsteps of Alistair Cockburn's hexagonal architecture.

Statistics

Views

Total Views
4,078
Views on SlideShare
3,634
Embed Views
444

Actions

Likes
12
Downloads
29
Comments
0

4 Embeds 444

http://librosweb.es 344
https://twitter.com 91
http://symfony2developer.com 6
http://ipv6.symfony2developer.com 3

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    The framework as an implementation detail The framework as an implementation detail Presentation Transcript

    • The Framework as an Implementation Detail MarcelloDuarte/KonstantinKudryashov
    • @_md @everzet a SensioLabsEvent Aboutus @_md MarcelloDuarteHEAD OFTRAINING, INVIQA @everzet KonstantinKudryashovBDD PRACTICE MANAGER, INVIQA
    • @_md @everzet a SensioLabsEvent Thistalk [ Convenience ] [ Choices ] [ Future ]
    • @_md @everzet a SensioLabsEvent Choice Convenience http://www.flickr.com/photos/johnwinkelman/6200402992/
    • @_md @everzet a SensioLabsEvent We do love .
    • @_md @everzet a SensioLabsEvent Promise “A framework is‘just’one of the tools to help you develop better and faster” – Symfony documentation
    • @_md @everzet a SensioLabsEvent “The only way to go fast is to go well”– Uncle Bob FAST SLOW QUALITY SWITCH
    • @_md @everzet a SensioLabsEvent Relativecostofrepair analysis design code test support
    • @_md @everzet a SensioLabsEvent Convenient vs Maintainable
    • @_md @everzet a SensioLabsEvent A framework is“convenient” when it makes choices for you BookController extends Controller AuthorsController extends ContainerAwareController
    • @_md @everzet a SensioLabsEvent The code is maintainable when the framework lets you make the choices
    • @_md @everzet a SensioLabsEvent Instabilityandabstractness instability abstractness
    • @_md @everzet a SensioLabsEvent The “convenient”code is usually not very testable
    • @_md @everzet a SensioLabsEvent Symfonycanbeconvenient public function updateAction($id) { $em = $this->getDoctrine()->getManager(); $product = $em->getRepository('AcmeStoreBundle:Product')->find($id); if (!$product) { throw $this->createNotFoundException( 'No product found for id '.$id ); } $product->setName('New product name!'); $em->flush(); return $this->redirect($this->generateUrl('homepage')); }
    • @_md @everzet a SensioLabsEvent The“convenient”Controller tends to ask for more IntegrationTests
    • @_md @everzet a SensioLabsEvent IntegrationTests stinks of coupling
    • @_md @everzet a SensioLabsEvent Feedback Outer Quality Inner Quality AcceptanceTests UnitTests
    • @_md @everzet a SensioLabsEvent Choice Choices http://www.flickr.com/photos/tmartin/32010732/
    • @_md @everzet a SensioLabsEvent Should we alwaysTDD? what the Start Up said what the Craftsmen said
    • @_md @everzet a SensioLabsEvent We do Test Driven Design
    • @_md @everzet a SensioLabsEvent Design is about choices
    • @_md @everzet a SensioLabsEvent Design is a professional activity
    • @_md @everzet a SensioLabsEvent TDD is about communication
    • @_md @everzet a SensioLabsEvent TDD is about your stakeholders
    • @_md @everzet a SensioLabsEvent The developers in the team are also stakeholders
    • @_md @everzet a SensioLabsEvent TDD is for long term relationships
    • @_md @everzet a SensioLabsEvent Howmanydependenciescanyouspot? public function updateAction($id) { $em = $this->getDoctrine()->getManager(); $product = $em->getRepository('AcmeStoreBundle:Product')->find($id); if (!$product) { throw $this->createNotFoundException( 'No product found for id '.$id ); } $product->setName('New product name!'); $em->flush(); return $this->redirect($this->generateUrl('homepage')); }
    • @_md @everzet a SensioLabsEvent Howmanydependenciescanyouspot? public function updateAction($id) { $em = $this->getDoctrine()->getManager(); $product = $em->getRepository('AcmeStoreBundle:Product')->find($id); if (!$product) { throw $this->createNotFoundException( 'No product found for id '.$id ); } $product->setName('New product name!'); $em->flush(); return $this->redirect($this->generateUrl('homepage')); } Doctrine Redirect Router Model
    • @_md @everzet a SensioLabsEvent HexagonalArchitecture “The hexagon is not a hexagon because the number six is important, but rather to allow the people doing the drawing to have room to insert ports and adapters as they need” :) [Cockburn 08]
    • @_md @everzet a SensioLabsEvent http://www.flickr.com/photos/10849858@N00/2696404813
    • @_md @everzet a SensioLabsEvent http://www.flickr.com/photos/mac_users_guide/3680586328/
    • @_md @everzet a SensioLabsEvent your application
    • @_md @everzet a SensioLabsEvent web gui app your application usersideports test adapter
    • @_md @everzet a SensioLabsEvent web gui app your application usersideports test adapter datasideports dbaccess service in memory db
    • @_md @everzet a SensioLabsEvent HexagonalArchitecture Db rest Logs
    • @_md @everzet a SensioLabsEvent DependencyInversion Higher level modules should not depend on lower level details [Martin 02]
    • @_md @everzet a SensioLabsEvent Naiveimplementation controller use case utility uses uses
    • @_md @everzet a SensioLabsEvent DependencyInversion use case service adapter utility adapter service utility
    • @_md @everzet a SensioLabsEvent Choice Let’sseesomecode
    • @_md @everzet a SensioLabsEvent Choice Future
    • @_md @everzet a SensioLabsEvent Choice Thanks! joind.in/9331 github.com/MarcelloDuarte/hexagonal-symfony