c# - semantically represent generics -


i trying understand generics in semantic way. instance, abstract classes seemed snap place me when read people refer them structures can set policy. interfaces snapped when read people refer them collaboration contracts.

what ways think generics might me differentiate them other oo structures , write more intelligent apis?

think of generic classes stencils make other classes (similarly, generic functions stencils making other functions). type parameters serve openings in stencils: plugging in concrete type them, make generic class or generic function real class or function. type parameters "stick through" designated holes in stencil, producing complete definition.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -