Novidades do .NET Framework 4 e C# 4.0 “ Keep it simple”
Quem sou? <ul><li>Felipe Pimentel </li></ul><ul><li>MCP, MCTS e MCPD </li></ul><ul><li>Sócio e fundador da Ificomm Tecnolo...
Contatos <ul><li>Twitter: http://twitter.com/felipe_pimentel </li></ul><ul><li>Email: felipe.pimentel@ificomm.com </li></u...
Novidades não faltam <ul><li>ASP.NET WebForm </li></ul><ul><li>ASP.NET MVC </li></ul><ul><li>Mudanças na CLR, C# e VB  </l...
Agenda <ul><li>Code Contract </li></ul><ul><li>MEF – Managed Extensibily Framework </li></ul><ul><li>DLR – Dynamic Languag...
A Look Back… .NET 1.0 .NET 1.1 .NET 2.0 3.0 3.5 .NET 4 2002 2003 2008 CTP 2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4 SP1
The .NET Framework WPF Win Forms DLR ASP.NET WCF And more! LINQ Base Class Libraries The CLR JIT & NGEN Garbage Collector ...
Code Contract <ul><li>O que é garantido? (Pré-condição) </li></ul><ul><li>O que é esperado? (Pós-condição) </li></ul><ul><...
Code Contract <ul><li>System.Diagnotic.Contract </li></ul>
Code Contract
Code Contract
Managed Extensibility Framework? <ul><li>Framework de extensibilidade – para criação de um sistema de plugins. Plugins que...
The Problem… Original Software Development Software Maintenance
Open/Closed Principle <ul><li>Aberto para extensões e fechados para modificações. </li></ul>
<ul><li>Dinamicamente composta ao invés de ser estaticamente compilada </li></ul>
 
The Parallel Computing Initiative <ul><li>Resolvendo problemas de maneira concorrente </li></ul><ul><li>“ Concurrency for ...
Parallel Computing with .NET 4 <ul><li>Task Parallel Library (TPL) </li></ul><ul><li>Parallel LINQ (PLINQ) </li></ul><ul><...
Parallel LINQ <ul><li>Parallel LINQ (PLINQ)   enables developers to  easily leverage  manycore with a  minimal   impact   ...
Parallel Static Class
Parallel Static Class
Threading Task
Why the DLR? Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed
Why the DLR? Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed Dynamic Language Runtime
.NET Dynamic Programming Python Binder Ruby Binder COM Binder JScript Binder Object Binder Dynamic Language Runtime Expres...
Dynamically Typed Objects Calculator  calc = GetCalculator(); int  sum = calc.Add(10, 20); object  calc = GetCalculator();...
.NET Framework Compatibility
.NET Framework Compatibility <ul><li>.NET 4.0 is a highly compatible release </li></ul><ul><li>.NET 4.0 does not auto–roll...
.NET Framework Compatibility <ul><ul><li>Hang on… if 4.0 is compatible,  why not run 3.5 apps automatically on 4.0? </li><...
CLR 2 - Existing Side-By-Side Host Process (i.e. Outlook) 1.1 add-in .NET 1.1 .NET 2.0 2.0 add-in 3.0 3.5 3.0 add-in 3.5 a...
CLR 4 - In-Process Side-By-Side .NET 2.0 .NET 4.0 2.0 add-in 3.0 3.5 Host Process (i.e. Outlook) 3.0 add-in 3.5 add-in 4.0...
NOVIDADES DO C# 4.0
The Evolution of C# C# 1.0 C# 2.0 C# 3.0 Managed Code Generics LINQ C# 4.0 Dynamic
New C# 4.0 Features <ul><li>Named and Optional Parameters </li></ul>
New C# 4.0 Features <ul><li>Covariance and Contravariance </li></ul>
Covariance
Contravariance
Dinamismo em C#
Tipo dynamic <ul><li>Resolução dinâmica de métodos, propriedades e eventos (em tempo de execução) </li></ul><ul><li>Não ef...
ExpandoObject <ul><li>Permite criar novos objetos em tempo de execução </li></ul>
DynamicObject <ul><li>Facilita criação de classes dinâmicas </li></ul>
Contatos <ul><li>Twitter: http://twitter.com/felipe_pimentel </li></ul><ul><li>Email: felipe.pimentel@ificomm.com </li></u...
Dúvidas?
Obrigado!!!
Upcoming SlideShare
Loading in …5
×

