Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.

2019 03 04 Interactor

Endre Bock edited this page Jan 31, 2020 · 9 revisions

Making Enchilada

Enchilada

Robert C. Martin, the author of the Clean Code and Clean Architecture books, gave a the principle to do TDD(in a practical way). He have made over the years many presentations like:

In the 2nd video I saw the first time that pattern and smiled alot about "Enchilada". Since that is all cool architected stuff "Enchilada" for me.

The first steps

Ok, so how we can use it now in that small experimental project?
At last time I introduced the dependency injection, which made the responsibility more clear. Especially for the Themes and Language Manager.
At this point I what to start with some Interactors. Of course the cases are really small:

  • Change Themes
  • Change Language

What is business wise to do?

  1. Is theme/language already selected, when do nothing.
  2. Tell the manager the new choice.

For the first steps, we want ignore the View Model and the Presenter. Also instead of Entity Gateway I'll use the Manager directly. We come later back to that points.

What I want to archive?
Each work need a goal. We will not just "do like R. C. Martin says". We want to understand. So the target this time, will be, that the interaction between Managers and "Controller"(still the View isolation stay missing) will be cutted by the interactor.
That allow an more easy change on the managers without coupled to the controlling area, like currently.

Edit 2019 03 06

As I realized, just randomly, is the constructor of the Settings just each page enter called. So even if I create the component in the project index.js, it seems that the real create first happened, if the component displayed/needed.
So I don't need to care about having to much "view" objects in the injection area ;-)

Clone this wiki locally