0
.NET Framework 4.0<br />Anbazhagan T.M.<br />agile. business solutions<br />
Session Outline<br />Look back<br />.NET 4.0<br />
Session Takeaways<br />Knowledge on .NET Evolution from 1.0 to 4.0<br />A Look back on earlier .NET version features<br />...
Session Outline<br />Look back<br />.NET 4.0<br />
.NET Evolution<br />C# 3.0<br />ASP.Net 3.5<br />Other features..<br />WPF<br />WCF<br />WF<br />Cardspace<br />WPF<br />W...
.NET 1.1<br />
.NET 2.0<br />
.NET 3.0<br />
.NET 3.5 & 3.5 sp1<br />
.NET Framework – Overview<br />WPF<br />Win Forms<br />WWF<br />ASP.NET<br />WCF<br />And more!<br />LINQ<br />Base Class ...
.NET Framework – Overview<br />
Session Outline<br />Look back<br />.NET 4.0<br />
.NET Framework 4.0<br />WPF<br />Win Forms<br />WWF<br />ASP.NET 4.0<br />WCF<br />MEF<br />LINQ<br />DLR<br />Task Parall...
.NET 4.0 Features<br />
.NET 4.0 Features<br />
SxS – Before .NET 4.0<br />Side X Side releases solve app compat issue<br />COM objects and other addins for different lay...
And Now with .Net 4.0<br />i<br />2.0 addin<br />3.0 addin<br />3.5 addin<br />4.0 addin<br /><ul><li>Run both 2.0-based a...
Old components use old CLR
New components use new CLR</li></ul>3.5<br />.NET 4.0<br />3.0<br />.NET 2.0<br />Host Process (e.g. Outlook)<br />Configu...
Common SxS Scenarios<br />
.NET 4.0 Features<br />
COM Interoperability<br />Primary Interop Assemblies (PIA) translate <br />between managed code and COM<br />For each inte...
Difficulties with PIA<br />PIA must be deployed with the managed<br />Application which uses the COM <br />Entire PIA must...
Solution<br />Type Embedding and Equivalence<br />Compilers embedthe portions of the interop assemblies that the add-ins a...
.NET 4.0 Features<br />
Client Profile<br />Subset of .NET 4 optimized for most<br />Client applications<br />- Application targets .NET Client pr...
Quicker Install times</li></li></ul><li>Features<br />Included<br />CLR, WPF, WCF, MEF, Dynamic Types, WWF, <br />Entity F...
Comparison with earlier version<br />3.5 sp1<br />4.0<br /><ul><li>Only Web Install
Only on Windows XP SP2 or SP3
Single Entry
Window upgrade it to full version
Local package and web install
Works on all platforms except for iA64
Part of .NET 4.0
Independent Component</li></li></ul><li>.NET 4.0 Features<br />
Dynamic Language Runtime [DLR]<br />Runtime environment that adds a <br />set of services for dynamic languages <br />to t...
DLR Architecture<br />IronPython<br />IronRuby<br />C#<br />VB.NET<br />Others…<br />Dynamic Language Runtime<br />Express...
Primary DLR Advantages<br />Simplifies Porting Dynamic Languages to the .NET Framework<br />Enables Dynamic Features in St...
Dynamically Typed Objects<br />Calculator calc = GetCalculator();<br />int sum = calc.Add(10, 20);<br />object calc = GetC...
.NET 4.0 Features<br />
Upcoming SlideShare
Loading in...5
×

Its dotnet-framework4.0

2,047

Published on

