https://matthiasnoback.nl
Web application frameworks are indispensable. You wouldn't want to deal with raw HTTP messages yourself, nor build your own router, or ORM. But if you're not careful, a framework will take over your entire project. Business logic and framework-specific code will end up being mixed together, in controllers, services and entities. Not being able to describe the use cases of your application without also talking about HTTP, or SQL, leads to hard-to-test and hard-to-change application code. Your core code will be tied to your framework, which endangers the future of the project in the long term.
In this talk I'll explain how to make a clean separation between your own business logic and the code that makes your application's use cases available to the world outside. We'll discuss architectural concepts like "layers" and "ports & adapters", and how applying them will make your application flexible enough to deal with a constantly changing environment.
12. Domain vs Infrastructure
● Model
(entities, value objects)
● Use cases
(application services)
● Interfaces for boundary
objects
● Framework-specific code
● Implementations for
boundary objects
● Web controllers, CLI
controllers, etc.
20. Examples
We have a TicketsController with a
buyTicket action. It gets the logged in user from
the session and gets the user's address from the
submitted form data.
30. Sources
● Alistair in the "Hexagone": https://www.youtube.com/watch?v=th4AgBcrEHA
● My upcoming book "Advanced Web Application Architecture"
https://leanpub.com/web-application-architecture/
● Nat Pryce, Steve Freeman - Growing Object-Oriented Software, Guided by Tests
● Vaughn Vernon - Implementing Domain-Driven Design (see the chapter about
Architecture)