Appendix A Lab Exercises Generics

  1. Open the solution in the folder \Generics\Lab\Template, from the Appendix A sample code from the book's Web site. Build it and run it just to make sure that nothing silly is broken.

  2. The program performs a performance test with both a value type and a reference type. The template already does this with a nongeneric stack. Add code that performs the same test with a generic stack. Observe the performance difference with both value and reference types.

  3. The results of that test may not be exactly as you expect. Dig into the System.Dll using ILDASM and try to figure out why.

  4. Run the performance test again with larger value types and see what sorts of numbers you get. Try creating your own extra-large value type, perhaps ...

Get Programming Microsoft® Composite UI Application Block and Smart Client Software Factory now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.