Flow of Control - NeoSOFT-Technologies/rest-dot-net-core GitHub Wiki

The Flow of Control begins at the controller, moves through the use case, and then winds up executing the presenter.

The flow of control can be understood by following diagram,

FlowControl

Get All Categories Flow of Control

  • A request is received by the CategoryController then the GetAllCategories action is invoked.

  • The flow of control begins at the controller, moves through the use case, and then winds up executing the presenter(In Clean Architecture terms, the WebUI would be the presentation layer).

  • Then the Use Case(Application-specific business rules) needs to call the presenter by using a great design pattern, Mediator. It has two great benefits that fit really well with the Clean Architecture:

    1. Objects delegate their interaction to a mediator object instead of interacting with each other directly.
    2. It should be possible to change the interaction between a set of objects independently.
  • The GetAllCategories use case asks the repositories about the Catogories. It will call the query GetCategoriesListQueryHandler.

  • Then the HTTP response message will be build by Base Response.

  • The CategoryController asks the presenter for the current response.