O'Reilly logo

Programming .NET 3.5 by Jesse Liberty, Alex Horovitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. .NET 3.5: A Better Framework for Building MVC, N-Tier, and SOA Applications

The release of .NET 3.5 represents one of the most significant advances for Windows and web development in the last decade (arguably since the release of .NET itself). Yet in many ways, it has been lost in the excitement and confusion over the release of constituent and related products. That is, many developers have focused on the trees (e.g., WPF or WCF) rather than on the forest of .NET 3.5.

Granted, it can all be a bit overwhelming. Within less than a year, .NET developers were faced with various previews, betas, and release versions of:

  • The Vista operating system

  • Windows Presentation Foundation (WPF)

  • Windows Communication Foundation (WCF)

  • Windows Workflow Foundation (WF)

  • CardSpace

  • C# 3.0

  • VB 9

  • Visual Studio 2008

  • AJAX

  • Silverlight

  • ASP.NET/MVC

  • XAML

Technically, the .NET 3.5 release is dominated by four new frameworks—WPF, WCF, WF, and CardSpace—which made their first appearances in .NET 3.0. But these libraries were released as part of a commitment to more expressive programming and a greater reliance on industry standards that is clearly expressed, for example, in the release of the AJAX libraries, Silverlight, and the MVC libraries.

It is a major premise of this book that there is one key and unique aspect of .NET 3.5 that sets it apart from previous versions: the level of maturity of its component frameworks and libraries, which is now sufficient to fully support—indeed, to foster—the industry-accepted design patterns we’ve all been struggling to implement for the past decade.

Specifically, we believe that while .NET programmers have, since version 1, been working to build .NET applications that are n-tier, scalable, and maintainable, the .NET frameworks have not been of sufficient help. Consequently, many .NET programs are two-tier applications that mix the code for data access and business logic with the code that handles the presentation of the user interface. .NET 3.5, however, offers programmers an extensive set of tools and libraries that not only foster n-tier and/or MVC programming, but provide much of the infrastructure and plumbing needed to make true separation of responsibility the natural outcome.

Integration Versus Silos

One perfectly valid approach to .NET 3.5 is to write about each of the .NET technologies individually. We call books that take this approach—including such worthwhile and in-depth titles as Chris Sells’s and Ian Griffiths’s Programming WPF, Juval Lowy’s Programming WCF Services (both O’Reilly), and others—“silo books,” because they isolate the technologies from one another, like separate types of grains in their individual silos. What these books lose in their integrated perspectives, they make up for in tremendous depth.

This book, however, takes a different approach. Our aim is to show you enough about each of these technologies to enable you to make practical use of them. Rather than considering them in isolation, we will endeavor to tie them together with the common thread of showing how they each contribute to building robust, scalable, maintainable, high-quality applications.

Big Ideas, Small Examples

The paradox in weaving together these ideas and teaching these disparate technologies is that exploring a single application in all its complexity actually gets in the way of understanding each of the building blocks. Thus, we will keep our examples simple and focused. We will, however, take every opportunity as we move from framework to framework to show how they work together, offering an integrated approach.

In Chapter 8 we provide an explicit review of some of the most common and well-established (some might say cherished) programming patterns and show how .NET 3.5 fosters their implementation.

It Ain’t Just the Framework

Because this book is targeted at working .NET programmers, we’ve used the broadest definition of .NET 3.5—that is, we’ve attempted to include the full breadth of .NET technologies currently available.

It’s a Moving Target

Microsoft’s research and development budget is roughly equivalent to the GDP of a small European country, so the pace of innovation can be staggering. Over the past decade, “Windows” developers have been offered massive improvements ranging from the move from C++ and the MFC to C# and Windows Forms, to the maturation of C# and the introduction of WPF. On the web side, we’ve seen the introduction of ASP and then ASP.NET, the addition of AJAX, and now the introduction of Rich Internet Application (RIA) programming with Silverlight. Access to data and decoupling of business logic from underlying data structures have undergone similar transitions, with the progression from ADO to ADO.NET to LINQ. The list of improvements goes on and on, including better and more sophisticated mechanisms to manage metadata, reflection, threading, networking, web services, business objects, and more.

This book had to be completely revised even before it was released just to keep up with the changes in the technologies that occurred during the process of developing it. In a sense, you are actually already reading the second edition.

Fortunately, four forces are now working to make mastering these technologies more manageable:

  • The greater coherence and maturation of the .NET technologies, which will naturally make new offerings easier to integrate into what you already know

  • An increased commitment from Microsoft to providing information and support, as exemplified by sites such as Silverlight.net, ASP.net, and so forth

  • Better-informed and higher-quality books throughout the technical publishing industry, such as those offered by O’Reilly, A-Press, Addison-Wesley, and others

  • A far higher signal-to-noise ratio in the blogosphere

What? All That in One Book?

A perfectly reasonable question to ask before plunking down your money is, “If 600-page books have been written about each of these technologies, how can you hope to teach anything useful about all of them in a single volume (though it is obviously an incredibly well-written book, I must admit)?”

The answer is, fortunately for us both as authors and as developers, that these seemingly disparate frameworks have a great deal in common; our goal is to show you the 25% that you will use 85% of the time. We don’t pretend that this is the only book you will ever need on all of these topics, though it may well be the only book you need to consult about those parts of .NET that are not central to your business.

But let us be clear: this is not an overview, nor do we intend it to be read by pointy-headed managers. This is a book by developers for developers that is meant to be a useful reference and to provide you with sufficient core capability in each area to enable you to write real-world commercial applications.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required