Silverlight and Windows 8

by Ciprian Jichici 16. September 2011 02:34

Another highly speculated subject in the past few months refers to the future of Silverlight in the context of Windows 8’s release. The reality is that there’s genuine concern out there, as there are significant investments in SL, especially for Line-of-Business applications. The reminder of this post focuses on the this particular scenario: moving forward in a Windows 8 world with SL-based LOB apps.

Now that we could get Windows 8 in our hands, some things are becoming more clear. First of all, Silverlight continues to be a first class citizen in Windows 8 desktop apps. The desktop version of IE 10 fully supports Silverlight and your apps will run the normal way. More than that, Microsoft continues to make significant efforts with Silverlight (version 5 has just reached the Release Candidate milestone). So, from this point of view, your SL investment is more than safe.

The story changes when it comes to Metro apps. Turns out that the Metro version of IE 10 does not currently support plug-ins (no SL, no Flash). So you won’t be able to run your SL app in Metro mode. At first sight, this sounds like a bummer. After a more detailed analysis, things start to make some sense.

First of all, I’m not sure you really want to run a SL app as-is, in the Metro browser. Mostly because you designed your SL app from the ground up to work in a keyboard-mouse environment. Which is great in a desktop environment. But sucks in a touch environment. Sucks to the point of being close to unusable.

Closely related to the above is productivity. I’m not sure the tablet environment will ever be extensively used for productivity apps. I just don’t buy into that. In a LOB app, there is nothing yet to replace the good old keyboard and the mouse. You don’t believe me, use only a tablet for a couple of months for productivity apps. It just gets on your nerves. So, most probably, you will want to provide just a portion of the user experience in a Metro app. Which means that you need to write code anyway.

Another point to take is that there are patters like MVVM that make o good work of making changes in the View less painful.

Finally, you must take into consideration that Windows 8 Metro apps have native support for XAML. The XAML syntax is virtually unchanged, so in theory you can port your SL XAML to Metro XAML. Again, I don’t see much value in it (due to usability issues in a touch environment), but it’s possible.

In a nutshell, the story goes like this:

  • You will run your SL LOB apps unchanged in Windows 8 in desktop mode
  • Should you need to provide a Metro version of your SL app, you will probably have to redesign anyway (because of design and productivity issues)
  • Patterns like MVVM and native XAML support in Windows 8 Metro apps can make the implementation of the Metro version of your SL app less painful

Tags: ,

Silverlight | Windows

.NET Gets a New Lease of Life

by Ciprian Jichici 16. September 2011 01:51

For the past few months, there has been a somewhat heated debate over the future of .NET on the new Windows 8 platform. Folks were concerned about the possibility of having to abandon their 10+ years of investment and being forced to move towards other things like C++ or JavaScript. Don’t get me wrong, both C++ and JavaScript are amazing technologies, but for a hardcore .NET developer, they represent alien worlds.

With the new release of Windows 8, the obvious was officially confirmed. Not only .NET is here to stay, but it gets even more important. On one hand, it gets tons of new features for server-side development. On the other hand, it remains a first class citizen on the client too. I’ll leave the server side for a future post and I’m going to focus in the reminder of this post on the client story.

The first thing you need to understand is that Windows 8 comes with the full version of .NET 4.5. Here’s the proof for that:

image

The version of clr.dll (located in C:\Windows\Microsoft.NET\Framework64\v4.0.30319) indicates 4.0.30319.17020 (as opposed to the latest .NET 4.0 version which is 4.0.30319.225 if my memory serves me well).

The second important thing to understand is the way in which apps are run on Windows 8. There are basically two major categories of apps: desktop apps and Metro apps. The following picture shows the high level architecture of this approach:

clip_image001

A desktop app is the type of app we’re all used to from previous versions of the OS. When it comes to .NET, this is a full .NET client application, with all the stuff in it. Obviously, old apps will run without a problem. Whether they are WPF apps (like Visual Studio for example Smile ), Silverlight, or any other type, they will just run. I want to be crystal clear on this: DESKTOP APPS ARE NOT SECOND CLASS CITIZENS IN WINDOWS 8. They continue to represent an extremely important part of the platform.

A Metro app is they new type of application that uses the new interface style introduced by Windows 8. In a nutshell, this type of interface is based on the Metro UI concepts, and it’s optimized to be used in both touch and keyboard-mouse scenarios. The important thing to understand here is that these apps are run in a protected environment. Which makes a lot of sense since this is the “tablet” world where you’re interested in providing an environment for secure and safe applications that can be downloaded and installed in a very easy way from an app store. The protected environment is provided by an AppContainer (a new concept introduced by Windows 8). In this protected environment, the app will be allowed to do only certain things. Simply put, it’s a locked down medium where you have to play by the rules.

