zhukovdm / smartwalk

🗺️ Web application for keyword-aware route search

Home Page:https://smartwalk.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve Dependency Injection use cases

zhukovdm opened this issue · comments

Dependency Injection can be more general, than today's implementation. In particular, we may get rid of TContext and avoid creating explicit handlers as the one below.

var result = await new AdviseKeywordsHandler(ctx.KeywordAdvicer)
.Handle(new() { prefix = request.prefix, count = request.count.Value });

Perhaps a good direction is to separate SearchController into smaller different controllers so that we can inject an instance of a handler.

An example of multi-level dependency injection is at https://github.com/zhukovdm/exrates/.