Flylib.com

Books Software

 
 
 

A Peek Inside the .NET Framework


A Peek Inside the .NET Framework

The .NET Framework is a group of components developed by Microsoft that make it faster and easier to create all sorts of Windows- based applications, especially applications that can take advantage of the Web. To help you get a better sense of the .NET Framework, let’s take a look at how it relates to Windows.

Windows itself—the operating system—is a collection of programs. It has programs for displaying information on the screen, other programs for reading and writing to the disk, and still others for printing to the printer. Obviously, this explanation is greatly simplified. As you know, Windows contains hundreds of millions of bytes of code, many of which are devoted to terrifically abstruse tasks .

Traditionally, if you wanted to get Windows to print a document, for example, you wrote a program that called the Windows printing program. Also traditionally, you wrote this program using a language such as C, which for various reasons was well-suited to talking to Windows at the esoteric level that Windows preferred. (A notable exception to this tradition is Visual Basic, which makes Windows programming accessible to non-C programmers.) Programming Windows with C in this way has some disadvantages, however. One disadvantage is that you have to work at a very intimate level with Windows. Another is that C is a programming language that is extremely powerful but that assumes you know what you’re doing—a power tool that includes very few safety features.

The .NET Framework, then, is an extra layer of programs between you and the programs that constitute Windows. If you want to program Windows, you can call on the programs in the .NET Framework, and the .NET Framework in turn talks to Windows. The .NET Framework makes many Windows-based tasks simpler. It also includes many more safety features, so although you might still crash your own programs, at least you won’t also crash Windows.

At this point, you might be saying, “All this information is fine, but where is the .NET Framework?” You can download and install the .NET Framework for free. (I’ll explain how to install it in Chapter 3.) After you’ve installed the .NET Framework, you’ll find that it’s just a collection of programs that you can call through the Web pages you write. In this book, we’ll be concentrating on using ASP.NET for programming Web pages and ADO.NET for working with data. However, if you’re interested in other features of Microsoft .NET, such as creating Windows Forms, programming graphics, or writing communications software, you’ll be able to work with those, too, once you’ve downloaded and installed the .NET Framework.



Web Matrix: Enabling Web Programming for the Rest of Us

ASP.NET is the engine and the box of attachments, but it’s up to us to put the attachments together and get them into a running whole. An expert user can use ASP.NET with an application such as Notepad to create pages, add controls, program with data, and otherwise put ASP.NET through its paces to produce programmed Web pages. However, most users would likely find the process of creating Web pages with ASP.NET on their own daunting, not to mention way too tedious . Is there an easier way to use ASP.NET to create programmed Web pages? Yes: Web Matrix, the subject of this book. Web Matrix is a free tool that gives you a WYSIWYG (What You See Is What You Get) environment for creating Web pages and programming them with ASP.NET, as shown in Figure 2-2. For example, Web Matrix allows you to drag controls such as text boxes and buttons from a toolbox onto your page and double-click these controls to start programming.

click to expand
Figure 2-2: Web Matrix provides a WYSIWYG environment for programming Web pages with ASP.NET.

Web Matrix is to ASP.NET what a product such as Microsoft FrontPage is to HTML pages—although you could create pages by hand, using the tool is easier, faster, and less prone to errors. Plus it’s more fun. With some imagination , you can think of Web Matrix as a combination of FrontPage (for editing Web pages) and Visual Basic (for creating and programming forms). This analogy is not quite right, but it might help you picture where Web Matrix will fit into your Web programming future.

Web Matrix and Community

You might have hesitated slightly over the word “free” in the description in the previous section. Can it be true that Web Matrix is a totally free program? You bet. Is there a catch? There is, but the “catch” is actually a feature. Microsoft doesn’t directly support Web Matrix, which is to say, you can’t call up tech support and ask questions. Instead, Web Matrix is a community-supported product. Microsoft maintains a Web site (http://asp.net; isn’t that clever?) for ASP.NET and Web Matrix. On the site are forums where users can discuss those products, read documentation, post questions, and even download and upload code. For example, if you have a question about Web Matrix, you can post a question, and someone, not necessarily from Microsoft, will answer, often very quickly.

A very cool feature of Web Matrix is that the community is built right into the product, so to speak. No documentation with the product is available; instead, the Help menu leads you to the community site. Similarly, the community window in the product leads you to the forums, public newsgroups, tutorials, and a place where you can report bugs .

start sidebar
Web Matrix vs. Visual Studio .NET

Microsoft has another product for creating ASP.NET applications: Microsoft Visual Studio .NET. Visual Studio .NET is a professional development environment for creating not only programmed Web pages, but also any kind of application that Microsoft .NET can be used to create. In addition, Visual Studio .NET has many additional features to support professional developers, including an integrated debugger, performance-monitoring tools, code library facilities, and much more. Naturally, Visual Studio .NET is not a free product.

What is the relationship of Web Matrix to Visual Studio .NET? Web Matrix is a comparatively simple tool that focuses on only one task— namely, creating ASP.NET Web pages. It doesn’t include all the facilities that professional programmers use, such as the debugger. Web Matrix also doesn’t have some of the handy features of Visual Studio .NET such as IntelliSense (automatic statement completion) or early error checking.

In short, Visual Studio .NET is the professional tool and Web Matrix is the tool for folks who just want to create programmed Web pages. If you were setting out to create a commercial Web site, I’d say sure, get Visual Studio .NET. For what we’ll do in this book, though, you’ll find that Web Matrix is a great little tool.

end sidebar