• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Its dotnet-framework4.0
 

Its dotnet-framework4.0

on

  • 2,027 views

.NET Framework 4.0

.NET Framework 4.0

Statistics

Views

Total Views
2,027
Views on SlideShare
1,983
Embed Views
44

Actions

Likes
1
Downloads
71
Comments
0

1 Embed 44

http://localhost 44

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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'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 -> Because they have to talk to each other, they have to be using the same types for Excel -> Because of the way the type system works in the CLR, these types must also be in the same assembly -> 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

Its dotnet-framework4.0 Its dotnet-framework4.0 Presentation Transcript

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