Introduction of .net framework - DotNetSpider

basiliskcanoeSoftware and s/w Development

Nov 2, 2013 (3 years and 9 months ago)

75 views

Created by Neetu Gangwani

1

.Net
Introduction

Created by Neetu Gangwani

2

What is .Net?


.
NET

is

a

framework

which

allow

us

to

build

distributed,

secure,

scaleable,

robust,

easily

deployable

and

maintainable

applications

in

a

language

independent,

object

oriented,

web

enabled,

managed

way

using

rich

level

of

integration

amongst

present

technologies
.


Created by Neetu Gangwani

3

Type of applications


Windows application


Word, excel


Component library


Scheduler.dll


Chatmaster.dll


Web application


Any home page


E
-
commerce site


Distributed application


Banking application


E
-
commerce
application



Mobile apps


Trip planner


Pocket reminder


Embedded apps


Flight controller


Engine controller

Created by Neetu Gangwani

4

Adv. Of .NET


Consistent programming model


Powerful class library


Language of choice


Better runtime


Language interoperability


Built on same OS.

Created by Neetu Gangwani

5



Objectives of .Net Framework


To

provide

a

consistent

object
-
oriented

programming

environment

whether

object

code

is

stored

and

executed

locally,

executed

locally

but

Internet
-
distributed,

or

executed

remotely
.



To

provide

a

code
-
execution

environment

that

promotes

safe

execution

of

code,

including

code

created

by

an

unknown

or

semi
-
trusted

third

party
.


Created by Neetu Gangwani

6



Objectives of .Net Framework


To

provide

a

code
-
execution

environment

that

eliminates

the

performance

problems

of

scripted

or

interpreted

environments
.



To

make

the

developer

experience

consistent

across

widely

varying

types

of

applications,

such

as

Windows
-
based

applications

and

Web
-
based

applications
.



To

build

all

communication

on

industry

standards

to

ensure

that

code

based

on

the

.
NET

Framework

can

integrate

with

any

other

code
.


Created by Neetu Gangwani

7


Consist of


Base Class Library


CTS (Common Type System)


CLS (Common Language Specification)


CLR (Common Language Runtime)


.
Net Framework

Created by Neetu Gangwani

8

Visual
Studio

.NET

VB

C#

C++

JScript

………

Common Language Specification (CLS)

ASP.NET

Windows Forms

ADO.NET

XML

Windows

COM+ Services

Common Language Runtime (CLR)

Base Class Library

Created by Neetu Gangwani

9

Common programming model


The

elegance

of

.
NET

is

that

if

a

form

has

been

design

in

C#,

one

can

either

use

it

as

it

is

or

inherit

that

form

to

add

some

more

functionality

before

displaying

it
.


Winform

controls

as

compare

to

ActiveX

controls

can

be

easily

developed

and

can

be

used

in

the

different

languages
.


Created by Neetu Gangwani

10

Base class library


The

.
NET

framework

includes

a

rich

set

of

classes

that

provides

the

comprehensive

functionality

for

any

type

of

application

one

intends

to

develop
.


The

application’s

functionalities

like

messaging,

database

access,

security,

drawing

and

many

more
.


All

the

classes

in

the

framework

class

library

are

organized

in

different

namespaces
.

Created by Neetu Gangwani

11

Common Type System


The

common

type

system

defines

how

types

are

declared,

used,

and

managed

in

the

runtime,

and

is

also

an

important

part

of

the

runtime's

support

for

cross
-
language

integration
.

The

common

type

system

performs

the

following

functions
:



Establishes

a

framework

that

helps

enable

cross
-
language

integration,

type

safety,

and

high

performance

code

execution
.


Provides

an

object
-
oriented

model

that

supports

the

complete

implementation

of

many

programming

languages
.


Defines

rules

that

languages

must

follow,

which

helps

ensure

that

objects

written

in

different

languages

can

interact

with

each

other
.


Created by Neetu Gangwani

12

CLS


To

fully

interact

with

other

objects

regardless

of

the

language

they

were

implemented

in,

objects

must

expose

to

callers

only

