Tuesday, February 19, 2013

ASP.NET 4.5 features make upgrade worth the trouble

Microsoft continues to add new features and fix others in ASP.NET, while I continue to support an ASP.NET 1.1 application along with many others using the various flavors of ASP.NET. The latest version to hit the streets (ASP.NET 4.5) coincides with the release of .NET Framework 4.5. It was released late last year, but I am just now diving in to it as I begin development on an application for a new client. Here's a quick tour of ASP.NET 4.5; I'll focus on specific features in future posts.

Version confusion

The 4.5 version number deserves discussing for the pure fact that it is a little confusing. Microsoft has been releasing technologies (via CodePlex) even before .NET Framework 4.5 was released; for this reason, the version numbers for the various technologies within the framework are out of sync.

Microsoft incremented the base framework and ASP.NET a half point (4 to 4.5), while core languages received a full increase with C# 5.0 and Visual Basic 11. Past upgrades have allowed you to utilize multiple versions side-by-side, but this is tricky, as the .NET Framework 4.5 installation replaces libraries used in 4.0 applications.

In short, be careful with the upgrade. I am in such a situation, so I will discuss this in more detail in the future.

Where do we begin?

There are too many features in ASP.NET 4.5 to cover in one post, so I'll stick with some of the notable features added or enhanced in this version.

  • Web Sockets: Full support for the Web Sockets HTML5 standard is available with ASP.NET 4.5 running on IIS 8.0 via the SignalR library. This allows you to easily add real-time Web functionality to applications.
  • Authentication: There is now a universal provider (DefaultMembershipProvider) for simplification. In addition, the OAuth protocol is embraced.
  • Async programming: While this feature is not ASP.NET-specific, it is worth noting that C# 5 and Visual Basic 11 provide async support without using multiple threads (via async and await keywords).
  • Web publishing: This feature has been enhanced, whereas you can compare local and remotes files, publish only selected files, and so forth.
  • Web API: This API provides the REST approach to building applications — a key difference from the WCF alternative. In addition, the Web API now includes extensive OData support, which is another instance of Microsoft embracing open source standards.
  • Friendly URLs: The popularity of tinyurl demonstrates the widespread problem of keeping up with long, arcane URLs. This feature is now available with ASP.NET applications via theFriendlyURLs feature.
  • Mobile: The explosion of smartphones, eReaders and other mobile devices has changed the landscape for Web application development. HTML5 support is supposed to simplify mobile application development. In addition, MVC 4 includes mobile templates, and there are a variety of mobile device emulators that can be used in Visual Studio 2012.
  • IIS: This allows you to use new features available in Internet Information Server (IIS) 8.0. Some of these features include prefetching and application initialization like application ping on startup. Also, an express edition of IIS is now available.

Web Forms

Once upon a time I thought Web Forms may be on their way out, but ASP.NET 4.5 proves me wrong with many updates to the stalwart of ASP.NET interface design. These enhancements are one of the reasons I was intrigued by the newest release of ASP.NET.

While MVC developers are fully aware of model binding, it is now available to the Web Forms world. Model binding binds a value in the client application to a model on the server — this allows validation on the server. In addition to model binding, ASP.NET 4.5 offers strongly typed. A new ModelType property has been added to the data controls that allows you to specify the type of object that is bound to the control. The IQueryable object allows you to manipulate the query to provide paging, sorting, and much more. Web Forms also adds HTML5 support.

ASP.NET 4.5 includes a feature called unobtrusive validation that allows you to configure validator controls to use unobtrusive JavaScript for client-side validation logic. The net result is a large reduction in the amount of JavaScript rendered inline in the page markup. If you prefer an alternative, ASP.NET MVC 4 and Web Pages 2 are available.

Open source

This may be showing my age, but I am still surprised at how .NET has embraced open source in so many ways. The robust support for HTML5 and JavaScript (including jQuery libraries) in building ASP.NET and Windows 8 applications is a great example. I was skeptical when the CodePlex site first arrived, but it has proved to be a great vehicle for pushing new projects (as well as for providing Microsoft with an outlet to release technology updates). A good example of such a project is JSON.NET. The future seems bright for open source and .NET.

Too much for one person

I will pick certain ASP.NET 4.5 features as we build a new application, but I will use older methods for some features. The days of one developer keeping up with all facets of the .NET Framework and ASP.NET are over — the technology and products is overwhelming. This is why you have some developers who stick with Web Forms (my hand is raised), others who jump on the MVC train, and still others use both or alternatives.

