I'll just add some WCF Duplex Services...

... 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...


Posted by: Raumornie
Posted on: 9/23/2009 at 11:55 PM
Tags: , ,
Categories: Software Kata
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (16) | Post RSSRSS comment feed

Comments

Download youtube clips United States

Tuesday, November 02, 2010 7:37 AM

Download youtube clips

I like your site design. What template did you use ?

luzne-zwiazki United States

Monday, November 15, 2010 11:54 AM

luzne-zwiazki

I am sure, that i will come back to your site soon. Keep us posting interesting articles

Burton Haynes United States

Friday, November 26, 2010 12:54 AM

Burton Haynes

I cant believe the amount of fantastic info you have on your weblog. I've learned a lot from it. Will be coming back soon…

Andrew Pelt United States

Saturday, November 27, 2010 1:34 PM

Andrew Pelt

I just sent this blog post to a friend of mine

payday installment loans in rockford il Croatia

Tuesday, December 14, 2010 9:10 PM

payday installment loans in rockford il

ery cool article!

no verification payday loan Georgia

Tuesday, December 14, 2010 10:32 PM

no verification payday loan

ery nice post!

faxless payday loans direct lenders in Hawaii Libya

Wednesday, December 15, 2010 1:48 AM

faxless payday loans direct lenders in Hawaii

good read. Added to bookmarks

payday loans online in Oklahoma Puerto Rico

Wednesday, December 15, 2010 2:12 AM

payday loans online in Oklahoma

excellent article. Subscribed to RSS

loans payday in South Carolina United States

Wednesday, December 15, 2010 6:39 AM

loans payday in South Carolina

n most occassions I don't post comments on blogs, but I would like to say that this post really inspired me to do so. Really nice post

easy payday advance Egypt

Wednesday, December 15, 2010 10:05 AM

easy payday advance

excellent article. Added to bookmarks

cash til payday loans in Illinois bd

Thursday, December 16, 2010 2:10 AM

cash til payday loans in Illinois

Big Thanks for the article... RSS feed added

payday loans mississauga Trinidad and Tobago

Thursday, December 16, 2010 9:11 AM

payday loans mississauga

good read, I merely passed this to a colleague, he was doing a little amount of research on this subject

second chance on line las vegas payday loans Singapore

Thursday, December 16, 2010 9:44 AM

second chance on line las vegas payday loans

good post. Subscribed to RSS

payday loans in scarborough Bahrain

Thursday, December 16, 2010 11:26 PM

payday loans in scarborough

Great looking blog really...

personal loans no credit check Guatemala

Friday, December 17, 2010 5:57 AM

personal loans no credit check

payday loans in Oklahoma Latvia

Friday, December 17, 2010 6:26 AM

payday loans in Oklahoma

good article, I merely passed this to a colleague that performing a small amount of research on this matter

Comments are closed