ADT-II - Unit 1
ADT-II - Unit 1
Subject Instructor
Prof. S. A. Bandgar
Assistant Professor, Information Technology Department, JJMCOE, Jaysingpur
Structure overview
Class T.Y.Btech Semester- VI
Credits 03
C# fundamentals:
Data types - Value types, Reference types, boxing and unboxing, Arrays, Pass by value and
Unit 2 by reference and out parameters, params parameter. Namespaces, classes, objects, structs: 3 Hr
definition and creation.
File handling:
The abstract stream class, working with StreamWriters and StreamReaders, Working with
Unit 4 4 Hr
StringWriters and StringReaders, Working with BinaryWriters and BinaryReaders.
ADO.NET:
Unit 5 Exploring ADO.net Entity framework, Connected and disconnected architecture, data 4 Hr
access with ADO.net.
Reference Books:
1. Microsoft Visual C# 2010 Step by Step: John sharp, Microsoft Press
2. NET 4.5 Programming (6 – in -1) Black Book – Kogent – Dreamtech
Press
3. CLR via C# :Jeffrey Richter, Microsoft Press, 3rd edition
4. ASP.Net 4.5 Black Book ,Dreamtech ,Wiley International.
Unit 1 : Introduction to .net:
Evolution of .net,
Benefits of .net,
CLR, CTS, MSIL, JIT, BCL,
metadata and assemblies in detail,
GAC and strong name assemblies,
Security Manager.
OBJECTIVES:
The first version of the .Net framework was released in the year 2002
Introduction to .NET:
.NET framework is a development platform for creating applications by using
different programming languages, such as C#, Visual Basics and Visual C++.
Web Applications
Windows Applications
Mobile Applications
Database Applications
Salient Features
Microsoft introduced .NET Framework to not only bridge the gap but also to
ensure interoperability between applications created in different languages.
.NET is an open-source, cross platform for building desktop, web, and mobile
applications that can run natively on any operating system.
Evolution of .NET:
Around 1995, java was gaining popularity because of its platform independent
approach & Sun Microsystem’s open source policy.
It took more than three years to develop the product, which is now known
as .NET
First version of .NET released by Microsoft .NET Framework 1.0 on February
13,2002, along with Visual Studio.NET 2002 IDE
Second version.NET Framework 1.1, Visual Studion.NET 2003 on 24, April 2003
Next Version.NET Framework 2.0, along with Visual Studio 2005 on November
07,2005
Next version.NET Framework 3.0, called WinFX released on November 06,2006.
Next version.NET Framework 3.5 along with Visual Studio.NET 2008 on
19,November 2007
Next version.NET Framework 4.0 on September 29,2008
Final version .NET Framework 4.0 on April 12,2010
Latest version.NET Framework 4.5 on February 29,2012
Final version.NET Framework 4.5 on August 15,2012
Next version.NET Framework 4.5.1 on October 17,2013
The current version of .NET is .NET 5.0, which is the successor of .NET
Core 3.1 and .NET Framework 4.6. Prior to .NET 5.0, .NET had two
versions, .NET Framework, and .NET Core, but in this version, both have
merged and now there is only version.
You do not need to manually free the resources, such as files, memory, network
and database connection.
.NET framework provides a feature called CLR that automatically tracks the
resource usage and in resource management.
5. Ease of deployment:
Common
Language
Runtime Common Language Runtime ( Execution Engine )
Language
The types of applications that can be built in the .NET framework is
classified broadly into the following categories :
WinForms This is used for developing Forms-based applications, which would run on an end
user machine
ASP.NET This is used for developing web-based applications, which are made to run on any
browser such as Internet Explorer, Chrome or Firefox. (Active Server Page)
ADO.NET This technology is used to develop applications to interact with Databases such as
Oracle or Microsoft SQL Server (ActiveX Data Object)
Library
A class library is a collection of methods and functions that can be used for the core
purpose.
e.g. -
It is a program execution engine that loads and executes the program. It converts the
program into native code. It acts as an interface between the framework and operating
system.
• Suppose we have written a C# program and save it in a file.
• Language specific compiler compiles the source code into
the MSIL(Microsoft Intermediate Language) which is also know as
the CIL(Common Intermediate Language) or IL(Intermediate
Language) along with its metadata.
• Metadata includes the all the types, actual implementation of each function
of the program. MSIL is machine independent code.
• Now CLR comes into existence. CLR provides the services and runtime
environment to the MSIL code. Internally CLR includes the JIT(Just-In-
Time) compiler which converts the MSIL code to machine code which
further executed by CPU.
Architecture of CLR
Common Language Runtime (CLR)
Common Type System (CTS) :Every programming language has its own data
type system, so CTS is responsible for understanding all the data type of system.
CLR also supports services that an application uses to access various resources,
such as collections, arrays etc
The application that are created using managed code automatically have CLR
services, such as type checking, security and automatic garbage collection.
Before the execution of the code, IL must be converted into CPU specific code
by the Just-in-Time (JIT) compiler.
when you compile source code into IL, the required metadata is generated.
The metadata contains the definition of types, member signature, the members
in the code and other details the code uses at the time of execution
While executing the application, a JIT compiler translates the IL into native
code.
After compiling, the code is passed through verification process that examines
the IL and metadata to check whether the code is safe, that is, it should be able
to access only those memory locations, which it is authorized
Another Method:
Memory Management:
CLR provides automatic memory management.
The CLR uses the garbage collector to manage and release of memory for an
application
Common Type System:
The CTS specifies certain guidelines for declaring , using and managing types
at runtime.
The functions performed by CTS are as follows:
- Helps in cross language communication, type safety, & high performance
execution of code by framework.
- Support object oriented model for different programming languages.
-
Common Type System(CTS)
The CTS specifies certain guidelines for declaring, using and managing
types at runtime.
1. Value types
2. Reference type
Variables declared as value types have their own copy of the data; therefore
any operation on one variable does not affect another variable.
On other hand, variables declared as reference types always point to the same
object; means any operation on one variable affect the another variable.
Base class of type is System.Object
Assemblies are packaged into units containing programs & libraries.
a single assembly can contain multiple code files or a single code file can
have more than one assembly.
1. Static
2. Dynamic
3. Static:
- this assembly include interfaces, classes & resources.
- These assemblies are stored in the Portable Executale(PE) files on a disk.
2. Dynamic :
- These assemblies run directly from the memory without being saved to a disk
before execution.
- However, after execution, dynamic assemblies can be saved on a disk.
Global Assembly Cache(GAC)
Global assembly cache (GAC) is the central place for registering assemblies,
so that different applications on the computer can use it.
But note that, the assemblies must be made sharable by registering them in the
GAC, only when needed; otherwise, they must be kept private.
You can deploy an assembly in the GAC by using
By providing strong name to assembly , you can ensure that the assembly is
globally unique.
Framework Class Library
The FCL is huge library used by managed code.
The FCL is made up of hierarchy of namespaces and namespaces are logically
defined by their functionality.
For example,
System. Data namespace contains the functionalities available for
accessing database.
This namespace further broken into System.Data.SqlClient &
System.Data.OleDb namespaces.
The System.Data.SqlClient namespace exposes the functionality specific to
SQL Server; whereas System.Data.OleDb namespace exposes functionality
about Object Linking &Embedding Database.
There are more than 20,000 classes in FCL
In FCL points to remember:
1. Interoperability
2. Portability
3. Security
4. Memory management
5. Simplified deployment
Thank You!