The complexity of the .NET technologies overwhelmed me in the past, but I now realize it is a great situation because it provides flexibility and options when building an application; this fosters the creativity that so many developers love and crave.

Monday, February 4, 2013

10 things I've learned from working in IT

I've been a part of the IT industry (in one capacity or another) for nearly 20 years now. During those years, I've seen all sorts of trends, thoughts, and events come and go like the wind. I've experienced people with a vast range of skills and interests, and I've seen and heard dog and pony shows from more companies than I care to remember.

While I've held my post(s) within the IT industry, I've learned a few random things about the industry itself that I wanted to share with all the good readers of TechRepublic. So hold onto your seat, it's gonna be a bumpy ride.

1: Companies always promise more than they can deliver

This is almost across the board. A company will promise you the moon, telling you that their product will solve every problem your company has. But sales pitches should never be believed. If you want to know the truth about a product, you find forums (like TechRepublic) where end users and other IT pros chat about products. The company I work for recently had a new backup solution vendor promise that its product would not have all the failings our current product had. And it did solve some of the issues — but it had plenty of its own. Remember, if it's too good to be true, most likely it's not true.

2: If you add third-party software to a Windows machine, all bets are off

In a perfect world, you could add any software, from any vendor, and everything would simply work. We don't live in that perfect world. I have found over the years that when you add non-Microsoft software to a machine, to differing degrees, you compromise the stability and reliability of the platform. If you really want the most stable Windows platform you can get, install only software from Microsoft.

3: It's not a matter of "if" but "when" your desktop or server will be compromised

Whether you use a desktop or a server, if you're using Windows, you will be compromised. This does not necessarily mean a hacker or something catastrophic. But you will wind up with a virus, malware, or more. No matter what antivirus software you use, you will eventually find yourself having to rid a machine of something malicious.

4: Most people don't really understand RAID

I can't tell you how many people I've dealt with who look at RAID as little more than a backup. If you need a backup, use a backup. If you need redundancy, use RAID. But even more important — RAID disks fail! If you don't pay attention to those failures (and replace disks as needed), you will wind up with a dead machine that will take hours (or days) to bring back to life. Understand RAID before you use it.

5: Backups are always forgotten… until they're needed

Most people don't even back up. And those who do usually assume it's "set it and forget it." I've been focusing on backups (for multiple clients) for a while now, and if there's one thing I've learned it's that backups can't be trusted. You must monitor them; you must babysit them. If you don't, one of these days you are going to need that backup and it won't be there.

6: The cloud will never replace the desktop

Just a few short years ago, rumors spread about this ubiquitous technology called "the cloud," and everyone pretty much thought it would take over the desktop. Some of us had visions of old thin clients making a comeback. The truth is, the cloud wound up being something used by the desktop. It will never actually replace the desktop. We need that desktop OS; otherwise, failure and lost data will become rampant. But no matter what the early expectations were, the cloud has turned out to be a nice addition to what we already had.

7: The Linux platform is still hindered by FUD

That's right: Fear, uncertainty, and doubt still plague the open source flagship platform. Most of those who rail against Linux do so out of either ignorance or fear. Linux fits in perfectly alongside both Windows and OS X on the server AND the desktop. And Linux will continue to gain traction in both personal and business usage. Although the biggest perpetrators of the Linux FUD have pulled back drastically, others still feed the machine daily. I can't imagine this will go away any time soon.

8: There's a huge disconnect between pundits and the real world

Most pundits live in this glorious cloud in the sky where reality has little to no bearing. Reality is that most businesses can't afford to upgrade every year, that people still desperately cling to old technology because it works and because they fear change, and that the newest and shiniest isn't always the best.

9: IT will give you gray hair

I've seen it countless times. People come into the business with nice jet black hair and after only a year or so, the gray hair starts sprouting. Why? IT is stressful. You have people's business in your hand. Your ability to fix problems is critical to end users getting their jobs done. Or worse — you're working with a company's QuickBooks data file and you have a business breathing down your neck to make sure it can continue. It's a rough business that will chew you up and spit you out. Thin skinned need not apply.

10: The second you think you understand something, you don't

Technology changes faster than the speed of thought. The second you've wrapped your brain around something, it completely changes and you have to start from scratch. Never sit still, never give up learning, and always know the second you close your eyes you will be behind the curve and someone else will steal your business.

ITWORLD
If you have any question then you put your question as comments.

Put your suggestions as comments