What would your application look like if it was 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.
12. @_md SensioLabs
“Key in making great and growable systems is to
design how its modules communicate
[and not] what their properties and behaviours should be.”
ViewpointsResearchInstituteSource-BonnieMacbirdURL-http://www.vpri.org
13. @_md SensioLabs
real procedure Sum (k, l, u, ak)
value l, u;
integer k, l, u; real ak;
begin
real S; S := 0;
for k := l step 1 until u do
S := S + ak;
Sum := S;
end;
x := Sum( i, 1, n, V[i] );
24. @_md SensioLabs
“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]
44. @_md SensioLabs
/**
* @Route(service="controllers.skills")
*/
class SkillsController
{
private $competencyFinder;
private $raterFinder;
!
public function __construct(CompetencyFinder $competencyFinder)
{
$this->competencyFinder = $competencyFinder;
}
!
/**
* @Route("/skills", name="skills")
* @Template()
* Show the skill for the learners role
*/
public function indexAction()
{
return ['competencies' => $this->competencyFinder->findDictionary()];
}
}
49. @_md SensioLabs
public function onSuccess(Event $event)
{
$this->flashBag->add('success', 'Project has been created.');
}
!
public function onFailure(Event $event)
{
$this->flashBag->add(
'failure', 'Failed to create project.' . PHP_EOL . $event->get(‘reason')
);
}