17
Power Features in .NET 4 Presented by Robert MacLean @rma

Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Embed Size (px)

DESCRIPTION

The .NET 4 Framework has over 100 new and improved features! Do you know them all? This demo-heavy talk is perfect for those who never have used .NET 4 and want to upgrade their skills as well as developers using it today wanting to learn something new! We will cover some of the big features you may have seen and a lot of the smaller power features that you may not have seen. These features will make your life as a developer easier!

Citation preview

Page 1: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Power Features in .NET 4Presented by Robert MacLean @rmaclean

Page 2: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Introduction

Level 200A tour: Lots of features – QUICKLYShow something for everyone!

Page 3: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Focus

• .NET 4 has over 100 new and improved features!– Too many for an hour or even a day.

• Our focus: BCL + FCL– Base class library– Framework class library

Page 4: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Problems

How do I know if this person is using x64 so I can optimise my code?I want to save files where my users can find them easily, like their My Documents or the Desktop?I need to loop over files in this directory… but I want it to be easy and fast!I would love to use bitwise flags in my code to set options!(I have lots of problems)

Page 5: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Demo

A bunch of smaller features in the core

Page 6: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Summary

Environment.Is64BitOperatingSystem Environment.Is64BitProcessEasy options to find out about the environment

Environment.GetFolderPathEnvironment.SpecialFolderEasy options to find those important paths

Enumerators for Files & FoldersFINALLY some generic love!

Enum FlagsMath made easy

Page 7: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Problem

I need smarter design time error detectionI need promises on what my methods will accept & return I need runtime error checking

Page 8: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Demo

Code Contracts in .NET 4

Page 9: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Summary

Code Contracts baked into the FrameworkTooling is a separate downloadGreat for design time help both in your own code and code you consume/expose to othersSandcastle can use this to augment your documentation

Page 10: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Problem

I need to improve application performanceMy application pulls lots of data from a database or webserviceSome of it is pretty static

10

Page 11: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Demo

Cache is king

Page 12: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Summary

Memory cache is awesomePer process onlyDesigned for you to build more cache stores, like a database or file systemGo and see AppFabric Caching

Page 13: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Problem

I need to build applications that are context awareI’m building an application that needs maps and location services

13

Page 14: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Demo

System.Device.Location

Page 15: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Summary

Awesome feature, especially with all these GPS enabled tabletsEasy to useCan use a software based GPS if hardware is not available

Page 16: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Session Summary

Small useful features• Is64BitOperatingSystem, Is64BitProcess,

GetFolderPath, SpecialFolder, File/Folder enumerators, FLAGS!

Better code with code contractsBetter performance thanks to memory cacheContext aware computing with System.Device.Location

Page 17: Power features in .NET 4: Investigating the features of .NET 4 which you don’t know about

Thank YOU!

Robert MacLeanwww.sadev.co.za (slides + demo scripts)@rmaclean