Current implementations of Interactor pattern (#4, #51) has several flaws to consider:
- It uses hook methods (like Django's CBV) which may end up in a hook hell when your code flow gets more complex
- It promotes writing more complex code flow when you have to do something non-trivial, i.e. different handling of errors got from different parts of the business logic flow.
- Closely couples calling the interactor with the process of gathering input which might not always be the case, i.e. heartbeat-driven interactions with gathering data being part of the interactions and not the calling process.
- It presumes that there is a single source of input, represented by the
InputPort and RequestModel. Doesn't generalize enough about sources of data, i.e. a model got from a database repository is treated differently than the data got from request.
- It doesn't promote actual modeling of the
InputPort: a generic interface of the RequestModel doesn't have such nice dataclass features as domain objects got from any Repository.
- Separation of validation and actual processing might be somewhat artificial. There's no fundamental difference between validation errors (i.e. this id is invalid) and business process errors (i.e. this item is in an invalid state).
Current implementations of
Interactorpattern (#4, #51) has several flaws to consider:InputPortandRequestModel. Doesn't generalize enough about sources of data, i.e. a model got from a database repository is treated differently than the data got from request.InputPort: a generic interface of theRequestModeldoesn't have such nicedataclassfeatures as domain objects got from anyRepository.