简体   繁体   中英

What is the best way to design big WCF Duplex Services with a Silverlight application?

I am currently working on a silverlight application, more precisely a game, that has 2 states : Lobby and Game.

I created my service application to reflect that structure. I created a LobbyService to handle all lobby related operations and a GameService to handle all actual game operations. On top of that, I have a third service 'GeneralService' that handles operations that are shared between both states (chat, system messages, etc...).

I am pretty happy with the design itself, but reading up on the scalability of Duplex services has lead me to believe that it may not be a good idea to have 3 services, which potentially means 2-3 duplex channels opened at the same time for each client, thus taking up more resources on the server's end.

So my question is, is it better to have only 1 WCF Service (.svc) for everything (maybe just by implementing 3 different data contracts) or should it be ok to keep the current design and split the services logically into their own service?

Thanks!

据我所知,WCF Polling Duplex服务在性能上有一些缺点......可能更好地使用这个项目: http//laharsub.codeplex.com/为您的应用程序。

If there are security / rights differences between the LobbyService and the GameService, I would keep them as two different services.

You could purhaps allow these services to Inherhit from the GeneralService, thereby having that functionality available in both services.

This reduces the number of duplex channels open for each client, while maintaining the structure or your services.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM