I'm looking to implement a chatroom interface for an ASP.NET page. I'm in the process of learning WCF and it seems that it is appropriate for a chat application. Before I get too involved into WCF I want to be sure it is the right choice to make for developing a chat application in ASP.NET. Can anyone provide any feedback?
I found a few example applications that primarily use Silverlight with WCF for chat applications. Are there any limitations if I choose not to use Silverlight?
Also, any alternatives to WCF that I would have full control over would be very helpful. I'm aware I can use AJAX polling, feedback on advantages/disadvantaged are all appreciated. Thank you.
You can use either Native ASP.Net approach or Silverlight approach to develop the good looking chat application.
The only concern is how your application is responsive to the end user. Here responsive means how the system let the user to feel the presense of other users and real time chat experience. This is refrenced sometime as really real time. (Like gmail & facebook webchat allows the user to see the user presense saying "user is typing or idle")
You can achive this level of realtime appearance using both these technologies. But implementation are little different.
In order to achive this, you must implement a duplex communication between the browser and server. So then server will notify the client if there is any response from other user or his presense.
In ASP.Net way:
In SilverLight way:
A duplex service contract is a message exchange pattern in which both endpoints can send messages to the other independently. A duplex service, therefore, can send messages back to the client endpoint, providing event-like behavior
Hope this helps
Silverlight has several advantages including UI flexibility, greater WCF control and being able the same programming language/tools on client and server. If you chose Silverlight you have more flexibility over how data is transferred to and from the server, such as what protocol to use (TCP, HTML) and how to transfer data. The UI options with Silverlight allow you create a very rich and compelling experience with the complete designer support and animations.
A simple HTML client may be faster to create since you would not need to learn how to use Silverlight to create the equivalent functionality. Even with just HTML, css and javascript, you can still have a very nice user experience just look at gtalk as an example. Using modern javascript libraries like jQuery make it even easier to create a complicated application quickly that is still easy to understand and maintain.
If you are looking to play around, have some fun and learn something new perhaps consider using a ASP.NET client with a basic WCF RESTful interface. You will still have alot of control and flexibily on both the client and server regarding what messages to send, how the client makes requests, caching on the server, etc. For an easy to digest post regarding RESTful WCF check out this post by Rick Strahl.
I wrote a similar type of application to perform notifications within an ASP.NET application and was waffleing between doing push vs. polling from the client (see this stack overflow question). I was inspired by this chat example which used a very simple interface and push notification for the client.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With