You are on page 1of 54

.

NET

Why .NET ?
Why .net
• .NET is used for network and internet
computing .
• First we learn about types networks and
network computing.
Different types of networks
• LAN(Local Area network)
• MAN(Metropolitan Area Network)
• WAN(Wide Area Network)
• EAN(Enterprise Area Network)
LAN
• Network Limited to single organization located
at single place is known as LAN.
• Ex:-in a bank, an organization ,an office.
MAN
• Network limited to single city and its sub-
urban places is known as MAN
• Ex:-citi cable network.
WAN
• Network which has no limit in the univese is
known as WAN.
• Ex:-Internet
EAN
• There are 2 categories available in this
Intranet, extranet
• Intranet:-network limited to group of single
organization located at places is intranet. EX-
banking network.
• Extranet:- network limited to group of
organizations located at various place is
known as extranet .EX-ATM network
Centralized computing
• Centrally located the server.
• All other computer are connected to this
server are client.
• These clients connected to the server are
known as dumb terminals because there are
no resources present at client side like:-
processor,ram, hard disk,os
Disadvantages of centralized computing

• Increase the clients:-


• Burden on server increases and performance
decrease on client.
Client server computing
• Client are connected to centrally located
server similar to centralized computing but
client are now as smart or intelligent terminals
because every client contains all the
resources like-process ram hard disk ,os
• Client need not depend on server processing.
Advantage of client server computing

• There doesn't be any burden on the web


server and network
Distributed computing
• In this method, the logic code of an
application that is to be executed is divided
among many machines in the network, to
complete the execution at faster rate and to
provide the flexibility.
• After completion of execution result will be
integrated.
Current scenario of Distributed computing

• In this method server are inter connected with


in the internet/network
• Once the data is available with in the server, it
should be able to be accessed and processed
from any kind of client device like computer,
laptop, mobile phone, atm etc.
Why .net?
• .NET is very much powerful tool used to build
distributed computing applications.
• .NET is a frame work tool which supports
many programming languages.
• .net support 61 programming languages.
Among them 9 are designed by Microsoft.
• http://www.dotnetpowered.com/languages.a
spx
List of Microsoft designed programming
languages.
• C#.net
• Vb.net
• J#.net
• Jscript.net
• C++.net
• F#.net
• Window power shell
• Iron python
• Iron ruby
What is .net
• It is a network enable technology. Different
application are available in .NET
• Desktop application:-CUI,GUI
• Web application:-
• Console application:-
• Mobile application:-
framework

• In .net compile code (intermediate code) doesn’t


directly execute under the os. it execute within
the control of a special s/w know as framework
as following.
• A framework is a s/w which makes the
functionality of os and makes the code into
execute under its controls.(open s/w)
• The code which is run under the framework is
called as managed code because it gets few
advantages like:-platform independence, security
automatic memory management
Framework architecture

LINQ ADO.NET entity framework


WCF WPF WF
ADO.NET ASP.NET WIN FORMS
Base class library
CLR
Components of framework
• CLR(common language runtime)
• BCL(base class libraries)or FCL(frame work class
libraries)
• To develop the framework it has first prepare a set of
specification known as CLI(common language
interface) specification.
• The CLI specification standardized under ISO and
ECMA making them available .
• ECMA:-European computer manufacture association
CLR component
• CLS:-it is responsible to provide language
interoperability. which is achieve in two way
• Manage code:-code for which MSIL is generated
after language compiler compilation directly
executed by clr ,known as managed
• CLR will provide all the facilities and feature
of .net to the managed code execution like
language interoperability, automation memory
management,common data type system,
exception handling mechanism ,code accesss
security etc.
Unmanaged code
• .NET for which MSIL is not available is not
executed by the CLR redirect the Code to os
for execution, which known as unmanaged
code . doesn’t gets any above features.ex:-
com componets,win32APLs etc.
CLS
Vb.net
M
S
C# I
L

J#
COMPILER
CTS(common type system)
• All the datatype that comes under the
datatype should adopt same sturcture .that is
a type should have the same size in all
language. CTS divided in two categories.
1. Value types
2. Reference types
Value types
• The data types which store the data directly into
the memory location is know as value types.
• Value type store the data on stack, which is a place
where data stores in fixed length such as int ,float
etc. int x=5;
• Every program has its own stack and no other
program shares it.
• Stack is a data structure which work on first –in-
last-out principle.
• Stack is under control of os which is faster in
access.
Reference types

