... or rather, a complete lack of WCF Duplex Services because they're more complex than they would appear.
I was looking for a project to start with Prism and needed something that had a good separation of modules to use as a test project. I decided on a multiplayer Mancala game, since Joshua (my 7 year old) and I have fun playing it and it would be a cool computer-y thing we could do together. I thought that having a sidebar to chat in while we play would be nice, and maybe later I could add voice chat functions too. The game itself is pretty simple, but I've decided to add a little complexity into the implementation by setting both boards with the player's side down. This means that I can't just push the same UI to both clients and so I'm forced to abstract the actual game away from the visual representation of it. Which is a good thing. In any case, I got as far as making some basic classes to represent the game and the players and figured I would write a service that would handle both the game moves and the chat.
WCF Duplex services is really the way to go here. I suppose this might be possible using sockets, but I have a feeling that I couldn't really make that user-friendly without a LOT of work (and I don't see asking a 7 year old to punch a hole in his firewall as going very well). But a duplex service should be able to handle the two way traffic just fine and in a non-threatening way. I figured that I could just fire up the MSDN documentation and have at it.
No way. In the end, the documentation suffers from either over explaining how many different ways there are to do everything or providing no explanation at all for what I'm trying to do. There seem to be at least 5 namespaces involved and, it first appeared, heavy use of both attributes and overrides of base functions. Neither of these things scare me specifically, but it means that I have to dig deep into the base classes to see exactly what I'm overriding or what exactly consumes the attributes that I'm writing and my goal here really isn't just to get this one project done, but to learn something in the process. So most of my coding time today was really spent reading docs and trying to find a good example project.
I managed to find a good example, which I'll chew on over the next couple of days, over at Coding4Fun, which has some other great projects that I've learned a lot from in the past. Giovanni Montrone wrote an article on developing a file transfer application in Silverlight 3, something I've wished for in the past when chatting with friends whose IM capabilities are less than stellar. It supports basic chat and file uploading, which should be close enough to adapt for my purposes. As I type this, I'm thinking that it might be something that I could turn into a general purpose library for Kongregate-style Silverlight games. Either way, I think the process of burning through links and documentation was worthwhile, even if at the end of the day I still can't tell you exactly how this stuff works. It's going to make for a good project to learn Prism, Unity, and WCF, and probably a good chance to practice a lot of refactoring. More to come...
80d2b8d4-2927-4c92-8b94-bdcaa90a368d|0|.0