As you can see in the picture above, among the types of Metro apps you have the C#/VB apps (aka the .NET apps). Now this is where things are becoming interesting. You might have noticed that they run on top of something called the WinRT (Windows RunTime). WinRT is basically a set of native APIs, highly optimized, that run on top of the OS kernel itself. Understanding the role of WinRT is key to understanding this whole new model of app development.

WinRT inherits a lot from .NET. To name just a few things:

  • Metadata (Because native code does not support metadata embedded into it, the metadata is stored in separate files with an WINMD extension. These files are located in C:\Windows\System32\WinMetadata. The cool thing is that the format used is the .NET format – with some minor additions. This means you can even ILDASM these files. Although it’s a .NET format, the metadata approach in WinRT is unversal, meaning that it is available across all languages)
  • .NET style namespaces
  • .NET compatible base types
  • Native support for XAML

So, as you can see, .NET had a fundamental influence on WinRT. BUT WINRT IS NOT .NET. It’s a set of native APIs available for all Metro languages (C#,VB, C++, JavaScript). To clarify even more:

  • WinRT is the API used for Metro apps – it is not available for desktop apps
  • Win 32 is the API used for desktop apps – it is not available for Metro apps

But WinRT also introduces some fundamental new approaches:

  • Asynchronous calls are used exclusively in lots of places (as opposed to previous approaches where the developer had a choice between synchronous and asynchronous – this just emphasizes the laser focus on performance in Windows 8)
  • No message loop (believe it or not, it’s not there Smile)
  • No GDI stuff, all graphics goes via Direct X (it’s not yet very clear what is the current position of XNA in this, we’ll have to wait and see)

Now that we are clear about the context, let’s get into the details of Metro apps developed in .NET. When you use the C# or VB Metro app template, you are basically developing against a .NET framework profile named .NET Framework Core 4.5. This means that there are only certain things from the full version of .NET 4.5 that you can use in your app (much like we had in previous versions with the Client Profile). In addition, there is only one AppDomain (the Default). But don’t worry, all the cool things are there: generics, LINQ, and so on. The new thing is that you can also use WinRT namespaces as first class citizens in your .NET app. This is possible because of the metadata model I described above.

What you get when you compile you code is plain old MSIL which runs inside the .NET CLR. The interesting part here is that when your code gets JIT-ed or NGEN-ed, based on the WinRT metadata that you refer to, the WinRT metadata references are transformed into v-table calls into the native libraries.

In a nutshell this is the story with C#/VB Metro apps:

  • They run in the CLR as all .NET apps do
  • You get the power of .NET 4.5 (except for constrains imposed by the Core profile)
  • You consume transparently WinRT libraries (via the new metadata model introduced by WinRT)
  • Your execution environment is further constrained by the OS (via the AppContainer)
  • Your UI is based on XAML which has native support in Windows 8 Metro apps

Well that’s about it. Obviously, all info in this post is based on information available right now, which might change. It could also be that I misinterpreted some of the info and had drawn some inaccurate conclusions. But the big picture is clear beyond any doubt: .NET is here to stay in Windows 8. You can use it either for desktop apps which benefit from the full power of the OS and the .NET Framework, or you can use it to develop Metro apps which benefit from the CLR and the native, high performance, layer of WinRT.

To paraphrase a classic: “the rumors of .NET’s death are greatly exaggerated”. Not only it’s present in Windows 8, but it’s even taken to a whole new level, and some of it’s key concepts have been broadened and made available throughout the entire OS, as native implementations.

Stay tuned for more great stuff coming from //BUILD.

Tags: , , ,

Windows

The Verdict Is Out: It's the Phoenix

by Ciprian Jichici 14. September 2011 09:39
Wow!!!!!

I have just attended what was perhaps one of the coolest keynotes ever at a Microsoft conference. And to tell you the truth, I have never been in my entire career as enthusiastic as I am right now! Those who know me personally know that it takes quite a lot to make me say wow and that I have a tendency to be critical rather than supportive. But the Windows 8 story I saw today is one of those rare things that felt like being the right thing from the very first moment. You know the feeling? Everything just clicks in and seems to be the right thing, at the right time, in the right place. I think I just fall in love with Windows 8 today.

As an overall note regarding the keynote, not only it was sharp and cool, but it benefited from one of the best deliveries I've seen for a long time. A relaxed and confident Sinofsky put up an excellent performance. I've been writing about this previously, and it seems to get better and better. I'm talking about a sense of coolness projected by Microsoft. Seeing the Windows big boss wearing snickers and jeans, talking about the bold decisions taken in order to re-invent the OS was very refreshing.

It's hard to decide where to start, so I'll just stick with my first love: the developer story. As you probably already know, a very heated debate is going on for quite some time regarding the Windows 8 developer story. Folks were concerned about the future of .NET, Silverlight, and XAML. It took Sinofsky one slide to clear things: XAML over C#, VB, and C++, and HTML + JavaScript. End of story. Windows 8 supports both. An amazing demo showed a Silverlight app taken from ScottGu's blog, recompiled, and run on Windows 8. It's what I've been expecting to hear and it was confirmed today.

The hardware story is equally amazing. First of all, Windows 8 will run on x86, x64, and ARM. It will run on every imaginable form factor out there. And the boot time, oh yes... We all know that boot times were one of the things which attracted lots of criticism. Well, that's history. We've seen today systems running Windows 8 booting faster than the time you need to open the lid. But that's just part of the story. Tremendous efforts have been put into optimizing the performance of the OS, and this really shows. Sinofsky showed one of his old netbooks with 1Gb of RAM and an Atom proc, running Windows 8 with impressive results. More than that, things like hardware acceleration are becoming standard in every aspect of the UI.

But perhaps the most amazing thing about Windows 8 its the UI. Simply put, it's just fantastic. Being based on the Metro concepts, it's fast, responsive, and just feels good. After what we've seen today, even the most skeptical attendees were convinced that Windows 8 is excellent for portable devices, especially for tablets. It was about time to have this change, and I believe Microsoft met and even exceeded expectations regarding the new Metro style UI.

It's been proven once again that under immense pressure, Microsoft is able to create amazing stuff. For me, it's beyond any doubt now that Microsoft is set on a course to dominate the consumer space once again. They basically re-imagined Windows from chipset to experience on all major areas: capabilities, scenarios, and form factors. What they got is an amazing OS which, at least for me, is everything I hoped for and a lot more. I just can't wait for the next months and years of developing great solutions!

Well, that's it for now. Time to get into the details. Stay tuned for lots of interesting things to come...

Tags:

Windows

Microsoft's Ground Zero

by Ciprian Jichici 13. September 2011 17:40

For years, Microsoft's dominance in the world of client operating systems was sort of undisputed and taken for granted. Windows, Office, and Internet Explorer were THE choices out there. Windows Mobile was THE choice when  it came to smart phones. Even more ahead of it's time, the Tablet PC made Star Trek look more science fact than science fiction. All in all, the dominance was obvious, strong, and, at times, crushing for the competition.

With the strong grip on the client side of things, Microsoft turned its attention to the enterprise, where at that time it was merely an underdog. Playing on the strengths of Windows and Office, the folks from Redmond paved the way for the spectacular rise of SQL Server, SharePoint, BizTalk and of course, .NET. After years of painstaking work and tremendous efforts from the product teams, it looked like Microsoft was finally on the course to become a major enterprise player.

But then something happened along the way. Something that, for me, represents the essence of information technology. It's the thing that makes me love this field, the thing that justifies the airports, the long flights, and all the other prices I have to pay to be an actor in it. That thing is innovation.

In a blink of an eye, the tide shifted. Windows Vista was an OS that even a Microsoft technology fan like me disliked profoundly. Windows Mobile was sent to oblivion by iOS and Android. Internet Explorer started to feel real heat from FireFox, Chrome, Safari, and Opera. Despite the rivers of digital ink flown in debates over what happened, the root cause of the shift was rather simple. Blinded by the enterprise wars and the relative warmth of the client world top dog position, Microsoft lost the consumer world. In this world, it moved from pedal-to-the-metal innovation mode into don't-need-to-do-anything-yet mode. It choose to fight the iPhone with Windows Mobile and the iPad with Windows 7 running on slates. To me, those were the times that qualify as a genuine Ground Zero for Microsoft. Not because of sales, those continued to be stellar. Not because of Windows and Office licenses, those went on and on in the hundreds of millions. But because of the apparent loosing of touch when it came to innovation in the consumer space.

Many were quick to announce the end of the Microsoft era, and there were even voices that went as far as predicting Microsoft's end as a software company. I think those persons and those voices were and still are very, very wrong.  Why? Because the same thing (innovation) happened again, this time, on Microsoft's side.  The signs quickly added up. The  phenomenal success of XBOX and it's Kinect sensor, the high quality of Windows 7, Windows Azure, and Windows Phone were just a few of them. Proving able to learn the new rules of the consumer game, Microsoft looks now to be set on a course to re-conquer the consumer space of the 21st century. It won't be as easy as the first time, but it's definitely possible.

I'm writing this post from 40000 feet above Europe, while flying to Anaheim, CA, for the BUILD conference. All signs indicate that this week will prove to be crucial for the long-term future of Microsoft's position in the consumer space. The bar is set vey high and expectations are skyrocketing. Everybody wants to see whether Microsoft is able to re-invent Windows and make it a player in the post-PC era. According to many, Windows 8 will prove to be either the Phoenix or the Nemesis of Microsoft. In my mind, there is absolutely no doubt on how things will go. I believe this will be the week when the game changes, the week when Windows will shine once again. It will mark a turning point defined by Microsoft adding the final and most important piece to the grand scheme of rebuilding its consumer Ground Zero.

Stay tuned for some fantastic news!

Tags:

Windows