Saturday, January 14, 2012

What is difference between dot net framework 3.5 and 4.0?



ASP.NET 3.5 is having the following main features which are not availablle in the prior releases


1) AJAX integration

2) LINQ
3) Automatic Properties
4) Lambda expressions



I hope it would be useful for everyone to know about the differences about asp.net 3.5 and its next version asp.net 4.0



Because of space consumption I'll list only some of them here.



1) Client Data access:


ASP.NET 3.5: There is no direct method to access data from client side. We can go for any of these methods



1) Pagemethods of script manager

2) ICallbackEventHandler interface
3) XMLHttphanlder component



ASP.NET 4.0: In this framework there is an inbuilt feature for this. Following are the methods to implement them.



1) Client data controls

2) Client templates
3) Client data context



i.e we can access the data through client data view & data context objects from client side.



2) Setting Meta keyword and Meta description:


Meta keywords and description are really useful for getting listed in search engine.


ASP.NET 3.5: It has a feature to add meta as following tag



<meta name="keywords" content="These, are, my, keywords" /> 

<meta name="description" content="This is the description of my page" /> 



ASP.NET 4.0: Here we can add the keywords and description in Page directives itself as shown below.



< %@ Page Language="C#" CodeFile="Default.aspx.cs" 

Inherits="_Default" 
Keywords="Keyword1,Key2,Key3,etc" 
Description="description" %>



3) Enableviewstage property for each control



ASP.NET 3.5: this property has two values "True" or "false"



ASP.NET 4.0: ViewStateMode property takes an enumeration that has three values: Enabled, Disabled, and Inherit.

Here inherit is the default value for child controls of a control.



4) Setting Client IDs

Some times ClientID property creates head ach for the programmers.



ASP.NET 3.5: We have to use ClientID property to find out the id which is dynamically generated



ASP.NET 4.0: The new ClientIDMode property is introduced to minimize the issues of earlier versions of ASP.NET.



It has following values.



AutoID - Same as ASP.NET 3.5

Static - There won't be any separate clientid generated at run time
Predictable-These are used particularly in datacontrols. Format is like clientIDrowsuffix with the clientid vlaue
Inherit- This value specifies that a control's ID generation is the same as its parent.


And now lets discuss about the .net framework differences:

Diagnostics and Performance

Earlier versions of the .NET Framework provided no way to determine whether a particular application domain was affecting other application domains, because the operating system APIs and tools, such as the Windows Task Manager, were precise only to the process level. Starting with the .NET Framework 4, you can get processor usage and memory usage estimates per application domain.

You can monitor CPU and memory usage of individual application domains. Application domain resource monitoring is available through the managed and native hosting APIs and event tracing for Windows (ETW). When this feature has been enabled, it collects statistics on all application domains in the process for the life of the process. See the new AppDomain.MonitoringIsEnabled property.

You can now access the ETW events for diagnostic purposes to improve performance. For more information, see CLR ETW Events and Controlling .NET Framework Logging. Also see Performance Counters and In-Process Side-By-Side Applications.

The System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute attribute enables managed code to handle exceptions that indicate corrupted process state.

Globalization

The .NET Framework 4 provides new neutral and specific cultures, updated property values, improvements in string handling, and other improvements. For more information, see What's New in Globalization and Localization.

Garbage Collection

The .NET Framework 4 provides background garbage collection. This feature replaces concurrent garbage collection in previous versions and provides better performance. For more information, see Fundamentals of Garbage Collection.

Code Contracts

Code contracts let you specify contractual information that is not represented by a method's or type's signature alone. The new System.Diagnostics.Contracts namespace contains classes that provide a language-neutral way to express coding assumptions in the form of preconditions, postconditions, and object invariants. The contracts improve testing with run-time checking, enable static contract verification, and support documentation generation. For more information, see Code Contracts.

Design-Time-Only Interop Assemblies

