However, moving from traditional web development to WinJS (a.k.a. Metro-style or Windows 8 applications) development can be a bit of an adjustment if you are an ASP.NET developer by trade. Therefore here are a few tips to help you keep your head on straight as you make your way into WinJS development.
- You can take your existing skills as a web developer and apply them to WinJS, but not everything transfers and you’ll have to fill in some gaps.
- Grasping the inherent difference between stateless and stateful applications and learning the new UI framework is at the core of a successful switch from ASP.NET to WinRT applications.
1: There is No Server
As web developers we are used to stateless client-server architecture of our applications. We are used to the concept of a distinction between server-side code and markup. We’re used to the constraints of session, view state and have adapted to the benefits of Ajax to help increase the effectiveness and responsiveness of our applications. It might seem like I am stating the obvious because WinRT development after all is Windows development by definition, but when you use web technologies (that you've grown accustomed to using for the last decade or so) without the existence of a server - it can be a bit of a paradigm shift without a clutch. Further, web servers are expected to be more or less reliable and available. A Windows 8 application can be suspended, resumed or even terminated with very little ceremony.
- Classic stateless challenges disappear
- Classic stateful challenges appear (For instance, once you load a CSS file into a page it doesn’t go away just because you navigate to a new page. This could cause problems if you’re not careful.)
2: No Generated Markup
3. There is a Learning Curve
Further, the WinRT framework comes with a host of new controls, animations and design considerations that were never at play in the past. For instance you may be a wizard at jQuery UI, but those same controls may not present as well in a Metro application as they do in a web application.
- Working with managed code in WinRT is similar to, but not the same as writing the run-of-the-mill .NET application
- There are new design considerations and UI patterns to learn and apply appropriately
4. It’s a ‘State’ of Mind (Bonus!)
As I’ve alluded to above, a big part of making the switch is fully grasping stateful application development. Let me give you an example. ASP.NET developers are used to a page event lifecycle where a request comes into the page which is usually first handled by Page_Load then control event handlers fire then you have a final chance to interact with the page at Pre_Render and then you’re done. Many of these events are indicative of the statelessness of a web page. In a Metro application you’ll handle the activation event (roughly equivalent to the jQuery ready event) , the suspended event and the restored event (which coincidentally are indicative of the statefulness of a native application).
What Do You Think?
What other aspects of the transition would you include in this list?