Understanding .
NET Framework
.NET Enterprise Vision
Users
Any device,
Any place,
Any time
XML Web
Services
Integrate business
Authentication applications and
Scheduling processes
Notification
Back Office
Heterogeneous
application and
server
infrastructure
Customer Sales
ERP & Billing Service 2
So what is .NET?
• .NET is a platform that provides a standardized set of
services.
• It’s distributed over the Internet.
• Provides a common interface so that it’s programs can
be run on any system that supports .NET.
• Includes common language runtime(CLR)
3
.NET Framework
• Programming model for .NET
• Platform for running .NET managed code.
• Provides a very good environment to develop networked
applications and Web Services
4
The Core of .NET Framework: FCL & CLR
• Common Language Runtime
• Garbage collection
• Language integration
• Multiple versioning support (no more DLL hell!)
• Integrated security
• Framework Class Library
• Provides the core functionality:
ASP.NET
Web Services
ADO.NET
Windows Forms
XML, etc.
5
.NET
Framework
Common Language Runtime
• CLR manages code execution at runtime
• Memory management, thread management, etc.
Common Language Runtime
Operating System
6
Common Language Runtime
• Manages running code
• Threading
• Memory management
• JIT-compiler produces native code – during the program
installation or at run time
• Code access security
• Code can be verified to guarantee type safety
• No un-initialized variables and no out-of-bounds
array indexing
7
.NET Framework
Base Class Library
• Object-oriented collection of reusable types
• Collections, I/O, Strings, …
.NET Framework (Base Class Library)
Common Language Runtime
Operating System
8
Base Class Libraray
• Includes a set of standard class libraries.
• These class libraries execute common functions, such as graphic
rendering, database interaction, and XML document
manipulation, among others.
• Collection of reusable types that are closely integrated with the
CLR.
• Object-oriented class library which aims to accomplish a range of
common programming tasks
9
.NET Framework
Data Access Layer
• Access relational databases
• Disconnected data model
• Work with XML
ADO .NET and XML
.NET Framework (Base Class Library)
Common Language Runtime
Operating System
10
.NET Framework
ASP.NET & Windows Forms
• Create application’s front-end – Web-based user
interface, Windows GUI, Web services, …
ASP .NET Windows
Web Forms Web Services
Mobile Internet Toolkit
Forms
ADO .NET and XML
.NET Framework (Base Class Library)
Common Language Runtime
Operating System
11
.NET Framework
Programming Languages
• Use your favorite language
C++ C# VB.NET Perl J# …
ASP .NET Windows
Web Forms Web Services
Mobile Internet Toolkit
Forms
ADO .NET and XML
.NET Framework (Base Class Library)
Common Language Runtime
Operating System
12
.NET Framework
Common Language Specification
C++ Common
C# VBLanguage
Perl Specification
J# …
ASP .NET Windows
Web Forms Web Services
Mobile Internet Toolkit
Forms
ADO .NET and XML
.NET Framework (Base Class Library)
Common Language Runtime
Operating System
13
.NET Framework
Visual Studio .NET
C++ C# VB Perl J# …
Common Language Specification
Visual Studio .NET
ASP .NET Windows
Web Forms Web Services
Mobile Internet Toolkit
Forms
ADO .NET and XML
.NET Framework (Base Class Library)
Common Language Runtime
Operating System
14
Managed Code
• Code that targets the CLR is referred to as managed code
• All managed code has the features of the CLR
• Object-oriented
• Type-safe
• Cross-language integration
• Cross language exception handling
• Multiple version support
• Managed code is represented in special Intermediate
Language (IL)
15
Multiple Language Support
IL (MSIL or CIL) – Intermediate Language
It is low-level (machine) language, but it is Object-oriented
CTS is a rich type system built into the CLR
Implements various types (int, float, string, …)
And operations on those types
CLS is a set of specifications that all languages and libraries
need to follow
This will ensure interoperability between languages
16
Intermediate Language
• .NET languages are compiled to an Intermediate
Language (IL)
• IL is also known as MSIL or CIL
• CLR compiles IL in just-in-time (JIT) manner – each
function is compiled just before execution
17
Example of MSIL Code
.method private hidebysig static void Main()
cil managed
{
.entrypoint
// Code size 11 (0xb)
.maxstack 8
IL_0000: ldstr "Hello, world!"
IL_0005: call void
[mscorlib]System.Console::WriteLine(string)
IL_000a: ret
} // end of method HelloWorld::Main
18
Common Type System (CTS)
• All .NET languages have the same primitive data types. An
int in C# is the same as an int in VB.NET
• Types can be:
• Value types – passed by value, stored in the stack
• Reference types – passed by reference, stored in the heap
• Strings are a primitive data type now
Common Language Specification (CLS)
• Any language that conforms to the CLS is a .NET language
• A language that conforms to the CLS has the ability to take
full advantage of the Framework Class Library (FCL)
19
.NET Languages
• Languages provided by Microsoft
• C++, C#, J#, VB.NET, Jscript
• Third-parties languages
• Perl, Python, Pascal, APL, COBOL, Eiffel, Haskell, ML,
Oberon, Scheme, Smalltalk…
20
C# Language – Example
using System;
class HelloWorld
{
public static void main()
{
Console.WriteLine(“Hello, world!”);
}
}
21
Code Compilation and Execution
Compilation
Also called
Source Language Code
Assembly
Code Compiler MSIL
Metadata (.EXE or
.DLL file)
Before
installation or
the first time
Execution each method is
called
Native JIT
Code Compiler
22
Assemblies
• DLL or EXE file
• Smallest deployable unit in the CLR
• Have unique version number
• No version conflicts (known as DLL hell)
• Contains IL code to be executed
• Security boundary – permissions are granted at the
assembly level
• Self-describing manifest – metadata that describes the
types in the assembly
23
Visual Studio .NET
• Integrate Development Environment (IDE) tool that contains
a rich set of features
• Supports managed and unmanaged applications
• Supports C#, C++, VB.NET, …
• Many useful tools and wizards
• Windows Forms Designer
• ASP.NET Web Forms Designer
• Web Services support
• SQL Server integration with ADO.NET and XML
• The .NET Framework SDK includes command line
compilers
24
Visual Studio .NET - Snapshot
25
ADO.NET and XML
• ADO.NET consumes all types of data
• XML (hierarchical), relational, etc.
• Powerful in-memory data cache (DataSet). DataSet contains
various data objects:
• Tables
• Views
• Relations
• Constraints, etc.
• Supports both connected and disconnected access
26
VS.NET – DataSet Designer
27
Windows Forms
• Windows Forms is framework for building rich GUI applications
• RAD (Rapid Application Development)
• component-based
• event-driven
• Rich set of controls
• Data aware components
• ActiveX® Support
• Printing support
• Unicode support
• UI inheritance 28
Benefits of .NET Framework
1. Less Coding and Increased Reuse of Code
2. Deployment
3. Reliability
4. Security
5. Use across Platforms & Languages
6. Use of Service Oriented Architecture
7. Integration with Legacy Systems
29
Benefits of .NET Framework
Less Coding and Increased Reuse of Code
•This framework uses OO programming hence less coding for the
developers
•.NET consists of re-useable code. This makes less time and cost
to develop applications.
Deployment
•With features such as controlled code sharing, side-by-side
versioning, the .NET framework makes deployment easier
•The code execution environment supports safe code execution for
reduced conflicts in software deployment and versioning
Reliability
.NET performance on Microsoft® Windows Server™ and other
Windows Server families is also very stable and reliable.
30
Benefits of .NET Framework
Security
•Offers enhanced application security using various XML
configuration settings
•Managed code & CLR offers safeguard features such as role-
based security & code access security.
Use across Platforms and Languages
•Allows developers to build applications for desktop/web/mobile
•Promoted as a language-independent framework, hence
development can happen in different languages that include C#,
Managed C++, VB.NET & more
Use for Service-Oriented Architecture (SOA)
•Use Web Services, a solution for executing an SOA strategy.
•Through Web Services, applications designed in different
programming languages or platforms, are able to communicate and
31
transmit data utilizing standard protocols.
Benefits of .NET Framework
Integration with Legacy Systems
•.NET to process all types of XML documents and write any format
of file with ease.
•This provides multiple routes for integration.
32
.NET Framework – Can you identify the
Components???
C++ C# VB Perl J# …
<<4>>
Windows
<<3>>
Forms
<<5>>
<<2>>
.NET Framework (Base Class Library)
<<1>>
Operating System
33
Code Compilation and Execution -
Find
Compilation
Language <<2>>
VB.NET Compiler MSIL
<<3>>
<<1>>
Execution (<<5>>)
Native <<4>>
Code
34
Visual Studio
Installing Visual Studio .Net
•Visual Studio Enterprise 2019
•Visual Studio Professional 2019
•Visual Studio Community 2019
•Visual Studio Team Foundation Server Office Integration
2019 34
https://visualstudio.microsoft.com/
34
.NET Framework – Resources
• .NET Framework Home Site –
http://msdn.microsoft.com/netframework/
• ASP.NET – http://www.asp.net/
• Code Project – http://www.codeproject.net/
35