How to handle CQRS from a client-side perspective

后端 未结 2 1332
再見小時候
再見小時候 2021-01-14 04:56

My company is planning to use CQRS architecture on our back-end but as a client-side developer I\'m a bit confused about how to consume a request. Here are the methods that

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 05:36

    Transport is not the only problem, how will you sync the contracts on server and client? I solved this with rendering all my Commands and Queries into a javascript. In my case I used t4 template engine but any template engine can be used. You can read more here

    http://andersmalmgren.com/2014/02/05/typed-javascript-contracts-using-t4-templates/

    As for transport I think REST is fine, if you use for example .NET WebApi and uses the async keyword correctly the framework will reuse the thread when ever there are I/O that is waiting (DB etc)

提交回复
热议问题