WINDOWS CLIENT GUIDANCE | ||||||||
MICROSOFT PLATFORM SOLUTION ARCHITECTURE FOR THE APPLICATION DEVELOPER | ||||||||
PREFACE | ||||||||
|
INTRODUCTION |
|||||||||
Don’t get me wrong. ASP.NET is beautiful from every way that you look at it. It is elegant below the hood in terms of the .NET framework classes and its integration with Microsoft Internet Information Server (IIS). And it’s elegant above the hood from the perspective of how darn easy it is to build powerful and functional web applications. It truly has revolutionized web application programming. Having said that, ASP.NET is limited when contrasted to Windows application development technologies like WPF and WinForms.
Like it or not, TCP/IP is not an elegant protocol (when compared to those beautifully efficient binary protocols of the past). TCP/IP is a disconnected protocol which results in the “stateless programming” handicap. In one of the greatest innovations in technology history, Cisco made a bad thing worse when they created those original 2500 series routers. This culmination of a connected world resulted in a spaghetti mess of router hops. When I make a landline telephone from Singapore to San Diego it’s 3 hops. When I use a browser in Singapore to hit InterKnowlogy.com in San Diego it’s close to 75 router hops. It’s not efficient nor is it fast. But, it works. And we are stuck with it for the not so distant future. The other problem is that there’s just so much you can do in HTML. HTML was never designed to do the contortions’ we do to it. HTML is not declarative programming either; it’s simply a tag based markup “language”. Most would argue it’s not even a programming language. There is more on declarative programming later in this document. Conditional Rule Number 1 – If your application needs broad reach, outside the firewall, then, at a minimum the solution architecture is going to include some form of a browser based ASP.NET application. This is the scenario this document is NOT about. But it deserves some explanation to “set things up” properly. There are never absolutes in software architecture. And the above scenario is as close as you’ll get as a general rule for “platforming” your application. In broad reach scenario, where you cannot authenticate your users in a Windows domain, the majority of the time you are going to have to be a browser based application at a minimum. Good examples of this are the giant auction site and the giant book selling site and the large social networking sites. For these companies (and the gazillions of other internet based businesses) you need to reach the lowest common denominator if you want the largest group of people to buy your “stuff”. The browser is the lowest common denominator. And it is very limited in terms of what you can build into your application. The good news is that there’s virtually no client install so there’s no worries about “platforming” or running the most current version of the software. Grandma Huckaby, with her AOL 1.0 browser and her dial up internet access fits in this scenario.
I fit in this scenario too and so do you; it is the lowest common denominator. But, I don’t want to fit in this scenario. I need something more. I have a powerful Windows computer and high bandwidth access. I’d prefer to shop the huge auction site and book selling site and social networking sites in a highly graphical, wildly functional, rich with multimedia & 3D, beautifully styled “Rich Client” application. Again, there’s only so much you can do in the browser. Here’s where it gets a bit complicated. Microsoft Silverlight has brought life to the marketing term, “Rich Internet Application” (RIA). Silverlight has its limitations too; which I will drill into in detail later in this document. But, it’s bold promise is really starting to get realized.
So, why isn’t there more than the simple web applications for these goliaths of the internet? I am most certainly not unique in my needs. My friends, therein lies the problem and the reason for this document. There is just so much more you can do in .NET in the Windows platform when you are not confined to the browser. | |||||||||
THE PROBLEMS |
|||||||||
I am going to continue exploring the problem from above on why the major internet retailers do not have Rich Client Versions of their software. But before I do that it’s important at this point to take a stab at defining just what the heck a Rich Client Application is.
Defining the Rich Client Application - Ultimately the term “Rich Client” (which for this document’s purposes can be interchangeably used with the term “Smart Client”) is just a marketing term; but, there are very important technical aspects to the term “Rich Client” that every software developer should be cognoscente of. Defining “Rich Client” is an age old heated argument worthy of getting alcohol involved. Since I have been fighting the “Smart Client Jihad” for so many years, I have personally seen arguments turn into emotional battles when arguing over what the heck a “Rich Client” is. I am not that “religious” about the definition, though. To me, it is the technical concepts that are important. So, with trepidation I will tell you that my simplistic definition of “Rich Client” is any application that does not run inside that browser. Yes, Microsoft Silverlight and its worthy competitor Adobe Flash are legitimate “holes” in my definition. And one can most certainly argue that AJAX is a “Rich Client” technology. And there are most certainly more technologies one can argue. The good news is that the simple fact that we can argue about things like this means we are starting to think about and understand the complications. That is a good thing. For now, let’s just group the three technologies Silverlight, Flash and Ajax in to the category “Rich Internet Application” (RIA) and move on to bigger and better things. A stab at defining the Rich Client Application. Remember that there are no absolutes in software architecture. So, with that in mind, my definition of a Rich Client Application is the culmination of some (and sometimes all) of the following attributes:
Now that I’ve made a stab at what the heck a Rich Client is, let me go through my list of the top problems and issues surrounding and in many cases delaying the Rich Client Revolution. And pay special attention that many of these problems share an incestuous relationship. Problem: It’s often times not a technical decision. You have heard many times that the world is run by “C Students” and many software projects are driven by “Marketing people”. This is reality which is not going to change in our lifetimes. Deal with it. Decisions around software (and many other places in life) are made based on rational and irrational thinking; they are made on “time to market” and on cost. Like you, I want to live in a world where everything is about elegant software too. That world doesn’t exist yet and until we get closer to Star Trek where there’s one world federated government and money is insignificant, it’s not going to happen. What’s the point? Frequently, the “right technology” for a software project is WPF and it ends up as an ASP.NET app purely because of an irrational decision. 8 years of fighting this war and I still lose battles like this. It is frustrating. Problem: Humans inherently have problems with change and wandering out of their comfort zone - Even developers. Humans (which include software developers) are basically lazy by nature. That is a gross generalization and may not be fair in your case. But, it is prevalent. The old adage, “It’s hard to teach an old dog new tricks” is prevalent, if not predominant in the human psyche. If a developer is good in ASP.NET because of the last many years of the internet boom and has literally memorized the ASP.NET API then you can understand why it’s going to be hard to get him/her to jump into other areas of .NET – especially a rich client technology like WPF – even if he/she knows it’s the right thing to do on a project. Problem: Lack of Guidance and level of difficulty. I might as well group these two together because even though they are unique problems, they are so often intertwined. Really one of the main tenants of this document is to be an aggregation of guidance. You’ll find that in the guidance section later on in this document. Problem: Adoption. Back in 2001-2002 when the United States Department of Justice (DOJ) had its eyes laser-focused on Microsoft, a political decision was made that really hurt the developer community and the software industry in general. And we are still suffering from that decision 8 years later. This Microsoft decision was to not automatically install the .NET framework on Windows client / desktop machines. Although there were a plethora of opportunities, the technology world was reduced to a conscious decision and effort to install the .NET Framework on Windows client / desktop machines. I have had the plea / argument many many times over the years ultimately ending up in some network guy saying to me, “You are not installing 80 mbs of dlls on my client machines.” Problem: The Scars of the deployment past. We are still living a 10 year hangover from deploying COM applications. Without going into gory details, frankly, because it’s so painful to look back on, COM applications were really fun to write and an absolute nightmare to deploy and version. So bad that it resulted in IT organizations (in companies large and small all over the world) mandating the “we will never deploy a desktop application again.” rule. Many of these companies still have this rule in place. In fact, I know of one fortune 100 company that is predominantly running the Microsoft platform that has a “web only” application development policy. Problem: It’s not a 100% Microsoft world - and not only that there are multiple versions of Windows and multiple versions of the .NET framework. As developers we live in a world where platforming your application is a huge architectural decision. Problem: the amount of legitimate developer technologies is directly proportional to time. When I first started doing solution architecture on the Microsoft Platform it was pretty simple because there just weren’t a lot of developer technologies. Now, I’m told there are more than 20 developer technologies for Microsoft Office alone. Solution architecture is now difficult. Good guidance is badly needed. Problem: The Microsoft Rich Client Developer Stack is not really cross platform. Technically speaking there’s no reason why we don’t have versions of .NET on all platforms. The Common Language Runtime (CLR) was submitted to the open standards body ECMA making it technically possible to port it to any other software/hardware platform when .NET was born. Unfortunately, Microsoft historically has taken the stance, “We encourage ISVs to port the CLR, but we are not going to do it.” The Mono project is exciting, but ultimately as an open source venture without a revenue model I don’t have a lot of confidence in it becoming anything more than “neat”. Problem: Some of these Rich Client developer technologies are difficult. Being different makes WPF inherently difficult. Declarative programming where the UI (XAML) is truly separate from the programming logic (C# or VB) is a very different programming paradigm than we have ever seen. It’s also the future if it’s not your “now”. Interesting Fact: In terms of the surface of the framework classes / API, WPF is almost as big as ASP.NET and Windows Forms combined. I have “kids” that work for me that have memorized the entire ASP.NET API – another reason that ASP.NET is so elegant. It’s not overwhelming so normal humans can memorize the entire API. WPF is so huge it reminds me of Win32.
| |||||||||
THE GUIDANCE |
|||||||||
All Microsoft platform developers agree that there just has not been enough good guidance for building Windows Client applications. The following is a living list of what I call the best guidance for designing, developing and deploying Windows Client applications. It’s my list which doesn’t mean it’s wrong, right or all encompassing. Everyone learns differently. This is a list of some of the resources that help me learn. I will frequently update this list as I run into good guidance for Windows Client Development.
| |||||||||
No Cost Internet Resources |
|||||||||
WindowsClient.net - this is the official Microsoft community portal for WPF development, and is chock full of great resources such as the forums and downloads sections.
Learn WPF page - this page on WindowsClient.net links to podcasts, labs, and the very popular "How do I?" videos MIX University's WPF Bootcamp - Contains a full 3-day video training course on WPF, in which expert instructors guide you from the surface into the depths of the technology stack Windows Client Development Samples, Guidance, FAQs and Blogs - Contains an aggregation of a ton of great stuff on the Windows Client Development platform. Windows® API Code Pack for Microsoft® .NET Framework is the successor to Vista Bridge, wrapping SDK APIs including Taskbar and Libraries, Explorer Browser Control, Task Dialog, Common File Dialog, and Shell support. The current alpha (0.85) is for the Release Candidate of Windows 7. Expect Code Pack revisions with each pre-release of Windows 7. On the home page for the project are links to some videos demonstrating the wrappers in use. | |||||||||
Recommended Resources |
|||||||||
| |||||||||
Recommended Books that are not published yet |
|||||||||
| |||||||||
Reference Applications |
|||||||||
A “Reference Application” is an application with source code whose sole purpose is to help you learn a technology. They are supposed to be functional, but not too complex so that you get lost in the code. The source code is supposed to be heavily commented and include design documentation. They are, by design, supposed to be the best way to learn a programming technology.
The Vertigo Software Family.Show application
The InterKnowlogy Adventure Works WPF and Silverlight applications
|
THE FUTURE
|
It’s important for me to swag my definition at the past and present before speculating on the future. With that said this section on the past is going to confuse you if you are 25 or younger. If you are 25-35 you will shake your head with amusement and in disbelief. If you are over 35 you are going to feel a sense of pride and validity and superiority when reading this part.
| |||||||
The Past - before Internet software |
|||||||||
| |||||||||
The Present (2000-2010) - We are at the end of this era... |
|||||||||
| |||||||||
The Future…is now…and will explode over the next 5 Years. |
|||||||||
I’m a terrible prognosticator. I don’t seem to predict anything correctly deep into the future. I was the guy just a few short years ago predicting the internet’s collapse. To my defense, TCP/IP is an insufficient protocol compared to some of the beautiful binary protocols out there that have existed for 30+ years. The Fax is a better protocol than TCP/IP and that was invented in the 1950s. The internet would have collapsed if a little company called Cisco didn’t make a bad thing worse by creating that 2500 series router. Do you realize how efficient a telephone call is? If I call from Singapore to my home in San Diego, I go 3 maybe 4 switches. If I browse to InterKnowlogy.com from Singapore I’m making 40+ router hops – ridiculous. In any event, I do not have a good track record of predicting the future of technology so it is with trepidation that I write this section.
| |||||||||
CONCLUSIONS |
|||||||||
|
I would argue that every developer plays some form of Solution Architecture role in his/her job. Solution architecture is difficult. The platform that you manifest your application on can be a daunting decision for the application developer. Very rarely is the Solution Architecture decision a clear one. There are so many factors involved. That is why so many obvious mistakes are made. Clearly the Windows platform is not always going to be the best choice to manifest your application; but, neither is the browser. There are going to be times when the broad reach elements of a browser based application make a lot more sense for your solution. And there are going to be times where a Rich client solution on Windows makes a lot more sense. And there are times when you are going to be torn on the decision or have to do both.
If time to market is a factor in your decision, and let’s face it, it always is, then the Windows Client might be the right choice for your application. The following factors could also weigh in to your decision.
So if you have the luxury to build your solution on the windows platform with a technology like WPF I encourage you to jump in. Use the guidance section above as a tool to help you overcome the learning curve. |
I was working on a server product team in the late nineties as a dev lead on an architecture team. In a weekly meeting called “triage” we were prioritizing and strategizing on bugs. A nasty priority one bug came up (not belonging to my team) that had so many dependencies, it was blocking a huge number of other bugs from getting fixed. The dialog went like this:
Lead Program Manager: “I’m disappointed this is still here. I thought we agreed last time to fix this in a couple hours even if it is a hack.”
Lead software architect: “To do that is a total hack. The elegant solution to fixing this will take me 2 weeks. I’d rather work at McDonalds than do that hack.”
Lead program manager: “McDonalds is hiring. And you are fired if this is not fixed and checked in 2 hours.”
Lead software architect: “yes mam.”
Oh man I was a young ivory towered software architect back then. That exchange was a sobering slap in the face and a great life lesson.
I was in the back of the room with a bunch of my MSFT buddies at an internal event on the Microsoft campus a couple years ago. The presenter, an MVP in .NET was demoing and talking about a software project he had been involved in for over a year for a midsized bank. In horror, I watched this guy, who I really respect, talk proudly about his ASP.NET app. He highlighted a number of aspects of the project including:
After half way through the presentation I couldn’t take it anymore. I turned to a buddy of mine who is a PM on the VB team.
Tim: “That should be a Winform app.”
VB Program Manager: “It would have taken half the time, half the budget and would be completed and in production.”
Tim: “I can’t believe mistakes like this are still being made by the leaders of the industry.”
VB Program Manager: “We are well aware of the problem. We just can’t figure out how to fix it.”
I was working on a server product team in the late nineties as a dev lead on an architecture team (same team I mentioned above). My team and I wrote the “Mother of all Scripts”, A classic ASP application that created and staged customizable web sites. Until recently I was told it was still in production staging MSN sites. In any event, it was over 5000 lines of ASP. This was during NT Option Pack days. Well, the script started bombing the IIS 4 stack once it got huge. My boss said to me, “We need to take a little visit to our friends in IIS. My boss contacted the Lead Developer on the IIS 4.0 team – they were buddies and went way back. So, we took a little stroll to the IIS building to meet with him. So we showed him the stack dump. He meticulously stared at it, sighed, and said, “The problem with this company is we have too few Win16 programmers.”
Translation: Only a Windows 16 programmer is talented enough to properly do memory management. It is so funny what we take for granted today because of .NET.