• The data types which do not store the data


directly into their memory locations rather
refers to other memory location is known as
reference types.
• Reference types are stored in a heap.In .net
the heap is now more managed & is called as
managed heap.
• When an application create, the first reference
type memory is allocated for the type at base
address of managed heap.
Reference types(Cont..)

• When the application creates next


object ,garbage collector allocates memory for
first object.
• As long as address space is available ,the
garbage collector continues to allocate space
for new object in this manner.
Diff value type and reference types

Sr no Value types Reference types


1 Store value directly into their memory Do not store the value directly into
location their memory location, rather refers
to other memory location where
value is stored
2 Memory is allotted at compile time Memory is allotted at run time
3 Memory allocation is made with in the Memory allocation is made with in
stack i.e in contiguous memory the Heap i.e in random memory
location location

4 CLR does not provide automatic CLR provides automatic memory


memory management management
Boxing and unboxing
• If a value type is converted into reference type
stored on heap memory we call it as
boxing.Ex:-int x=100; Object obj=x; //boxing
• If again it get converted from reference to
value type is known as unboxing. Ex:- int
y=(int)obj; //unboxing.
• Note:- a direct reference type can not be
converted into value type.
• Note:- object and string comes under
reference type.
Null able value types

• It’s a new feature that has been added in c#


2.0 which allowed to store null values under
value type which is not possible in either
version. To store a null value in value type
need to declare the type suffixing with ? mark.
String str=null; //valid
Int x=null; //invalid
Int ? x=null; valid
Data types in c#
• Integer types :-
• Byte—system.byte ---0-255
• Short –system.int16---(-32768 to 32767)
• Int – system.int32 ---(2^31 to 2^31-1)
• Long –system.int64---(2^63 to 2^63-1)
• Sbyte-- system.sbyte ---(-128 to 127)
• Ushort –system.unit16—(0 to 65535)
• Uint –system.Uint32 –(0 to 2^32-1)
• Ulong—system.uitt64—(0 to 2^64-1)
Decimal or float types

• Float -- system.float ---4bytes


• Double– system.double ---8bytes
• Decimal – system.decimal ---16bytes
• Boolean types :-
• Bool ---system.boolean true or false
• Character types :-
• Char –system.char ---2bytes
• String – system.string – unicode value of
[variable length 4 string]
• Root types :-object –system.object
• The size of char type in .NET and java language
has been increased to 2 bytes to provide the
support for internationalization. i.e the store
Unicode language charter.
• String is a variable length type where the size
of it depends upon the value we assigned to it.
• Object type is capable of storing any type of
value in it. which was also a variable length
type.
• Syntax:-[<modifiers>][const][read
only]<type><var>[=value][…n]
Int x;
Public int y=100;
String s1,s2,s3;
Const float pi=3.14;
Read only string str;

• Assigning value to a constant at the time of


declaration is mandatory. where we can not
change the value any where again.
• In case of read only assigning the value at the
time of declaration was optional. It can be
initialized with in the class. but can not be
modified outside of the class.
• GC:-this is responsible for memory
management which is of an allocation and de
allocation of memory which is required for a
program.
• JIT:-just in time compiler this is one which
going to take core of converting of IL code into
machine code .
• WF :-window workflow foundation.
• LINQ :- language integrated query is a query
language which is also used for
communication with database xml, arrays
collection etc.
• ADO.NET entity framework:-is the extension
to a classical ado.net is also used for database
communication.
• CLR:-
Ado.net
• Ado.net is a technology which is used for
our .net application to communicate with
database.
• Asp.net or web from:-It is technology used for
development of web application using .net
language.
• Winforms:- is used in the development of GUI
application
• WCF :-window communication foundation. it
is used in the development of distributed
application ex:-database, internet
• WPF :-window presentation foundation which
is used in the development of GUI application
with support for graphics animation ,2d,3d .
Code execution process

Source code compiler Native code

• Native code will be generated in such a way


that it should be understood by the current
processor and the operating system in which
the code is being complied and run.
Code execution in java

Java source J J Code


Byte code V Native code
code L executed
C M

