Introduction

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Web Development in Dot Net

Outline
Introduction
Basics of Web Development
.NET Framework

Introduction
What is .NET ?
Is it software ?
Is it Language ?
Is it API ?

NET is actually a cluster of technologies that are


designed to help developers build a variety of
different types of applications.

Types of Application
An Application can be :
Web Application
Windows Application
Mobile Application
Web Service
Command Line Application

Introduction
Specific Subset of .NET Technologies used to
build web applications is called ASP(Active
Server Page ).
Also known as ASP.NET

Normally C# Language is used to build web


applications using ASP.NET.

Text Book
Author : Matthew
MacDonald

Objectives of the Course


Develop in depth understanding about .NET
framework and its core components.
Learning core C# language features.
Getting familiar with Visual Studio IDE.
Learning Web controls to develop basic web
applications.
Advance Web Development topics such as
session management, Security.

Cont.
Interacting with SQL Server Database and
building data driven applications.
Learning basics of IIS Server and deployment
process of .NET application.

Important Difference

Web site vs Web App.


A website is defined by its content, while a
web application is defined by its interaction
with the user.
Web site can be considered as subset of Web
application.
Normally Web sites have static content while
Web Apps are interactive.

Web Development
An HTML document has two types of content: the
text and the elements (or tags) that tell the
browser how to format it.
HTML forms allow web developers to design
standard input pages.
On the server side, a custom application receives
and processes the data.

Client vs Server side Prog.

Client vs Server side Prog.

Analysis
Server side programming works good but
there may be scalability issues.
Issues in Client side programming :
Isolation
Security
Browser Compatibility

Version History
Initial version of .NET was released in 2002 by
Microsoft. ( .NET 1.0 )
Current version of .NET framework is 4.6.1
Current Visual Studio version is Visual Studio
2015.
More Details :
http://www.dotnettricks.com/Tutorial/netframework/HJXU171213A-brief-version-history-of-.NET-Framework.html

The Framework
C++

C#

VB.NET Perl

J#

ASP .NET
Web Forms Web Services
Mobile Internet Toolkit

Windows
Forms

ADO .NET and XML


.NET Framework (Base Class Library)
Common Language Runtime
Operating System

.NET Framework
Base Class Library
.NET supplies a library of base classes that we can
use to implement applications quickly.
String handling, IO operations, graphics, text
handling, file operations and many more etc.

.NET Framework (Base Class Library)

Common Language Runtime


Operating System

.NET Framework
Data Access Layer
XML Extended mark-up language, is a universally
adopted language for internet message passing.
ADO.NET provides class for handling database connection
and maintenance with front-end .NET technology.

ADO .NET and XML


.NET Framework (Base Class Library)

Common Language Runtime


Operating System

.NET Framework
ASP.NET & Windows Forms
Create applications front-end Webbased user interface, Windows GUI,
Web services,
ASP .NET
Web Forms Web Services
Mobile Internet Toolkit

Windows
Forms

ADO .NET and XML


.NET Framework (Base Class Library)

Common Language Runtime


Operating System

.NET Framework
Programming Languages
Use your favorite language
C++

C#

VB.NET Perl

J#

ASP .NET
Web Forms Web Services
Mobile Internet Toolkit

Windows
Forms

ADO .NET and XML


.NET Framework (Base Class Library)

Common Language Runtime


Operating System

.NET Framework
Visual Studio .NET
C++

C#

VB

Perl

J#

Common Language Specification


Web Forms Web Services
Mobile Internet Toolkit

Windows
Forms

ADO .NET and XML


.NET Framework (Base Class Library)

Common Language Runtime


Operating System

Visual Studio .NET

ASP .NET

.NET Framework
Common Language Runtime
CLR is the heart and soul of the .net framework.
CLR is a runtime environment in which programs written in
C# and other .NET language are executed.
It also support s cross-language interoperability.

Common Language Runtime


Operating System

