Introduction to'NET - PowerPoint PPT Presentation

1 / 67
About This Presentation
Title:

Introduction to'NET

Description:

make information available anytime, anywhere. simplify development ... MyClass[] objMyClass= new MyClass[6]; Myclass objMyClass[6]; Which One is Better and WHY? ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 68
Provided by: raiyaw
Category:

less

Transcript and Presenter's Notes

Title: Introduction to'NET


1
Think Smart
2
.Net Framework
Rai Yawar Ijaz Microsoft Most Valuable
Professional Chair, INETA Islamabad
Region VP,Innoventors Project Manager,
Quntech Bioinformatics Research
3
Agenda
  • What is .Net Framework
  • Common Language Runtime
  • Assemblies(Modules,CTS/CLS)
  • Memory management in .Net
  • Execution Model
  • .Net security Model
  • ASP.NET
  • ADO.NET

4
(No Transcript)
5
Development Challenges
  • Software Integration
  • Language silo problem
  • Development and deployment complexity
  • Multiple programming models
  • Security not inherent

6
The .NET FrameworkWhat Is the .NET Framework?
  • A set of technologies that
  • unite todays isolated Web applications
  • make information available anytime, anywhere
  • simplify development and deployment
  • How does .NET achieve the above?
  • Web services
  • ADO.NET DataSets and XML support throughout the
    platform
  • rich tools, runtime services, and XCOPY deployment

7
.Net Framework
  • Common Language Runtime (CLR)
  • Base Class Library

8
Common Language RuntimeExecution Model
Source code
Visual Basic
C
C
Unmanaged component
Compiler
Compiler
Compiler
Managed code
Assembly IL code
Assembly IL code
Assembly IL code
Common language runtime
JIT compiler
Native code
Operating system services
9
The CLR
Base Class Library Support
Thread Support
COM Marshaler
Class Loader
10
.Net Framework Classes
System.Web (ASP .NET)
System.WinForms
Services
UI
Design
ComponentModel
Description
HTMLControls
Discovery
WebControls
Protocols
System.Drawing
Caching
Security
Drawing2D
Printing
Configuration
SessionState
Imaging
Text
System.Data (ADO .NET)
System.XML
ADO
SQL
XSLT
Serialization
Design
SQLTypes
XPath
System
Collections
IO
Security
Runtime
InteropServices
Configuration
Net
ServiceProcess
Remoting
Diagnostics
Reflection
Text
Serialization
Globalization
Resources
Threading
11
Common Language Runtime
  • Execution engine for .NET framework applications.
  • Services provided.
  • Code management (loading and execution).
  • Application memory isolation.
  • Verification of type safety.
  • Conversion of IL to native code.
  • Enforcement of code access security
  • Exception handling, including cross-language
    exceptions
  • Interoperation between managed code, COM objects,
    and pre-existing DLLs (unmanaged code and data)
  • .

12
Common Language RuntimeGoals
  • Development
  • standard class framework
  • automatic memory management
  • consistent error handling
  • mixed-language applications
  • multiple platforms
  • safer execution
  • Deployment
  • removal on registration dependency
  • safety fewer versioning problems
  • the end of DLL Hell

13
Common Language RuntimeMultiple Language Support
  • Common Type System (CTS)
  • Common Language Specification (CLS)

14
Common Language Specification
  • CTS defines a complex set of types
  • So a compromise the CLS
  • Must implement BOOL, Byte, Char, Integers etc
  • Need not implement Uintegers
  • Arrays in all languages must have zero as the
    lower bound.
  • All Languages support the same sub set.

15
Types Unified Type System
  • Value types
  • Directly contain data
  • Cannot be null
  • Reference types
  • Contain references to objects
  • May be null

int i 123 string s "Hello world"
16
Types Unified Type System
  • Value types
  • Primitives int i float x
  • Enums enum State Off, On
  • Structs struct Point int x,y
  • Reference types
  • Root object
  • String string
  • Classes class Foo Bar, IFoo ...
  • Interfaces interface IFoo IBar ...
  • Arrays string a new string10
  • Delegates delegate void Empty()

