Download presentation
Presentation is loading. Please wait.
Published byOscar Hamilton Modified over 8 years ago
1
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T DEV315: Visual C# Under the Covers An In-Depth Look at C# 2.0 Mitch Denny Senior Consultant, Readify mitch.denny@notgartner.com http://notgartner.com
2
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Agenda
3
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Part I: Generics and the reason you are all here
4
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 1: Generics raison d’etre
5
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 2: Generics but what about performance?
6
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 3: Generics role your own (generic types)
7
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 4: Generics generic constraints
8
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 5: Generics generic methods
9
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 6: Inheritence inheriting from generic base classes
10
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Notes: Generics List list = new List (); Performance generally good, but measure! public class Foo { } Many kinds of constraints –where T: class –where T: struct –where T: BaseClass –where T: ISomeInterface –where T: new()
11
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Notes: Generics (cont’d) Generic methods –Distinct from type parameters used to complete method declarations. –Useful for factory methods and making sandwiches. –Wow others programmers with type inferencing tricks.
12
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Part II: Delegates the reason that I am here
13
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 7: Delegates getting to know anonymous methods
14
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 8: Delegates getting closure
15
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 9: Delegates covariance and contravariance
16
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Notes: Delegates Anonymous methods are the major new feature. –delegate { } –delegate (arguments) { } –Closures can reduce complexity of code. –Closures can make your hair turn grey. Method group conversions simplify delegate use. Contravariance and covariance is now supported in the runtime and C#.
17
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Part III: Useful Stuff don’t for get about these
18
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 10: Iterators an easier way to be the enumeration machine
19
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 11: Property Accessibility (about time)
20
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 12: Partial Classes useful stuff for code generators
21
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 13: Nullable Types for handling value types on the data path
22
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 14: The ‘::’ Operator if you need this you are in a bad way
23
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 15: Static Classes our equivalent for the VB module
24
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Demo 16: #pragma warning warnings aren’t always right
25
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T Summary
26
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T We invite you to participate in our online evaluation on CommNet, accessible Friday only If you choose to complete the evaluation online, there is no need to complete the paper evaluation Your Feedback is Important!
27
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T
28
M E L B O U R N E S Y D N E Y C A N B E R R A B R I S B A N EW W W. R E A D I F Y. N E T © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.