Ready to mingle with NET?
Ready to mingle with .NET?
                    Introduction
•   What is .NET?
•   What is .NET Framework?
•   Features of .NET Framework
•   .NET Framework Architecture
•   What is Common Language Runtime (CLR)?
•   Wh t i C
    What is Common Type System (CTS)?
                      T    S t    (CTS)?
•   Language that we will use‐C#
•   But why C#?
    But why C#?
•   Something more about .NET
•   Million Dollar Question: Why should we learn .NET?
                               y
                  What is .NET?
                  What is .NET?
A technology developed by Microsoft for
• Console Applications
• Windows Applications
• Web Based Applications
   Web Based Applications
• Windows Services
• Class Libraries
• Control Libraries
• Mobile Applications
• & Many More……
   & Many More……
      Requires .NET Framework for applications to run
      What is .NET Framework?
      What is .NET Framework?
• Next
  Next iteration of Microsoft
       iteration of Microsoft’ss platform for 
                                 platform for
  developing component based applications.
• An environment for running .NET applications.
  An environment for running NET applications
• Essentially a system application that runs on 
  Wi d
  Windows.
      What is .NET Framework?
      What is .NET Framework?
Windows Forms
Windows Forms                Web Forms
                             Web Forms                   Web Services
                                                         Web Services
                         Data and XML Classes
                        (ADO NET SQL XML )
                        (ADO.NET, SQL, XML …)
                        Framework Base Classes
(IO, String, Net, XML, Security, Threading, Text, Reflection, Collection…)
(IO, String, Net, XML, Security, Threading, Text, Reflection, Collection…)
                     Common Language Runtime
          (debug, exceptions, type checking, JIT compilation)
                  Windows Operating System
             How it works???
             How it works???
                            Source Code 
                   (
                   (C#.NET ,Visual Basic.NET etc.)
                           ,                     )
                        Compilation Stage 1
Compilation of source code to MIL (Microsoft Intermediate Language)
                       Compilation Stage 2
                       C     il i S       2
        Compilation of MIL to platform specific code by CLR
                      Application Execution
      Application executed by the Windows Operating System
             How it works???
             How it works???
• Every
  Every program is actually stored as MIL also 
        program is actually stored as MIL also
  called as Managed Code (We’ll see it shortly).
• The CLR on the target machine finds the type 
  The CLR on the target machine finds the type
  of  code which the target machine 
  understands.
  understands
• Converts the MIL to that code and 
voila….The application executes.
       Features of .NET Framework
       Features of .NET Framework
•   Security
•   Garbage Collection
•   Platform Independence (Theoretical at the moment)
    Platform Independence    (Theoretical at the moment)
•   Language Interoperability
•   C d A
    Code Access Security
                  S    it
•   Efficient Error Handling mechanisms
•   Memory Management
•   and Many More…
    Components of .NET Framework
    Components of .NET Framework
•   Common Language Runtime (CLR)
    Common Language Runtime (CLR)
•   Common Type System (CTS)
•   C
    Common Language Specification (CLS)
                       S ifi i (C S)
•   Framework Class Libraries (FCL)
 Common Language Runtime (CLR)
 Common Language Runtime (CLR)
• Runtime
  Runtime execution environment for .NET 
           execution environment for NET
  Applications.
• Provides support for language interoperability.
  Provides support for language interoperability
  – One program in C#
  – One in VB
    O i VB
  – Compile one to MIL. Use it in other.
• Provides security by allowing to run managed 
  code.
         Common Type System
         Common Type System
• Provides
  Provides common types to all languages
            common types to all languages
• Integer in Visual Basic is same as 
  i in C# is same as
  int i C i
  Int32 class.
• Helps to provide Language Interoperability
 Common Language Specification
 Common Language Specification
• Set
  Set of minimum standards to be followed for 
       of minimum standards to be followed for
  .NET applications.
• All compilers supporting .NET must have these 
  All compilers supporting NET must have these
  specifications.
• Such code is called CLS compliant code.
  S h d i         ll d CLS     li     d
• A compiler without CLS compliant code is not 
  guaranteed to provide interoperability.
       Framework Class Libraries
       Framework Class Libraries
• Provide a large number class libraries to be used 
               g
  for creating applications for windows platform.
• Provides efficient implementations for basic 
  operations like input output etc
  operations like input output etc.
• Makes application development faster.
• Help developer to concentrate more on business 
  Help developer to concentrate more on business
  logic
• Examples are
        p
       » Database Connectivity
       » Cryptography
       » Network communications etc.
   Languages that .NET Supports
   Languages that .NET Supports
• .NET supports around 20 different languages.
   NET supports around 20 different languages
• The languages provided by Microsoft Visual 
  Studio include C# Visual Basic Visual J#
  Studio include C#, Visual Basic, Visual J#, 
  Visual C++, J++ etc.
• Other languages are Perl, Delphi etc.
  Oh l                 P l D l hi
• Language we are going to use : C#
              But why C#?
              But why C#?
• Easy
  Easy to learn
       to learn
• Syntax 
  70% Java+20% C/C++ + 10% own
   0%        20% C/C       0%
• Created by keeping in view .NET
• Supports modern Object Oriented 
     g         g     p
  Programming concepts.
    Something more about .NET
    Something more about .NET
• .NET Versions
   NET Versions
• .NET IDE
               .NET Versions
               .NET Versions
• .NET 1.1
   NET 1 1
• .NET 2.0 (Currently used in most of the 
  applications)
• .NET 3.0 (Introduced WCF, WPF)
• .NET 3.5 (Released recently)
     .NET Integrated Development 
           Environment (IDE)
                       ( )
• Microsoft Visual Studio
  Microsoft Visual Studio
• Versions
  – 2003 (for .NET 1.1)
    2003 (f NET 1 1)
  – 2005 (for .NET 2.0 and 3.0)
  – 2008 (for .NET 3.5)
         (            )
   But why should we learn .NET?
   But why should we learn .NET?
• Easy
  Easy to learn platform for developing 
       to learn platform for developing
  Windows applications.
• Provides support for many different languages 
  Provides support for many different languages
  unlike Sun Java which supports only Java.
• Provides security by providing support for 
  Provides security by providing support for
  Common language runtime which runs 
  managed code just like JVM.
• Provides support for developing web 
  applications with great GUI
   But why should we learn .NET?
   But why should we learn .NET?
• Provides support for writing and programming 
               pp             g     p g         g
  COM components.
• Compiles code using JIT (Just In Time) which 
  improves efficiency in program execution
  improves efficiency in program execution.
• Generates Microsoft Intermediate Language 
  which can then be converted to target machine
  which can then be converted to target machine 
  language, thus providing platform independency 
  (only theoretical at the moment).
• Provides efficient garbage collection mechanism.
  P id       ffi i       b      ll i       h i
• Its in your syllabus