17
Types Unified Type System
18
Types Unified Type System
  • Benefits of value types
  • No heap allocation, less GC pressure
  • More efficient use of memory
  • Less reference indirection
  • Unified type system
  • No primitive/object dichotomy

19
TypesUnified Type System
  • Everything is an object
  • All types ultimately inherit from object
  • Any piece of data can be stored, transported, and
    manipulated with no extra work

object
Stream
Hashtable
int
double
MemoryStream
FileStream
20
ARRAY
Myclass objMyClass6
MyClass objMyClass new MyClass6
Which One is Better and WHY?
21
Common Language RuntimeCompilation
Source code
C, C, Visual Basic or any .NET language
csc /outmyAssembly.dll /debug /targetlibrary
parceltracker.cs
22
Agenda
  • What is .Net Framework
  • Common Language Runtime
  • Assemblies
  • Memory management in .Net
  • Execution Model
  • .Net security Model
  • ASP.NET
  • ADO.NET

23
Agenda
  • What is .Net Framework
  • Common Language Runtime
  • Assemblies
  • Memory management in .Net
  • Execution Model
  • .Net security Model
  • ASP.NET
  • ADO.NET

24
Common Language RuntimeAssemblies
myAssembly.dll
Metadata
IL Managed code
Resources
25
Inside an Assembly
26
What are Assemblies ?
  • Assemblies are the smallest unit of code
    distribution, deployment and versioning

Multi File Assembly
Single File Assembly
A.netmodule
Manifest (No Assembly Metadata)
ThisAssembly.dll
ThisAssembly.dll
Manifest
Metadata
Manifest
MSIL
MetaData
MetaData
MSIL
MSIL
B.netmodule
Resources
Resources
Manifest (No Assembly Metadata)
Metadata
MSIL
27
Common Language RuntimeMetadata
  • Type information
  • more complete than IDL / TLB
  • automatically bound into assembly
  • inseparable
  • stored in binary format
  • describes every class type

28
Common Language RuntimeMetadata in an Assembly
Type Descriptions
Classes Base classes Implemented interfaces Data
members Methods
Assembly Manifest
Name Version Culture
Other assemblies Security permissions Exported
types
29
Assembly
Headers
  • PE
  • CLR
  • Metadata (idata,text,etc)
  • IL

30
Common Language RuntimeApplications
  • One or more assemblies
  • Types Of Assemblies
  • Private
  • Shared (placed in GAC)
  • Different applications may use different versions
    of an assembly
  • easier software updates
  • easier software removal

31
Assembly Probing
Working Directory(c\) Sub directory(C\Assembly
\) Named path(c\path\..) Named Path
Subdirectory GAC
32
Registry Issues
  • Versioning ?
  • DLL HELL ?
  • Side By Side Execution ?
  • Installation
  • Uninstall

GAC
33
Agenda
  • What is .Net Framework
  • Common Language Runtime
  • Assemblies
  • Execution Model
  • Memory management in .Net
  • ASP.NET
  • ADO.NET

34
Automatic Memory Management
  • Garbage collection mechanism
  • Implicit Garbage collection
  • Explicit Garbage collection
  • Idispose Interface

35
Memory Management
  • Garbage collection mechanism
  • Implicit Garbage collection
  • Explicit Garbage collection
  • Idispose Interface

Methods Finalize Close Dispose
Data structure Finalizer List Freacheable
Generations Max 3(0,1,2) Weak ref Strong Ref
36
Refresher of Classic ASP
  • Server Side Pages containing HTML
  • Dynamic Pages
  • HTML Editors

37
ltbody bgColor"00ff00"gt ltform id"Form1"
method"post"gt lt/formgt lt/bodygt
38
Refresher of Classic ASP
  • Client Side Scripting (VB Script/Java Script)
  • Validations
  • Checks
  • Range Checking
  • Date Display

39
Problems with Classic ASP
  • Blend of HTML (Design) and script (Logic)
  • Object Oriented
  • Robust / Reusability Problem
  • Redundancy