JVM for win

JVM for Unix


Byte code Native code

Jvm for Linx

Jvm for solaris

JVM for MacOs


Code execution in .NET

MSIL C
.net source L Native Code
(CLR) L
code C code executed
+metadata R

.net framework for


winidows

MSIL (CIL) Mono for windows Native code


Mono for Linx

Mono for MacOs

Mono for solaris


• LC:-Language complier
• MSIL:-Microsoft intermediate language
• CIL:-common intermediate language
• CLR:-common language runtime
What is platform independency/dependency

• If the code generated by language compiler


(LC)compilation runs on any processor and in any
operating system than which it has been
compiled then it is know as platforms
independent.
• Code that has been generated by the language
compiler compilation doesn't run/execute on a
different processor and in different operating
system than which it has been compiled ,this
nature is known as platform dependency.
Compilation and execution in .NET

C# CSC
CIL
VB VBC Machine
CODE CLR
/native code
J# JSC

• Each language program has require a separate


language compiler which after compilation
generates the IL code which will be common
to all the languages.
BCL
• A library is a set of reusable functionality
every language maintain their library specific
to language but under .net all the language
used the same set of library know as base
class libraries .which is mostly implemented
using c# language
• Class library:-these are set of library function
that are used by .net framework to execute.
BCL (cont…)
• Class library:- mean collection classes and every
class contains some predefined function which are
used to write the code in .net
• Class libraries in .net are similar to header files in
c/c++ and packages in java
• Class libraries in .net are also known as assemblies.
• Class libraries in .net are self describing in nature.
• A class library in .net is either in the form of
DLL(dynamic link library) or in the form of exe
(executable file)
BCL(cont..)

Book library
racks

Books

Pages

Class library Matter

namespaces

classes

Predefined functions

code
BCL (cont..)

• Similarly to access any pre defined function


first we go to particular class library,then to a
particular namespace,then to aparticular class
and the to a particular function like
• ->class libraryName.NamespaceName.class
name.function Name
• ->here is know as member access operator
A class library can be of two categories
• User defined class librariies(UCL):-these are
created by the programmerr for reusability
purpose wit in the programs or applications
created in .net.
• Base class libraries(BCL):-these are known as
building blocks of application or progrms
of .net
• These are installed in to the machine when we
install .net framework in to the machine.
• Physical location:-c:\windows\assembly
BCL (cont..)

• There are almost 500 base class


libraries,12,909 classes and 4,01,759
predefined function are present in .net frame
work 2.0 version.
• We can expect more then 5,00,000 pre
defined functions in .net frame work 4.0
version.
• As we are looking that any assembly /class
library in .net will exist either in the form of
DLL or Exe.
DLL

• A dll is a dynamic link library can not run itself,


used as a supportive file to other applications.
• The library functions are linked to the
application at runtime(dynamically) so the
name is dll.
• A dll does not contain an entry point(main
function) so can not run individually.
Exe
• An Exe is executable file and is not a
supportive file rather itself an application.
• An exe will contain an entry point(main
function) so runs individually.
Diff between dll and exe
Sr no DLL EXE
1 Can not run individually Runs individually
2 Used as a supportive file for other Itself an application
application
3 Does not contain an entry point (no Contains an entry point (main
main function) so can not run function )so can run individually
individually
4 A program/application with out A program/application with main
main creates a dll after compilation creates an exe after compilation
5 Os does not create a separate Os creates a separate process for each
process for any dll rather dll will exe it executes
run in the same process created for
an exe
What is VS.net?
• Vs.net is just an editor tool used to write .net
code or develop application using .net
framework.
• Vs.net provides RAD(rapid application
development) facilities.
• Vs.net is required to purchase the license from
Microsoft.
• Vs.net code will be executed using .NET
framework only.
Difference between .NET framework and vs.net
sno .NET framework Vs.net
1 Execution/runtime environment of Desiging /development environment
.net program of .net program
2 Free s/w Licensed software
3 Version:- Version:-
.net framework Vs.net 2000,2003,2005,2008,2010,2019
(1.0,1.1,2.0,3.0,3.5,4.0)
4
Asp.net
• It is not a programming language .
• It is a web based technology or serve side
technology.
• Code can be written using vb.net and c# .net
or j#.net.

You might also like