-
Notifications
You must be signed in to change notification settings - Fork 2
Architecture
M. Bellucci edited this page Oct 28, 2019
·
2 revisions
Inspired by this Robert.C Martin talk:
Principles:
- Architecture is not a bunch of tools
- Architecture is about INTENT
- The web is a delivery mechanism (I/O device)
- Business-rules based architecture
- Our architecture main concern is to keep business rules isolated from the rest
- It clarifies functionality by making the business rule the center of our architecture
- Use Case Driven Approach
- User submits a form
- Delivery mechanism takes data and creates a structure called RequestModel
- Interactor receives this request order model
- use data to pass to the entities ( orchestrates entities)
- gathers all the results data and creates a result model
- it passes the result-model to the output boundary which is implemented by Delivery Mechanism and somehow is delivered to the user.
- Once interactor returns a response model a presenter receives it.
- Presenter's job is to take a response model and translate it into a view model.
- The view model should be so stupid that we don't have to test it.
- Presenters are testable.
- Databases are I/O devices with interesting features
- The database is a detail
- Make DB a plugin to the business rules.
- Interactors will talk to EntityGateway Interface
- EntityGateway implements every possible access to the database
- And returns (or call??) entities.
- In the Interactor test you can stub your database.