40
Architecture of ASP.NET
  • Extension is .aspx
  • Is Represented by a unique C class
  • (Code behind)
  • lt_at_ Page Language C CodebehindWebForm1.aspx.
    cs . gt

41
Architecture of ASP.NET
42
Architecture of ASP.NET
43
Architecture of ASP.NET
44
Architecture of ASP.NET
45
ProcessRequest
Page_Load
XXX_Changed
YYY_Clicked
Page_Unload
46
Runtime Compilation
47
ASP.NET Modular Architecture
ASPNET_WP
HttpHandlers
Pages
Services
ASPNET_STATE
SessionState
HTTP Runtime
Caching
Authent
Sessions
HttpModules
INETINFO
ASPNET_ISAPI
48
Categories of WebForm Controls
  • 1. Intrinsic Controls
  • HTML controls counterparts Buttons, Textbox,
    List
  • 2. Rich Controls
  • AdRotator, Calendar
  • 3. Data-centril Controls
  • DataGrid DataBindings

49
Categories of WebForm Controls
  • Validation Controls
  • CompareValidator
  • CustomValidator
  • RangeValidator
  • RegularExpressionValidator
  • RequiredFieldValidator
  • ValidationSummary

50
ASP.Net Object Model
Request
Server
HttpContext
Application
Session
Response
51
ASP.Net Object Model
Request
Server
HttpContext
Application
Session
Response
52
ASP.Net Object Model
Request
Server
HttpContext
Application
Session
Response
53
ASP.Net Object Model
Request
Server
HttpContext
Application
Session
Response
54
ASP.Net Object Model
Request
Server
HttpContext
Application
Session
Response
55
ASP.Net Object Model
Request
Server
HttpContext
Application
Session
Response
56
ADO.NET
57
Why ADO.NET?
  • ADO works great, but
  • Requires COM and Windows
  • Recordsets dont travel well across the Internet
  • Connected behavior is hard to work with
  • ADO.NET solves these problems
  • Uses XML under the covers for all data transport
  • XML has no runtime/transport requirements
  • No special code required to marshal across the
    Internet
  • ADO.NET requires new mindset
  • All data access disconnected
  • All data transport uses XML

58
Connected Or Disconnected?
  • System.Data namespace contains disconnected set
    of objects
  • DataSet, DataTable, DataRow, and so on
  • Specific namespaces (System.Data.OleDb and
    System.Data.SqlClient) contain connected objects
  • SqlDataAdapter/OleDbDataAdapter
  • SqlConnection/OleDbConnection
  • SqlDataReader/OleDbDataReader

59
Connected Or Disconnected?
  • With ADO, a fundamental question isWhere is the
    data managed?
  • On the client?
  • On the server?
  • A mixture of the two?
  • The answer in ADO
  • it depends on the cursor you are using.
  • With ADO.NET
  • Data is always on the client (via DataSet) or on
    its way to the client (via IDataReader)

60
ADO.NET Architecture
Presentation Tier
Windows Forms
MyApp.Exe
DataSet
Business Tier
Data Tier
InternetIntranet
Web Forms
Data Object (Class)
IE
Data Adapter
DataSet
XML
DataSet
Data Adapter
Business to Business
(BizTalk, for example)
61
ADO.NET
ODBC RDBMS
.NET Data Provider
ODBC Driver
ODBC
Connection
OLE DB RDBMS
Command
Application
OLE DB
OLE DB Provider
Data Reader
SQL Server
Data Adapter
62
ADO.NET Objects
  • Connection
  • Connects to data source
  • Command
  • Executes SELECT, INSERT, UPDATE and DELETE
    commands
  • Data Reader
  • Forward-only, read-only stream of data
  • Data Adapter
  • Connects a DataSet to a data source

63
XML SUPPORT
64
WHY MICROSOFT
70M Systems are installed with .NET
65
Microsoft Department
Others
66
(No Transcript)
67
Contact Detail Email Raiyawar_at_gmail.com IM
raiyawar_at_gmail.com Group Groups.msn.com/Innoven
tors
Write a Comment
User Comments (0)
About PowerShow.com