.NET Framework
Common Language Runtime

Thread Support

COM Marshaler

Type Checker

Exception Manager

Security Engine

Debug Engine

IL to Native
Compilers

Code
Manager

Class Loader

Garbage
Collector

Common Language Runtime


Manages running code like a virtual machine
Features of CLR :
Threading
Memory management
JIT-compiler produces native code during the program
installation or at run time
Type checker
Code can be verified to guarantee type safety
No unsafe casts, no un-initialized variables and no out-of-bounds
array indexing.

Automatic Memory Management


The CLR manages memory for managed code
Unused objects and buffers are cleaned up automatically
through Garbage Collection.
In computer science, garbage collection (GC) is a form of
automatic memory management. It is a special case
of resource management, in which the limited resource
being managed is memory. The garbage collector, or
just collector, attempts to reclaim garbage, or memory
occupied by objects that are no longer in use by
the program.
Opposite of manual memory management, which
requires the programmer to specify which objects to
deallocate and return to the memory system

Common Language Runtime


Code Access Security (CAS), in the Microsoft
.NET framework, is Microsofts solution to prevent
untrusted code from performing privileged actions .

When the CLR loads an assembly it will


obtain evidence for the assembly and use this to
identify the code group that the assembly belongs to.

A code group contains a permission set (one or


more permission). Code that performs a privileged
action will perform a code access demand.

Common Language Runtime


Role Based Security
Enforcing security consists of two parts,
Authentication and Authorization
Authentication : username & password/ anonymous
access
Authorization : is after authentication, checking for
grant or deny permission on particular set or portion
of program.

Finds the security information associated with


that user and based on this whether to grant
or deny permission that is decided by
application.

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)

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

IL Disassembler
Ildasm.exe

IL Assembler
Ilasm.exe Tool

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. This is how .NET provide multiple language
support.

When communicating between modules written in any .NET language,


the types are guaranteed to be compatible on the Intermediate level.
Hence calling one language from another does not require type
conversions.

The CTS also defines the rules that ensures that the data
types of objects written in various languages are able to
interact with each other.

Strings are a primitive data type now.

Common Language Specification (CLS)

Any language that conforms to the CLS is a .NET language


Specification implies some set of rules.
CLS is a subset of CTS, hence language supporting CLS can use
each others library as if they are their own.
API designed with rules of CLS, can easily be used by all the
.NET languages.
The specification defines an environment that allows multiple
high-level languages to be used on different computer
platforms without being rewritten for specific architectures.
Hence due to CLS, .NET supports cross-language
interoperability.

Code Compilation and Execution


Compilation

Source
Code

Language
Compiler

Execution

Native
Code

JIT
Compiler

Code
MSIL
Metadata

Also called
Assembly
(.EXE or
.DLL file)

Before
installation or
the first time
each method is
called

CLR activities during app. Execution.

Your program source code is converted to MSIL or


CIL with the use of language compiler.

MSIL is assembled into byte code.

This MSIL is platform independent insruction set executed by


virtual machine (i.e CLR)

CIL is then verified for safety during runtime, providing better


security and reliability.

CLR activities during app. Execution.

JIT involves turning MSIL into code immediately


executable by CPU(Native code).

JIT compiler uses metadata, which is data of data to


verify any illegal access and violations appropriately.

JIT compiles MSIL as and when needed, this saves


time and space in memory.

But results into performance hit.

NGEN ( Native Image Generator) compilation


eliminates this step at run time. It compiles
entire MSIL generated.

Namespace
Namespaces are the basic building block for
the .NET framework.
Namespaces are a way to define the classes
and other types of information into one
hierarchical structure
System is the basic namespace used by every
.NET code.

Namespace

Visual Studio
Visual Studio is a complete set of
development tools for building ASP.NET Web
applications, XML Web Services, desktop
applications, and mobile applications.
It has rich code editor, debugger, designer and
other development utilities.

Thank You

You might also like