.NET Framework 4.0

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,047
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
88
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Language support for generics built directly into the .NET CLR.NET micro Framework (NETMF) for embedded microcontroller developmentASP.Net Enhancements – New Compilation model, themes, master pages, new controls, data controls, declarative bindingCLR and .Net runtime host integration with SQL ServerNumerous API Changes, Language features like partial classes, iterators, anonymous methods, Nullable types, Membership providers
  • No Architectural level changes..No new enhancments on Base class libraries..uses same CLR 2.0 of .Net 2.0Windows Presentation Foundation (WPF), formerly code-named Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies. See WPF SDK for developer articles and documentation on WPF.Windows Communication Foundation (WCF), formerly code-named Indigo; a service-oriented messaging system which allows programs to interoperate locally or remotely similar to web services.Windows Workflow Foundation (WF) allows for building of task automation and integrated transactions using workflows.Windows CardSpace, formerly code-named InfoCard; a software component which securely stores a person&apos;s digital identities and provides a unified interface for choosing the identity for a particular transaction, such as logging in to a website.
  • C# 3.0, VB 9.0New language features in C# 3.0 and VB.NET 9.0 compilerAdds support for expression trees and lambda methodsExtension methodsExpression trees to represent high-level source code at runtime.[10]Anonymous types with static type inferenceLanguage Integrated Query (LINQ) along with its various providers LINQ to ObjectsLINQ to XMLLINQ to SQLPaging support for ADO.NETADO.NET synchronization API to synchronize local caches and server side datastoresAsynchronous network I/O API.[10]Peer-to-peer networking stack, including a managed PNRP resolver[11]Managed wrappers for Windows Management Instrumentation and Active DirectoryAPIs[12]Enhanced WCF and WF runtimes, which let WCF work with POX and JSON data, and also expose WF workflows as WCF services.[13] WCF services can be made stateful using the WF persistence model.[10]Support for HTTP pipelining and syndication feeds.[13]ASP.NET AJAX is included.ADO.Net Entity framework and ADO.Net data services (sp1)Performance enhancements (sp1)Two new assemblies for web development, System.Web.Abstraction and System.Web.Routing, have been added; these are used in the ASP.NET MVC Framework and, reportedly, will be utilized in the future release of ASP.NET Forms application (sp1)
  • Starting with the .NET Framework version 4, you can use in-process side-by-side hosting to run multiple versions of the common language runtime (CLR) in a single process. By default, managed COM components run with the .NET Framework version they were built with, regardless of the .NET Framework version that is loaded for the process.
  • The .NET Framework has always provided side-by-side hosting for managed code applications, but before the .NET Framework 4, it did not provide that functionality for managed COM components. In the past, managed COM components that were loaded into a process ran either with the version of the runtime that was already loaded or with the latest installed version of the .NET Framework. If this version was not compatible with the COM component, the component would fail.NET Framework versions 3.0 and 3.5 are built incrementally on version 2.0, and do not need to run side by side. These are inherently the same version. This is called Layer Cake ModelThis model works reasonably well for solving application compatibility issues but does restrict the kinds of functionality that can be added. The other problem with this approach is that the hosting process (any application that hosts an instance of the .NET Framework directly) could only load one version in to memory.This limitation isn’t an issue until you start looking at extensible applications using System.AddIn, the Managed Extensibility Framework (MEF) or some other extensibility framework. At this point, the limitation becomes more significant as your hosting application can only load extensions in to the same version of the Framework that it runs.CLR 4.0 solves this problem by introducing a new In-Process Side by Side hosting model, which allows a host application to run both 2.0-based and 4.0-based CLRs in the same process. Let me repeat that: CLR 4.0 will allow process to host both 2.0 and 4.0-based CLRs in the same process.
  • The .NET Framework 4 provides a new approach to side-by-side hosting that ensures the following:1. Installing a new version of the .NET Framework has no effect on existing applications.2. Applications run against the version of the .NET Framework that they were built with. They do not use the new version of the .NET Framework unless expressly directed to do so. However, it is easier for applications to transition to using a new version of the .NET Framework.This allows a host process to load older components running against the 2.0 CLR and components running against the 4.0 CLR seamlessly. This level of control is exposed for both applications and COM through a config file which describes versions you run on and which you prefer. There are also a new set of hosting APIs for the host application (typically an unmanaged application) to use:These new interfaces are:ICLRMetaHost;ICLRMetaHostPolicy;ICLRRuntimeInfo;ICLRRuntimeHost3;ICLRStrongNameThe older legacy static global hosting functions will be marked as deprecated.
  • The .NET Framework 4 provides a new approach to side-by-side hosting that ensures the following:1. Installing a new version of the .NET Framework has no effect on existing applications.2. Applications run against the version of the .NET Framework that they were built with. They do not use the new version of the .NET Framework unless expressly directed to do so. However, it is easier for applications to transition to using a new version of the .NET Framework.This allows a host process to load older components running against the 2.0 CLR and components running against the 4.0 CLR seamlessly. This level of control is exposed for both applications and COM through a config file which describes versions you run on and which you prefer. There are also a new set of hosting APIs for the host application (typically an unmanaged application) to use:These new interfaces are:ICLRMetaHost;ICLRMetaHostPolicy;ICLRRuntimeInfo;ICLRRuntimeHost3;ICLRStrongNameThe older legacy static global hosting functions will be marked as deprecated.
  • Primary Interop Assemblies (PIA) are vendor-provided uniquqassemblies that act as a go between for COM components and the .NET Framework, one of the most widely known being the Microsoft Office Primary Interop Assemblies. Any time you deploy an assembly that references a PIA, you have to remember to deploy the PIA along with it or provide instructions for how to go about getting it on the system. A new feature for both C# and VB.NET allows you to embed a Primary Interop Assembly directly into your assembly, which makes deployment extremely simple. PIAs also tend to be relatively large, so including the whole thing could easily bloat your assembly. Fortunately, the compiler is optimised to embed only those parts of the PIA that you actually use, which can reduce the PIA footprint if you are only using a subset of what it contains. Office has thousands of APIs for addins exposed through COM. But COM was designed for native code. Interop Assemblies help “translate” between managed and native code by containing all the marshalling data necessary to make communication possible.
  • MESSAGING:Let’s look at Office as an example. Add-ins in Excel, for instance, may very well need to talk to each other -&gt; Because they have to talk to each other, they have to be using the same types for Excel -&gt; Because of the way the type system works in the CLR, these types must also be in the same assembly -&gt; So, the assembly is required to be in a common location (e.g. the GAC) in order for the add-ins to function properly.Well, Office currently does not require the .NET Framework to be installed on a machine. If a machine doesn’t have .NET installed, there’s no GAC, and hence nothing to deploy the PIA into. Herein lies the problem. Even if an add-in is only using a single function, enum, etc. from the interop assembly, the add-in must deploy the entire PIA along with itself. Office PIA is around 10-20mb, it’s HUGE. So you might have a 100k add-in “bringing along” a 20mb PIA.
  • There are two primary things that enable PIAs to be buried, forever, never to rise again. Compiler enhancements (this embedding works down to the method level even, so even a full interface is not required).Runtime enhancementsEven though they are in different assembliesEven though they may have different subsetsHence, type equivalence allows two interfaces, enums, delegates and plain-old-data-structures to mark themselves as equivalent with each other.
  • The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. It provides functionality for most client applications, including Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and ClickOnce features. This enables faster deployment and a smaller install package for applications that target the .NET Framework 4 Client Profile
  • There is a good reason why the Dynamic Language Runtime (DLR) exists. The problem is that, today, dynamically-typed languages like Python and Ruby can’t easily run directly on top of the CLR as the CLR is primarily designed for statically-typed languages. By creating the DLR, we help plug that hole and allow dynamically-typed languages to run on top of the CLR (by working through the DLR).Most dynamic languages provide the following advantages for developers:The ability to use a rapid feedback loop (REPL, or read-evaluate-print loop). This lets you enter several statements and immediately execute them to see the results. Support for both top-down development and more traditional bottom-up development. For example, when you use a top-down approach, you can call functions that are not yet implemented and then add underlying implementations when you need them. Easier refactoring and code modifications, because you do not have to change static type declarations throughout the code.Dynamic languages make excellent scripting languages. Customers can easily extend applications created by using dynamic languages with new commands and functionality. Dynamic languages are also frequently used for creating Web sites and test harnesses, maintaining server farms, developing various utilities, and performing data transformations
  • The DLR adds a set of services to the CLR for better supporting dynamic languages. These services include the following:Expression trees. The DLR uses expression trees to represent language semantics. For this purpose, the DLR has extended LINQ expression trees to include control flow, assignment, and other language-modeling nodes. For more information, see Expression Trees (C# and Visual Basic).Call site caching. A dynamic call site is a place in the code where you perform an operation like a + b or a.b() on dynamic objects. The DLR caches the characteristics of a and b (usually the types of these objects) and information about the operation. If such an operation has been performed previously, the DLR retrieves all the necessary information from the cache for fast dispatch.Dynamic object interoperability. The DLR provides a set of classes and interfaces that represent dynamic objects and operations and can be used by language implementers and authors of dynamic libraries. These classes and interfaces include IDynamicMetaObjectProvider, DynamicMetaObject, DynamicObject, and ExpandoObject.
  • MESSAGING:As long as we stay in our statically-typed world, interacting with objects is a pleasant and intuitive experience. However, as soon as you step out of that boundary and have to start using reflection, your code becomes much less elegant, harder to read, and harder to maintain. Using ScriptObject in the DLR makes this a bit easier as it provides some direct method calls to invoke methods with specific parameters. And while this is an improvement, it’s still a departure from the way we are used to interacting with objects.Using the new dynamic keyword in C# 4, we can call the .Add method above exactly as it were statically typed like in our first code snippet. In this case, the calc object is statically typed to be dynamic (yes, that’s true). Once we have a dynamic object references, we can dynamically invoke methods, do dynamic conversion, etc.
  • MESSAGING:New Library = just an assembly, a normal .dll, used by any .NET languageDynamically Composed = composition takes place at runtime and composition behavior differs depending on how it is configured.
  • No Architectural level changes..No new enhancments on Base class libraries..uses same CLR 2.0 of .Net 2.0
  • No Architectural level changes..No new enhancments on Base class libraries..uses same CLR 2.0 of .Net 2.0
  • Transcript of "Its dotnet-framework4.0"

    1. 1. .NET Framework 4.0<br />Anbazhagan T.M.<br />agile. business solutions<br />
    2. 2. Session Outline<br />Look back<br />.NET 4.0<br />
    3. 3. Session Takeaways<br />Knowledge on .NET Evolution from 1.0 to 4.0<br />A Look back on earlier .NET version features<br />Refresh on .NET Architecture<br />.NET 4.0 Features<br />
    4. 4. Session Outline<br />Look back<br />.NET 4.0<br />
    5. 5. .NET Evolution<br />C# 3.0<br />ASP.Net 3.5<br />Other features..<br />WPF<br />WCF<br />WF<br />Cardspace<br />WPF<br />WCF<br />WF<br />Cardspace<br />C# 2.0<br />ASP.Net 2.0<br />Other features..<br />C# 2.0<br />ASP.Net 2.0<br />Other features..<br />Base class Libraries<br />Compact Framework, IPV6<br />Base class Libraries<br />Base class Libraries<br />Base class Libraries<br />Base class Libraries<br />CLR 2.0<br />CLR 2.0<br />CLR 2.0<br />CLR 1.0<br />CLR 1.1<br />.NET 3.5 sp1<br />.NET 3.0<br />.NET 2.0<br />.NET 1.0<br />.NET 1.1<br />2002<br />2003<br />2006<br />2007,08<br />2006<br />
    6. 6. .NET 1.1<br />
    7. 7. .NET 2.0<br />
    8. 8. .NET 3.0<br />
    9. 9. .NET 3.5 & 3.5 sp1<br />
    10. 10. .NET Framework – Overview<br />WPF<br />Win Forms<br />WWF<br />ASP.NET<br />WCF<br />And more!<br />LINQ<br />Base Class Libraries<br />The CLR<br />JIT & NGEN<br />Garbage Collector<br />Security Model<br />Exception Handling<br />Loader & Binder<br />
    11. 11. .NET Framework – Overview<br />
    12. 12. Session Outline<br />Look back<br />.NET 4.0<br />
    13. 13. .NET Framework 4.0<br />WPF<br />Win Forms<br />WWF<br />ASP.NET 4.0<br />WCF<br />MEF<br />LINQ<br />DLR<br />Task Parallel Library and Parallel Extensions<br />Code Contracts<br />And More!<br />Base Class Libraries 4.0<br />The CLR 4.0<br />JIT & NGEN<br />Background GC<br />Security Model<br />Exception Handling<br />Loader & Binder<br />AppDomain Monitoring<br />SxS Hosting<br />Type Embedding & Equivalence (No PIA)<br />
    14. 14. .NET 4.0 Features<br />
    15. 15. .NET 4.0 Features<br />
    16. 16. SxS – Before .NET 4.0<br />Side X Side releases solve app compat issue<br />COM objects and other addins for different layers of the same cake can easily live together on the same runtime<br />Highly compatible – but only certain kinds of functionality can be added<br />3.5<br />3.0<br />.NET 1.0<br />.NET 1.1<br />.NET 2.0<br />.NET 4.0<br />
    17. 17. And Now with .Net 4.0<br />i<br />2.0 addin<br />3.0 addin<br />3.5 addin<br />4.0 addin<br /><ul><li>Run both 2.0-based and 4.0-based CLR in the same process
    18. 18. Old components use old CLR
    19. 19. New components use new CLR</li></ul>3.5<br />.NET 4.0<br />3.0<br />.NET 2.0<br />Host Process (e.g. Outlook)<br />Configuration file and hosting APIs give you fine grained control<br />For both applications and COM, a config file describes which versions you run on, and which you prefer<br />
    20. 20. Common SxS Scenarios<br />
    21. 21. .NET 4.0 Features<br />
    22. 22. COM Interoperability<br />Primary Interop Assemblies (PIA) translate <br />between managed code and COM<br />For each interface, struct, enum, <br />delegate, and member, contains a <br />managed equivalent with marshalling data<br />
    23. 23. Difficulties with PIA<br />PIA must be deployed with the managed<br />Application which uses the COM <br />Entire PIA must be deployed although actual code <br />may use just a fraction of the PIA<br />Only the publisher of a type library can produce a true PIA<br />
    24. 24. Solution<br />Type Embedding and Equivalence<br />Compilers embedthe portions of the interop assemblies that the add-ins actually use<br />Runtime ensures the embedded definitions of these types are considered equivalent<br />
    25. 25. .NET 4.0 Features<br />
    26. 26. Client Profile<br />Subset of .NET 4 optimized for most<br />Client applications<br />- Application targets .NET Client profile 4.0 has <br />a smaller redistribution package that installs <br />minimum set of assemblies on user computer.<br /><ul><li>No need of full .NET 4.0 framework to be present
    27. 27. Quicker Install times</li></li></ul><li>Features<br />Included<br />CLR, WPF, WCF, MEF, Dynamic Types, WWF, <br />Entity Framework, LINQ to SQL and more..<br />Not Included<br />ASP.NET, MSBuild for compiling, .NET Data provider<br />For Oracle and Advanced WCF functionality<br />* To avail these, .NET 4 must be installed.<br />
    28. 28. Comparison with earlier version<br />3.5 sp1<br />4.0<br /><ul><li>Only Web Install
    29. 29. Only on Windows XP SP2 or SP3
    30. 30. Single Entry
    31. 31. Window upgrade it to full version
    32. 32. Local package and web install
    33. 33. Works on all platforms except for iA64
    34. 34. Part of .NET 4.0
    35. 35. Independent Component</li></li></ul><li>.NET 4.0 Features<br />
    36. 36. Dynamic Language Runtime [DLR]<br />Runtime environment that adds a <br />set of services for dynamic languages <br />to the common language runtime (CLR).<br />System.Dynamic namespace<br />enables a system of dynamic languages to run on the .NET Framework and give them .NET interoperability<br />
    37. 37. DLR Architecture<br />IronPython<br />IronRuby<br />C#<br />VB.NET<br />Others…<br />Dynamic Language Runtime<br />Expression Trees<br />Dynamic Dispatch<br />Call Site Caching<br />PythonBinder<br />RubyBinder<br />COMBinder<br />JScriptBinder<br />ObjectBinder<br />
    38. 38. Primary DLR Advantages<br />Simplifies Porting Dynamic Languages to the .NET Framework<br />Enables Dynamic Features in Statically Typed Languages<br />Provides Future Benefits of the DLR and .NET Framework<br />Enables Sharing of Libraries and Objects<br />Provides Fast Dynamic Dispatch and Invocation<br />
    39. 39. Dynamically Typed Objects<br />Calculator calc = GetCalculator();<br />int sum = calc.Add(10, 20);<br />object calc = GetCalculator();<br />TypecalcType = calc.GetType();<br />object res = calcType.InvokeMember("Add",<br />BindingFlags.InvokeMethod, null,<br />newobject[] { 10, 20 });<br />int sum = Convert.ToInt32(res);<br />ScriptObject calc = GetCalculator();<br />object res = calc.Invoke("Add", 10, 20);<br />int sum = Convert.ToInt32(res);<br />Statically typed to be dynamic<br />dynamic calc = GetCalculator();<br />int sum = calc.Add(10, 20);<br />Dynamic method invocation<br />Dynamic conversion<br />
    40. 40. .NET 4.0 Features<br />
    41. 41. Managed Extensibility Framework<br />New libraryin the .NET Framework that enables greater reuse of applications and components. Using MEF, .NET applications can make the shift from being statically compiled to dynamically composed.<br />
    42. 42. NO!<br />Are these all we have?<br />
    43. 43. We have more!<br /><ul><li>Appdomain monitoring
    44. 44. Globalization
    45. 45. Code Contracts
    46. 46. Background Garbage Collection
    47. 47. Covariance & Contravariance
    48. 48. Big Integer, Tuples and Complex Numbers
    49. 49. 64 Bit Operating System and Process
    50. 50. F# Support (Declarative Language)
    51. 51. Parallel Computing</li></li></ul><li>And more….<br /><ul><li>Networking API Improvements
    52. 52. Webform 4, AJAX 4, Razor Framework
    53. 53. Integrated ASP.NET Routing support
    54. 54. A Lot of WPF, WF and WCF 4
    55. 55. Entity Framework 4
    56. 56. WCF Data Services
    57. 57. Additional class libraries in BCL..</li></li></ul><li>References<br />.NET Framework version history<br />http://en.wikipedia.org/wiki/.NET_Framework_version_history<br />What is new in .NET framework 4.0<br />http://msdn.microsoft.com/en-us/library/ms171868.aspx<br />In-process side-by-side execution<br />http://msdn.microsoft.com/en-us/library/ee518876.aspx<br />Type Equivalence and Embedding<br />http://msdn.microsoft.com/en-us/library/dd997297.aspx<br />.NET client Profile<br />http://msdn.microsoft.com/en-us/library/cc656912.aspx<br />
    58. 58. References<br />Dynamic language runtime (DLR)<br />http://msdn.microsoft.com/en-us/library/dd233052.aspx<br />Managed Extensibility Framework<br />http://msdn.microsoft.com/en-us/library/dd460648.aspx<br />
    59. 59. Q&A<br />
    60. 60. Thank you!<br />
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×