The Global Open University Nagaland
Special Tips & Tricks
ASP.NET
Agenda
Part I - Fundamentals
Programming Models Design Goals and Architecture CLR Services Visual Studio 2005
Unify Programming Models
Consistent API availability regardless of language and programming model
.NET Framework
RAD, Composition, Delegation Subclassing, Power, Expressiveness Stateless, Code embedded in HTML pages
VB Forms
MFC/ATL
ASP
Windows API
Make It Simple To Use
Organization
Code organized in hierarchical namespaces and
classes
Unified type system
Everything is an object, no variants, one string type,
all character data is Unicode
Component Oriented
Properties, methods, events, and attributes are first
class constructs Design-time functionality
How Much Simpler?
Windows API
HWND hwndMain = CreateWindowEx( 0, "MainWClass", "Main Window", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, (HWND)NULL, (HMENU)NULL, hInstance, NULL); ShowWindow(hwndMain, SW_SHOWDEFAULT); UpdateWindow(hwndMain);
.NET Framework
Form form = new Form(); form.Text = "Main Window"; form.Show();
Hello World Demo
What you need
Agenda
Part I - Fundamentals
Programming Models Design Goals and Architecture CLR Services
Common Language Runtime Design Goals
Dramatically simplifies development and deployment Unifies programming models Provides robust and secure execution environment Supports multiple programming languages
Architectural Overview
Framework
Common Language Runtime
Base Classes
IL to native code compilers
Execution Support
GC, stack walk, code manager
Class loader and layout
Security
Compilation And Execution
Compilation
Source Code
Language Compiler
Assembly
Metadata
Code (IL)
Native Code Execution
JIT Compiler
At installation or the first time each method is called
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 VB, C++, C#, J#, JScript
We are providing
Third-parties are building
APL, COBOL, Pascal, Eiffel, Haskell, ML, Oberon, Perl, Python, Scheme, Smalltalk
Hello World Demo
What you need MSIL
Agenda
Part I - Fundamentals
Programming Models Design Goals and Architecture CLR Services
Component-Based Programming
3 core technologies make building and using components easy
Type safety Automatic memory management Metadata
This greatly simplifies application development
Type Safety
Type safety ensures that objects are used the way they were intended to be used
Prevents an objects state from being corrupted
The CLR enforces type safety
Attempting to coerce an object to an incompatible type
causes the CLR to throw an exception
Type safety means code confidence
Common 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 codes 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 cant be allocated from different heaps You dont 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 components interface is described by metadata tables
A components implementation is described by Intermediate Language
The existence of metadata tables enables many features
No header files
Visual Studios IntelliSense Components dont have to be registered in the registry Components dont need separate IDL or TLB files The GC knows when an objects fields refer to other objects An objects 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
Serialization TLB Exporter Compiler Compilers Type Browser Debugger Source Code Reflection Designers
Metadata
(and code)
Profiler
Schema Generator
Proxy Generator
XML encoding
(SDL or SUDS)
Runtime Execution Model
Assembly
Class Loader
IL to native conversion
First reference to type
Assembly Resolver
First reference to Assembly
Managed Native Code
First call to method
CPU
JIT Compiler - Inline
Standardization
A subset of the .NET Framework and C# submitted to ECMA
ECMA and ISO International Standards
Co-sponsored with Intel, Hewlett-Packard
Common Language Infrastructure
Based on Common Language Runtime and Base
Framework Layered 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
Visual Studio 2005 Yukon Visual Studio Orcas Longhorn
Orcas release
Visual Studio .NET 2003
Everett Release Windows Server 2003 integration Support for .NET Compact Framework and device development
Whidbey release SQL Server integration Improved IDE productivity and community support Extended support for XML Web services Office programmability
Windows Longhorn integration
New UI tools and designers
Extensive managed interfaces
Improved performance
Agenda
Part I - Fundamentals
Design Goals Architecture CLR Services
Agenda
Part I - Fundamentals
Design Goals Architecture CLR Services
Performance Objectives: 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
TryParse
CLR Security
New cryptography support
PKI and PKCS7 support XML encryption support Enhanced support for X509 certificates
Enhanced Application Security
Permission Calculator Integration with ClickOnce Better SecurityException Debug-In-Zone
Managed ACL Support
THANKS for being here
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.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: info@tgouwp.edu