Commands, events, queries - three types of messages that travel through your application. Some originate from the web, some from the command-line. Your application sends some of them to a database, or a message queue. What is the ideal infrastructure for an application to support this on-going stream of messages? What kind of architectural design fits best?
This talk provides answers to these questions: we take the *hexagonal* approach to software architecture. We look at messages, how they cross boundaries and how you can make steady communication lines between your application and other systems, like web browsers, terminals, databases and message queues. You will learn how to separate the technical aspects of these connections from the core behavior of your application by implementing design patterns like the *command bus*, and design principles like *dependency inversion*.
7. How do you start a new
project?
Pick a framework
Install a skeleton project
Remove demo stuff
Auto-generate a CRUD controller
Auto-generate an entity
Done
"It's a Symfony project!"
25. public function updateAction(Request $request)
{
$patient = new Patient();
!
$form = $this->createForm(new PatientType(), $patient);
!
$form->handleRequest($request);
!
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($patient);
$em->flush();
!
return $this->redirect($this->generateUrl('patient_list'));
}
!
return array(
'form' => $form->createView()
);
}
from the HTTP request
copied into an entity
then stored in the database
What exactly
changed?!
And... why?
29. It's hard to find out what
happens where
UserController"
ProductController"
CommentController"
CategoryController"
AccountController"
ProfileController"
..."
35. "The heart of software is its ability to solve
domain-related problems for its users.
–Eric Evans, Domain Driven Design
All other features, vital though they may be,
support this basic purpose."