When Visual Studio 2010 and .NET 4.0 arrive next year, we ASP.NET developers will have two mature frameworks for building Web applications: the ASP.NET Web Forms framework and the ASP.NET MVC framework. Both build on top of the core ASP.NET runtime, and both are getting some new features to start the next decade.
Lazy loading is a common design pattern often used for constructing resource-intensive objects. It's also frequently used in conjunction with the singleton, and/or factory patterns. Lazy loading entails constructing an object at the point it's needed, rather than when it's declared. If the object never ends up being used, it will never be fully constructed. In versions of Microsoft's .NET Framework prior to 4.0, one would have to create their own lazy loading logic to take advantage of this pattern. Fortunately, .NET 4.0 includes Lazy<T>, which is a generic implementation of the lazy loading pattern. Let's first look at how to use Lazy<T> to implement the singleton pattern. The singleton pattern creates just one instance ever for an object; and it's often used for constructing objects that utilize scare resources.
In recent years, dependency injection (DI) and inversion of control (IOC) have gained popularity as means for creating and retrieving instances of classes in applications and libraries. This article examines these mechanisms, using MVVM Light’s SimpleIoc to illustrate the usefulness of implementing an IOC container in MVVM-based applications.
Generics are often introduced as the mainstream language feature of Whidbey (.NET2). However, while surfing off the beaten path I realized that new features named anonymous methods and iterators are also very interesting. Unlike generics, these two features don't imply new IL instructions set changes compared to .NET1 IL instructions set or any CTS changes. All the magic is in the compilers.
Generics are an extension of the CLR type system that allow developers to define types for which certain details are left unspecified. These details are specified when the code is referenced by consumer code, making for enhanced flexibility. This article explains how.
Jeremy Miller explains how internal Domain Specific Languages can help you craft code that is easier to read and write. His bag of tricks to improve your programming includes extension methods, fluent interfaces, object extensions and use of the semantic model.
This article shows you how to combine the two languages to serve the same .NET application. You get the best of both worlds: Python and .NET work together to provide reusable code functionality without your having to rewrite the code base for a single environment.