开发者

How .NET collections and generics works?

I am a trainee software engineer, I did self study on collection and generics and reported to my TL. He suggested me to study these things a开发者_如何学编程lso.

Specially in generics how memory is defined for generic type, how IL and CLR works for generic?

Performance of generic over collection, or over boxing unboxing?

I googled but getting confined answer. Can please anybody explain or give any matter(Link) on that to study.

Thanks.


Design and Implementation of Generics for the .NET Common Language Runtime by Andrew Kennedy and Don Syme talks about the theory behind implementing generics on the CLR. http://research.microsoft.com/pubs/64031/designandimplementationofgenerics.pdf

The source code is available for the .NET Framework, which allows you to debug through System.Collections.Generic. http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx

If you want deeper information, you can read the Rotor (aka Shared Source Common Language Infrastructure) source code, which is the "source available" part of the .NET Framework. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8c09fd61-3f26-4555-ae17-3121b4f51d4d&displaylang=en

Another implementation is the Mono project. They have an implementation of generic collections and the Mono codebase is open source. http://www.mono-project.com/Main_Page


A very nice tool for looking at .NET internals is Reflector. It shows the full C# (or VB, or IL) code of many .NET classes, including the collections.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