You no longer have to ship primary interop assemblies (PIAs) to deploy applications that interoperate with COM objects. In the .NET Framework 4, compilers can embed type information from interop assemblies, selecting only the types that an application (for example, an add-in) actually uses. Type safety is ensured by the common language runtime. See Using COM Types in Managed Code and Walkthrough: Embedding Type Information from Microsoft Office Assemblies (C# and Visual Basic).

Dynamic Language Runtime

The dynamic language runtime (DLR) is a new runtime environment that adds a set of services for dynamic languages to the CLR. The DLR makes it easier to develop dynamic languages to run on the .NET Framework and to add dynamic features to statically typed languages. To support the DLR, the new System.Dynamic namespace is added to the .NET Framework.

The expression trees are extended with new types that represent control flow, for example, System.Linq.Expressions.LoopExpression and System.Linq.Expressions.TryExpression. These new types are used by the dynamic language runtime (DLR) and not used by LINQ.

In addition, several new classes that support the .NET Framework infrastructure are added to the System.Runtime.CompilerServices namespace. For more information, see Dynamic Language Runtime Overview.

Covariance and Contravariance

Several generic interfaces and delegates now support covariance and contravariance. For more information, see Covariance and Contravariance in Generics.

BigInteger and Complex Numbers

The new System.Numerics.BigInteger structure is an arbitrary-precision integer data type that supports all the standard integer operations, including bit manipulation. It can be used from any .NET Framework language. In addition, some of the new .NET Framework languages (such as F# and IronPython) have built-in support for this structure.

The new System.Numerics.Complex structure represents a complex number that supports arithmetic and trigonometric operations with complex numbers.

Tuples

The .NET Framework 4 provides the System.Tuple class for creating tuple objects that contain structured data. It also provides generic tuple classes to support tuples that have from one to eight components (that is, singletons through octuples). To support tuple objects that have nine or more components, there is a generic tuple class with seven type parameters and an eighth parameter of any tuple type. 

File System Enumeration Improvements

New file enumeration methods improve the performance of applications that access large file directories or that iterate through the lines in large files. For more information, see How to: Enumerate Directories and Files.

Memory-Mapped Files

The .NET Framework now supports memory-mapped files. You can use memory-mapped files to edit very large files and to create shared memory for interprocess communication.

64-Bit Operating Systems and Processes

You can identify 64-bit operating systems and processes with the Environment.Is64BitOperatingSystem and Environment.Is64BitProcess properties.

You can specify a 32-bit or 64-bit view of the registry with the Microsoft.Win32.RegistryView enumeration when you open base keys.

Some more differences :

  • To support culture-sensitive formatting, the System.TimeSpan structure includes new overloads of the ToString, Parse, and TryParse methods, as well as new ParseExact and TryParseExact methods.
  • The new String.IsNullOrWhiteSpace method indicates whether a string is null, empty, or consists only of white-space characters. New overloads have been added to the String.Concat and String.Join methods that concatenate members of System.Collections.Generic.IEnumerable(Of T) collections.
  • The String.Concat method lets you concatenate each element in an enumerable collection without first converting the elements to strings.
  • Two new convenience methods are available: StringBuilder.Clear and Stopwatch.Restart.
  • The new Enum.HasFlag method determines whether one or more bit fields or flags are set in an enumeration value. The Enum.TryParse method returns a Boolean value that indicates whether a string or integer value could be successfully parsed.
  • The System.Environment.SpecialFolder enumeration contains several new folders.
  • You can now easily copy one stream into another with the CopyTo method in classes that inherit from the System.IO.Stream class.
  • New Path.Combine method overloads enable you to combine file paths.
  • The new System.IObservable(Of T) and System.IObserver(Of T) interfaces provide a generalized mechanism for push-based notifications.
  • The System.IntPtr and System.UIntPtr classes now include support for the addition and subtraction operators.
  • You can now enable lazy initialization for any custom type by wrapping the type inside a System.Lazy(Of T) class.
  • The new System.Collections.Generic.SortedSet(Of T) class provides a self-balancing tree that maintains data in sorted order after insertions, deletions, and searches. This class implements the new System.Collections.Generic.ISet(Of T) interface.
  • The compression algorithms for the System.IO.Compression.DeflateStream and System.IO.Compression.GZipStream classes have improved so that data that is already compressed is no longer inflated. Also, the 4-gigabyte size restriction for compressing streams has been removed.
  • The new Monitor.Enter(Object, Boolean) method overload takes a Boolean reference and atomically sets it to true only if the monitor is successfully entered.
  • You can use the Thread.Yield method to have the calling thread yield execution to another thread that is ready to run on the current processor.
  • The System.Guid structure now contains the TryParse and TryParseExact methods.
  • The new Microsoft.Win32.RegistryOptions enumeration lets you specify a volatile registry key that does not persist after the computer restarts.
  • Registry keys are no longer restricted to a maximum length of 255 characters.
Components and Layers of .NET Framework versions


For more specific and detailed view visit : 
"What's New in the .NET Framework 4"   
 and  
 ".NET Framework Versions and Dependencies"

No comments:

Post a Comment

Live

Your Ad Here