Geeks With Blogs
Ryan Abrahamson

I have been doing development on both the Windows Phone 7 and Windows 8 Metro style applications over the past month and have really been enjoying doing both. What is great is that Silverlight is used for both development platforms. What is frustrating is the "Same but Different" nature of both platforms. Many similar services and ways of doing things are available on both platforms, but the objects, namespaces, and ways of handling certain cases are different.

I almost had a heart attack when I thought that XmlDocument had been removed from the new WinRT. I was relived (but a little annoyed)  when I found out that it had shifted from the "System.Xml" namespace to the "Windows.Data.Xml.Dom" namespace. In my opinion this is worse than deprecating and reintroducing it since there isn't the lead time to know that the change is coming, maker changes and adjust.

I also think the breaks the compatibility that is advertised between the WinRT and .NET framework from a programming perspective, as the code base will have to be physically different if compiled for one platform versus the other. Which brings up another issue, the need for separate DLLs with for the different platforms that contain the same C# code behind them which seems like the beginning of a code maintenance headache.

Historically, I have kept source files "co-located" with the projects that they are compiled into. After doing some research, I think I will end up keeping "common" files that need to be compiled in to DLLs for the different platforms in a seperate location in TFS, not directly included in any one Visual Studio project, but added as links in the project that would get compiled into the windows 7 phone, or Windows 8. This will work fine, except for the case where dependencies don't line up for each platform as described above, but will work fine for base classes that do the raw work at the most basic programming level.

Posted on Tuesday, June 12, 2012 1:24 PM | Back to top

Comments on this post: Windows Phone 7 v. Windows 8 Metro “Same but Different”

# re: Windows Phone 7 v. Windows 8 Metro “Same but Different”
Requesting Gravatar...
I agree, it is a pain when the base/important classes such as XmlDocument just shift their namespace. I have seen something similar regarding your linking the files into the projects for build, but to address your issue with changed namespaces, one of the things I have seen done in RestSharp which seemed to work well, was to include #if #endif blocks, and define separate code for the version. So, you would have something like

using System.Xml;
using Windows.Data.Xml.Dom

I agree it isn't pretty, but as long as the actual CLASS object hasn't changed, the changes are usually only required in the using block.

Hope this helps! - tostringtheory
Left by ToStringTheory on Jun 18, 2012 9:25 AM

Your comment:
 (will show your gravatar)

Copyright © ryanabr | Powered by: