Top WinRT .NET needs

Wednesday, September 19, 2012 gc 3 Comments

WinRT is the new Windows 8 runtime used to create Windows Store apps. WinRT provides language projections (bindings) for C#, Visual Basic, C++, and Javascript.

Loosely speaking, WinRT can be thought of as an object-oriented sandboxed secure replacement for Win32.


In my view, the top WinRT .NET needs are as follows:

Need: Mock testing framework
Mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way (Source). 

Currently, there are no mock testing frameworks such as RhinoMocks available for "Windows Store" app development.

The reason: there is no dynamic proxy generation due to a missing namespace in the "Windows Store" profile: System.Reflection.Emit.

Workarounds
Use other kinds of test doubles such as fakes and stubs instead; this has been my approach.

Microsoft Fakes, is a new framework that generates test code for interfaces instead of dynamically mocking them but in a mock like fashion.  Microsoft Fakes is only available in Visual Studio 2012 Ultimate.

MoQRT like Microsoft Fakes in that it generates the test code for an interface instead of dynamically mocking them.


Need: ADO.NET and other APIs
The API for "Windows Store" apps is very tight and does not contain ADO.NET and Entity Framework. Mobile apps should also work when you are offline. Since WinRT is the future platform for Windows development, then there will be very sophisticated apps developed with WinRT. Sophisticated apps need sophisticated storage.

The WinRT profile is a significant subset of the full .NET 4.5 profile. In addition, many classes were moved into the Windows.* namespace (WinRT) which helps make them available to C++ and Javascript. This just creates an exercise in mapping the old to the new.

On the other hand, WinRT is tight. We are back to time where it is possible for the system to be understood by a single person.

Workarounds
Storage alternatives; these bits are even fresher than WinRT’s so be aware: http://winrtstoragehelper.codeplex.com/
http://winrtdatabase.codeplex.com/
http://siaqodb.com/
SQLite


Conclusion
Despite the needs, developing for Windows 8 still feels years beyond developing for iOS. Developing for iOS is like being back in 1995. Hey, the 90's were a blast, but it is time to move forward. Luckily, tooling is not a problem for Windows 8 development. 

I have been developing with Visual Studio 11 (2012) and Windows 8 since I was given a prototype tablet about a year ago at Build by Microsoft. These needs have been on my mind since.

Please share any new frameworks or workarounds that you discover, and also the needs that are at the top of your list.

Update: Removed one of the needs thanks to a clarification by Jayson Go. It also inspired me to do an entire series on async programming and design.

You Might Also Like

3 comments:

Thanks for your useful conclusions, they saved me a lot of time. It's been a hard time trying to make some automatized tests for Windows 8 apps...

gc said...

@esdras Thanks for the feedback. I am really glad that it helped save you time!

MySql Connector/NET, v6.7.x introduces support for WinRT, basically a subset of the classes in MySql.Data.dll are available for .NET for WinRT (MySqlConnection, MySqlCommand, MySqlDataReader, etc.).