开发者

NServicebus for Client/Server Communication?

I am starting out on a new project and have fallen in love with the concept of a Service Bus to connect your services on the backend. Since I was mostly doing Web development so far I was simply connecting the Web tier to the services over the ESB.

Now I am starting out on a Desktop Application that requires Server/Client connectivity, and an ESB seems like a good idea since it forces an Async Model by default and also allows some flexibility in distributing load. Also Pub/Sub makes a lot of sense in many cases..

You read a lot on the internet on ESB, Ayende also did his Alexandria App that used an ESB in a Request/Reply scenario. Then others say doing Request/Response over an ESB is a bad thing..

What are the big problems I am likely to see with a ESB backing my Server/Clien开发者_如何学运维t communication?


Take a look at Udi Dahan's post on CQRS(Command/Query Segregation). This will point you to the decision points you need to make. The main challenge with a client apps is creating a message pump in the background and marshalling that data back to the UI thread. For the web, segregating queries into a more denormalized store has worked well for us, but this methodology will cause you to think a bit differently about how you build your UI. It does greatly simplify the model as you don't need to map objects 47 times to get data, which I've always struggled with justifying. Obviously the downside is more moving parts, but we found it to be worthwhile.


This is a really interesting question for me because I have asked the same question from the opposite viewpoint - coming from WinForms to Web (though on the Yahoo group, not SO).

Async request/response on WinForms worked great for me out of the box. The UI just fires off the query command and forgets about it. If a response (with query results) happens to come in, and the view that wants it is still available, the data is populated to the view.

I am trying to form a view of why it is "bad" to use the ESB for queries, and the best I can come up with is that the async model doesn't easily fit in with the requirements of building up a page for a web app. Also there's a bit of a performance penalty over other more direct query methods.

I don't like the answer "just because", so I look forward with interest to the other responses to your question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