[CLPE] Novidades do .net Framework 4.0

1,678 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,678
On SlideShare
0
From Embeds
0
Number of Embeds
28
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

[CLPE] Novidades do .net Framework 4.0

  1. 1. Novidades do .NET Framework 4 e C# 4.0 “ Keep it simple”
  2. 2. Quem sou? <ul><li>Felipe Pimentel </li></ul><ul><li>MCP, MCTS e MCPD </li></ul><ul><li>Sócio e fundador da Ificomm Tecnologia </li></ul><ul><li>Arquiteto e consultor. </li></ul><ul><li>Líder do DotNetArchitects PE </li></ul>
  3. 3. Contatos <ul><li>Twitter: http://twitter.com/felipe_pimentel </li></ul><ul><li>Email: felipe.pimentel@ificomm.com </li></ul><ul><li>Blog: http://blog.ificomm.com </li></ul><ul><li>Grupo: http://pe.dotnetarchitects.net </li></ul>
  4. 4. Novidades não faltam <ul><li>ASP.NET WebForm </li></ul><ul><li>ASP.NET MVC </li></ul><ul><li>Mudanças na CLR, C# e VB </li></ul><ul><li>Data Access </li></ul><ul><li>Serviços </li></ul><ul><li>WorkFlows </li></ul><ul><li>WPF </li></ul><ul><li>MEF </li></ul><ul><li>... </li></ul>
  5. 5. Agenda <ul><li>Code Contract </li></ul><ul><li>MEF – Managed Extensibily Framework </li></ul><ul><li>DLR – Dynamic Language Runtime </li></ul><ul><li>Parallel Extension </li></ul><ul><li>Principais novidades no C# 4.0 </li></ul>
  6. 6. A Look Back… .NET 1.0 .NET 1.1 .NET 2.0 3.0 3.5 .NET 4 2002 2003 2008 CTP 2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4 SP1
  7. 7. The .NET Framework WPF Win Forms DLR ASP.NET WCF And more! LINQ Base Class Libraries The CLR JIT & NGEN Garbage Collector Security Model Exception Handling Loader & Binder
  8. 8. Code Contract <ul><li>O que é garantido? (Pré-condição) </li></ul><ul><li>O que é esperado? (Pós-condição) </li></ul><ul><li>O que muda? (Invariante) </li></ul>
  9. 9. Code Contract <ul><li>System.Diagnotic.Contract </li></ul>
  10. 10. Code Contract
  11. 11. Code Contract
  12. 12. Managed Extensibility Framework? <ul><li>Framework de extensibilidade – para criação de um sistema de plugins. Plugins que podem ser usados em qualquer aplicação. </li></ul>
  13. 13. The Problem… Original Software Development Software Maintenance
  14. 14. Open/Closed Principle <ul><li>Aberto para extensões e fechados para modificações. </li></ul>
  15. 15. <ul><li>Dinamicamente composta ao invés de ser estaticamente compilada </li></ul>
  16. 17. The Parallel Computing Initiative <ul><li>Resolvendo problemas de maneira concorrente </li></ul><ul><li>“ Concurrency for the masses” </li></ul>
  17. 18. Parallel Computing with .NET 4 <ul><li>Task Parallel Library (TPL) </li></ul><ul><li>Parallel LINQ (PLINQ) </li></ul><ul><li>Coordination Data Structures (CDS) </li></ul><ul><li>System.Threading Improvements </li></ul>
  18. 19. Parallel LINQ <ul><li>Parallel LINQ (PLINQ) enables developers to easily leverage manycore with a minimal impact to existing LINQ programming model </li></ul>var q = from p in people          where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd         orderby p.Year ascending          select p;
  19. 20. Parallel Static Class
  20. 21. Parallel Static Class
  21. 22. Threading Task
  22. 23. Why the DLR? Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed
  23. 24. Why the DLR? Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed Dynamic Language Runtime
  24. 25. .NET Dynamic Programming Python Binder Ruby Binder COM Binder JScript Binder Object Binder Dynamic Language Runtime Expression Trees Dynamic Dispatch Call Site Caching IronPython IronRuby C# VB.NET Others…
  25. 26. Dynamically Typed Objects Calculator calc = GetCalculator(); int sum = calc.Add(10, 20); object calc = GetCalculator(); Type calcType = calc.GetType(); object res = calcType.InvokeMember( &quot;Add&quot; , BindingFlags.InvokeMethod, null , new object [] { 10, 20 }); int sum = Convert.ToInt32(res); ScriptObject calc = GetCalculator(); object res = calc.Invoke( &quot;Add&quot; , 10, 20); int sum = Convert .ToInt32(res); dynamic calc = GetCalculator(); int sum = calc.Add(10, 20); Statically typed to be dynamic Dynamic method invocation Dynamic conversion
  26. 27. .NET Framework Compatibility
  27. 28. .NET Framework Compatibility <ul><li>.NET 4.0 is a highly compatible release </li></ul><ul><li>.NET 4.0 does not auto–roll forward </li></ul><ul><ul><li>You must add a configuration file with a specific switch to get 3.5 apps to run on 4.0 </li></ul></ul>
  28. 29. .NET Framework Compatibility <ul><ul><li>Hang on… if 4.0 is compatible, why not run 3.5 apps automatically on 4.0? </li></ul></ul><ul><ul><li>The BEST thing is always to prefer running on the version of the framework you built against </li></ul></ul><ul><li>Contact [email_address] and submit your app for testing! </li></ul>
  29. 30. CLR 2 - Existing Side-By-Side Host Process (i.e. Outlook) 1.1 add-in .NET 1.1 .NET 2.0 2.0 add-in 3.0 3.5 3.0 add-in 3.5 add-in
  30. 31. CLR 4 - In-Process Side-By-Side .NET 2.0 .NET 4.0 2.0 add-in 3.0 3.5 Host Process (i.e. Outlook) 3.0 add-in 3.5 add-in 4.0 add-in
  31. 32. NOVIDADES DO C# 4.0
  32. 33. The Evolution of C# C# 1.0 C# 2.0 C# 3.0 Managed Code Generics LINQ C# 4.0 Dynamic
  33. 34. New C# 4.0 Features <ul><li>Named and Optional Parameters </li></ul>
  34. 35. New C# 4.0 Features <ul><li>Covariance and Contravariance </li></ul>
  35. 36. Covariance
  36. 37. Contravariance
  37. 38. Dinamismo em C#
  38. 39. Tipo dynamic <ul><li>Resolução dinâmica de métodos, propriedades e eventos (em tempo de execução) </li></ul><ul><li>Não efetua validação estática </li></ul>
  39. 40. ExpandoObject <ul><li>Permite criar novos objetos em tempo de execução </li></ul>
  40. 41. DynamicObject <ul><li>Facilita criação de classes dinâmicas </li></ul>
  41. 42. Contatos <ul><li>Twitter: http://twitter.com/felipe_pimentel </li></ul><ul><li>Email: felipe.pimentel@ificomm.com </li></ul><ul><li>Blog: http://blog.ificomm.com </li></ul><ul><li>Grupo: http://pe.dotnetarchitects.net </li></ul>
  42. 43. Dúvidas?
  43. 44. Obrigado!!!

×