those

features

that

are

common

to

all

the

languages

they

must

interoperate

with
.

For

this

reason,

the

Common

Language

Specification

(CLS),

which

is

a

set

of

basic

language

features

needed

by

many

applications,

has

been

defined
.

The

CLS

rules

define

a

subset

of

the

Common

Type

System
.

that

is,

all

the

rules

that

apply

to

the

common

type

system

apply

to

the

CLS,

except

where

stricter

rules

are

defined

in

the

CLS
.

The

CLS

helps

enhance

and

ensure

language

interoperability

by

defining

a

set

of

features

that

developers

can

rely

on

to

be

available

in

a

wide

variety

of

languages
.


Created by Neetu Gangwani

13

Common Language Runtime


CLR

handles

object

creation

and

destruction

and

hence

relieves

programmer

from

destroying

the

object

explicitly
.


CLR

releases

the

object

when

they

are

no

longer

being

used
.


Automatic

memory

management

eliminates

memory

leaks

as

well

as

some

other

programming

errors
.


CLR

also

handles

runtime

errors

and

informs

the

concerned

application

about

them
.


CLR

also

provides

a

secured

environment

when

a

winform

application

is

downloaded

from

the

web

server
.


Cross
-
language

integration,

especially

cross
-
language

inheritance
.


Garbage

collection,

which

manages

object

lifetime

so

that

reference

counting

is

unnecessary
.

Created by Neetu Gangwani

14

Runtime


When

.
NET

compliant

language

complier

complies

the

source

code

it

emits

code

in

intermediate

language

(IL)
.



This

code

is

processor

independent

code
.


The

Just
-
In
-
Time

(JIT)

complier

that

Common

language

runtime

(CLR)

provides

complies

this

code

to

the

processor

specific

code

(native

code)

which

is

then

executed


The

advantage

of

the

IL

is

that

it

can

be

executed

wherever

.
NET

is

present
.


Created by Neetu Gangwani

15

MSIL


When

compiling

to

managed

code,

the

compiler

translates

your

source

code

into

Microsoft

intermediate

language

(MSIL),

which

is

a

CPU
-
independent

set

of

instructions

that

can

be

efficiently

converted

to

native

code



MSIL

includes

instructions

for

loading,

storing,

initializing,

and

calling

methods

on

objects,

as

well

as

instructions

for

arithmetic

and

logical

operations,

control

flow,

direct

memory

access,

exception

handling,

and

other

operations
.


Created by Neetu Gangwani

16

MSIL & Metadata


Before

code

can

be

run,

MSIL

must

be

converted

to

CPU
-
specific

code,

usually

by

a

JIT

(Just

in

time

compiler)
.


When

a

compiler

produces

MSIL,

it

also

produces

metadata
.

Metadata

describes

the

types

in

your

code,

including

the

definition

of

each

type,

the

signatures

of

each

type's

members,

the

members

that

your

code

references,

and

other

data

that

the

runtime

uses

at

execution

time
.


Created by Neetu Gangwani

17

MetaData


Metadata

is

binary

information

describing

your

program

that

is

stored

either

in

a

common

language

runtime

portable

executable

(PE)

file

or

in

memory
.

When

you

compile

your

code

into

a

PE

file,

metadata

is

inserted

into

one

portion

of

the

file,

while

your

code

is

converted

to

Microsoft

intermediate

language

(MSIL)

and

inserted

into

another

portion

of

the

file
.

Every

type

and

member

defined

and

referenced

in

a

module

or

assembly

is

described

within

metadata
.

When

code

is

executed,

the

runtime

loads

metadata

into

memory

and

references

it

to

discover

information

about

your

code's

classes,

members,

inheritance,

and

so

on
.

Created by Neetu Gangwani

18

MetaData


Description of the assembly.


Identity (name, version, culture, public key).


The types that are exported.


Other assemblies that this assembly depends
on.


Security permissions needed to run.


Description of types.


Name, visibility, base class, and interfaces
implemented.


Members (methods, fields, properties, events,
nested types).


Attributes.


Additional descriptive elements that modify
types and members