The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

bsonnino (3) [Avatar] Offline

In chapter 14, you've created two projects for the model, one for the service and one for the metro app.
While I think that's a great way to use a single set of files to define the model in both sides (and compatible with Silverlight, Windows Phone or WPF), I think it's also a great opportunity to introduce Portable Class Libraries. That way you would only need one project and could use it on both the client and the server. What do you think?

Psychlist1972 (177) [Avatar] Offline
Re: Model class libraries for services
This is one place where I disagree with some of the folks on the product team.

PCLs are great, but I've always ended up running into cases where they box me in. At that point, you have to either live with it, or go and create all the separate projects that I do from the start.

The multi-project approach has no dependency on PCL, allows you to use *any* libraries you want, enables even different client and server references, allows you to extend classes using conditional compilation and partial classes, and more.

That said, as mentioned in another post here, I'll mention PCL as an option because it certainly does work in many cases.

bsonnino (3) [Avatar] Offline
Re: Model class libraries for services
I agree with you that it's not a solution for every problem, but it can be shown as an alternative to the two project solution, especially when you have simple POCO classes that are exposed later by ViewModels.