1

I want to start a simple windows P2P instant messenger in C#

I'll put here some questions I need guidance for, in the conceptual and technical aspects.

Let's say the user had successfully logged into his account, and the app needs now to get and populate the list of contacts (saved on my apache/php/mysql server).

  • How would you implement the data retrieval (important) and later population of the contacts list? Is WebClient.DownloadString[Async] a good approach? Is there a better way?

  • How often should the app check for updated list (online/offline statuses). Recommendations accepted.

  • How can I parse JSON data on C#.NET (Visual C# Studio 2010) I will get JSON strings.

Thanks!

Dandy
  • 303
  • 5
  • 14
  • 1
    Your three questions should be broken out into 3 separate SO questions. Also, it would be best if you made an attempt and if you can't get it working bring what code you have to SO and we'll try to help guide you in the right direction. This question is far too broad for SO. – Corey Sunwold Jul 09 '11 at 21:47

1 Answers1

0
  1. You should have user relations in a seperate table that links user ID's. The data retreival should happen through a stored procedure that collects all data for that user on the server and sends them to the user.

  2. You should use the Observer pattern for the update system, then whenever there is a status change you send a message to the user client, that changes the status.

  3. Not sure but I'm pretty sure there is library functionality for this.

MrFox
  • 4,852
  • 7
  • 45
  • 81
  • 2
    For the JSON parsing library it makes sense to use: Json.NET http://json.codeplex.com/ – Carlos Quintanilla Jul 09 '11 at 22:32
  • Can you provide more information on the observer pattern and it's application in web-based applications? (links, books, examples of applications using it) I've seen it only in local desktop applications so far. – dtb Jul 09 '11 at 22:35
  • Thanks! How should I use the Observer pattern applied in IM terms? What would be the subject and how to "observe" it? – Dandy Jul 11 '11 at 23:46