Today I spend 3 pomodoro *reading* a book written by the famous Dino Esposito on Modern Web Development. My main goal was not to get into the details of the technology but mainly to get an idea of the approaches in design and architecture. I like his style, pragmatic and to the point.
My main takeaway are:
- Design your API carefully. If a developer can use an API the wrong way, he will.
- Event storming is an effective approach to explore the business domain (Alberto Brandolini). It consists of getting developers and domain experts in a room together to ask questions and find answers.
- It is highly recommended to have an Application Layer that sits in between the presentation layer an the rest of the system. It is the part of the business logic that implements the workflows behind use-cases, orchestrates any tasks triggered by the presentation. The domain logic, conversely, is the part of the business logic that implements business rules that don’t vary according to use-cases. The domain logic is reusable across multiple presentation layers. The author tend to organize application layer methods in classes that go hand in hand with controller classes. The main benefit of having an application layer is keeping workflows distinct from business rules and domain-specific processes.
- There are two increasingly popular approaches to implement scalable websites:
- CQRS: You generally use a domain model only in the command stack. The query stack is made of plain data access code and use simple DTOs to bring data to the presentation layer.
- Event sourcing: You store events and, if required, you process events to extract projections of data that take snapshots of the current state of the system. An event is immutable, so logs of events can be applied with no risk of creating concurrency and synchronization issues.
- UX Driven Design: the author recommend a top-down approach in website development to emphasize the presentation layer and the actual screens the user will end up working with. Mobile users tend to have high expectations when they navigate to websites from their mobile devices.
- These days, what’s more important than knowing technology is knowing design and architecture patterns, best practices, and application solutions that have a successful record. The point today is no longer to use the latest release of the latest platform or framework. The point is just to give customers what they really want.