concepts of asp.net
DESCRIPTION
TRANSCRIPT
The Global Open University
Nagaland
ASP.NET
Special Tips & Tricks
Agenda
Part I - FundamentalsProgramming ModelsDesign Goals and ArchitectureCLR Services– Visual Studio 2005
Unify Programming Models
Windows APIWindows API
.NET Framework.NET Framework
Consistent API availability regardless ofConsistent API availability regardless oflanguage and programming modellanguage and programming model
ASPASP
Stateless,Stateless,Code embeddedCode embeddedin HTML pagesin HTML pages
MFC/ATLMFC/ATL
Subclassing,Subclassing,Power,Power,
ExpressivenessExpressiveness
VB FormsVB Forms
RAD,RAD,Composition,Composition,
DelegationDelegation
Make It Simple To Use
OrganizationCode organized in hierarchical namespaces and
classes
Unified type systemEverything is an object, no variants, one string type,
all character data is Unicode
Component OrientedProperties, methods, events, and attributes are first
class constructsDesign-time functionality
How Much Simpler?
HWND hwndMain = CreateWindowEx(HWND hwndMain = CreateWindowEx( 0, "MainWClass", "Main Window",0, "MainWClass", "Main Window", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL,WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT, (HWND)NULL, (HMENU)NULL, hInstance, NULL); (HWND)NULL, (HMENU)NULL, hInstance, NULL); ShowWindow(hwndMain, SW_SHOWDEFAULT); ShowWindow(hwndMain, SW_SHOWDEFAULT); UpdateWindow(hwndMain);UpdateWindow(hwndMain);
Form form = new Form();Form form = new Form();form.Text = "Main Window";form.Text = "Main Window";form.Show();form.Show();
Windows APIWindows API
.NET Framework.NET Framework
Hello World Demo What you need
Agenda Part I - Fundamentals
Programming ModelsProgramming ModelsDesign Goals and ArchitectureCLR ServicesCLR Services
Common Language RuntimeDesign Goals
Dramatically simplifies development and deployment
Unifies programming models Provides robust and secure execution
environment Supports multiple programming languages
Architectural Overview
Co
mm
on
Lan
gu
age
Ru
nti
me
Co
mm
on
Lan
gu
age
Ru
nti
me
FrameworkFramework
Class loader and layoutClass loader and layout
GC, stack walk, code managerGC, stack walk, code manager
IL t
o
IL t
o
nat
ive
cod
e n
ativ
e co
de
com
pile
rsco
mp
ilers
Sec
uri
tyS
ecu
rity
Exe
cuti
on
Exe
cuti
on
Su
pp
ort
Su
pp
ort
Base ClassesBase Classes
AssemblyAssembly
Compilation And Execution
Source Source CodeCode
Language Language CompilerCompiler
CompilationCompilation
At installation or the At installation or the first time each first time each
method is calledmethod is calledExecutionExecution
JIT JIT CompilerCompiler
NativeNative
CodeCode
Code (IL)Code (IL)
MetadataMetadata
Languages
The CLR is Language Neutral All languages are first class players You can leverage your existing skills
Common Language Specification Set of features guaranteed to be in all languages
We are providing VB, C++, C#, J#, JScript
Third-parties are building APL, COBOL, Pascal, Eiffel, Haskell, ML, Oberon,
Perl, Python, Scheme, Smalltalk…
Hello World Demo What you needWhat you need MSIL
Agenda Part I - Fundamentals
Programming ModelsProgramming ModelsDesign Goals and ArchitectureDesign Goals and ArchitectureCLR Services
Component-Based Programming 3 core technologies make building and
using components easyType safetyAutomatic memory managementMetadata
This greatly simplifies application development
Type Safety Type safety ensures that objects are used the
way they were intended to be usedPrevents an object’s state from being corrupted
The CLR enforces type safetyAttempting to coerce an object to an incompatible type
causes the CLR to throw an exception
Type safety means code confidenceCommon programmer errors will be found immediately
Rectangle(hwnd, 0, 0, 10, 10);
//hwnd should be an hdc
MessageBox(hwnd, “”, “”, IDOK);
//IDOK should be MB_OK
Automatic Memory Management
The CLR tracks the code’s use of objects and ensures Objects are not freed while still in use (no memory corruption) Objects are freed when no longer in use (no memory leaks)
Code is easier to write because there is no question as to which component is responsible to free an object When passed a buffer, who frees it: caller or callee?
Each process has 1 heap used by all components Objects can’t be allocated from different heaps You don’t have to know which heap memory was allocated in or
which API to call to free the memory○ In fact, there is no API to free memory, the GC does it
Metadata Set of data tables embedded in an EXE/DLL
The tables describe what is defined in the file (Type, fields, methods, etc.) Every component’s interface is described by metadata tables
A component’s implementation is described by Intermediate Language The existence of metadata tables enables many features
No header files Visual Studio’s IntelliSense Components don’t have to be registered in the registry Components don’t need separate IDL or TLB files The GC knows when an object’s fields refer to other objects An object’s fields can be automatically serialized/deserialized At runtime, an application can determine what types are in a file and what
members the type defines (also known as late binding) Components can be written/used by different languages
Metadata: Creation And Use
MetadataMetadata(and code)(and code)
DebuggerDebugger
Schema Schema GeneratorGenerator
ProfilerProfiler
CompilersCompilers
Proxy GeneratorProxy Generator
Type BrowserType Browser
CompilerCompiler
SourceSourceCodeCode
XML encodingXML encoding(SDL or SUDS)(SDL or SUDS)
SerializationSerialization
DesignersDesigners
ReflectionReflection
TLB ExporterTLB Exporter
Runtime Execution Model
ClassClassLoaderLoader
CPUCPU
ManagedManagedNative CodeNative Code
AssemblyAssembly
First callFirst callto methodto method
First reference First reference to to typetype
AssemblyAssemblyResolverResolver
First reference First reference to Assemblyto Assembly
IL to nativeIL to nativeconversionconversion
JIT Compiler - Inline
Standardization A subset of the .NET Framework and C#
submitted to ECMAECMA and ISO International StandardsCo-sponsored with Intel, Hewlett-Packard
Common Language InfrastructureBased on Common Language Runtime and Base
FrameworkLayered into increasing levels of functionality
Rotor (SSCLI)
Shared-Source version of the CLR+BCL+C# compiler
Ports available: Windows, FreeBSD, OSX, etc
Real product code offers real world learning
http://sscli.org
Developer Roadmap
• “ “Orcas” releaseOrcas” release
• Windows “Longhorn” Windows “Longhorn” integrationintegration
• New UI tools and New UI tools and designers designers
• Extensive managed Extensive managed interfacesinterfaces
Visual Studio Visual Studio Orcas Orcas
“Longhorn”“Longhorn”
Visual StudioVisual Studio.NET 2003.NET 2003
• “ “Everett Release”Everett Release”
• Windows Server 2003 Windows Server 2003 integrationintegration
• Support for .NET Support for .NET Compact Framework Compact Framework and device and device development development
• Improved performanceImproved performance
Visual Studio 2005 Visual Studio 2005 “Yukon”“Yukon”
• “ “Whidbey” releaseWhidbey” release
• SQL Server SQL Server integrationintegration
• Improved IDE Improved IDE productivity and productivity and community supportcommunity support
• Extended support for Extended support for XML Web servicesXML Web services
• Office Office programmabilityprogrammability
Agenda Part I - FundamentalsPart I - Fundamentals
Design Goals Design Goals ArchitectureArchitectureCLR ServicesCLR Services
Agenda Part I - FundamentalsPart I - Fundamentals
Design Goals Design Goals ArchitectureArchitectureCLR ServicesCLR Services
PerformanceObjectives: make .NET an even greater programming
platform Long-Term: make the performance characteristics of the CLR
similar to native code Reduce marginal cost of additional managed processes Reduce startup time and working set
NGen Compiles IL code to native code, saving results to disk Advantages: no need to recompile IL to native code, and
class layout already set so better startup time Whidbey: Significant reductions in the amount of private,
non-shareable working set OS: ‘no-Jit’ plan, all managed code will be NGened
TryParseTryParse
CLR Security New cryptography support
PKI and PKCS7 supportXML encryption supportEnhanced support for X509 certificates
Enhanced Application SecurityPermission Calculator
○ Integration with ClickOnceBetter SecurityExceptionDebug-In-Zone
Managed ACL Support
This material has been taken from Online Certificate course on ASP.NET from Global Open University Online certification programme. For complete course material visit: http://tgouwp.eduhttp://tgouwp.edu
About Global Open University :The global open university is now offering certification courses in various fields. Even you can study, give exam from comfort of your home. These are short term and totally online courses. For more details you can visit:
Email id: [email protected]: http://tgouwp.edu
THANKS for being here