Type Forwarding

When designing and evolving nontrivial frameworks, it’s often challenging to put types in the right assembly. Although a certain spot may make lots of sense in a certain version of the framework, that doesn’t necessarily remain the case in future releases. For reasons such as architectural layering, it might be a good idea to relocate a type to some other assembly (for example, to avoid the need for excessive references between assemblies).

Such a situation arose in .NET 4.0. In the .NET 3.5 release, generic delegate types such as System.Func<T, TResult> were introduced. Because this release of the framework was layered on top of .NET 2.0 baseline assemblies, it was chosen not to touch them for the addition of new types, and the ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.