0% found this document useful (0 votes)
80 views31 pages

Different?: Scott Mitchell

ASP.NET improves upon classic ASP in several ways. It uses compiled .NET languages like C# and VB.NET instead of interpreted scripts, improving performance and code quality. ASP.NET encourages better separation of code and content through features like code-behind pages. It also provides modern programming features and debugging tools that classic ASP lacked. Overall, ASP.NET addresses many of the weaknesses of classic ASP by leveraging the .NET framework and compiled .NET languages.

Uploaded by

sumit67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views31 pages

Different?: Scott Mitchell

ASP.NET improves upon classic ASP in several ways. It uses compiled .NET languages like C# and VB.NET instead of interpreted scripts, improving performance and code quality. ASP.NET encourages better separation of code and content through features like code-behind pages. It also provides modern programming features and debugging tools that classic ASP lacked. Overall, ASP.NET addresses many of the weaknesses of classic ASP by leveraging the .NET framework and compiled .NET languages.

Uploaded by

sumit67
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

What Makes .

NET
Different?

Scott Mitchell
Overview
The evolution of the Web.
Classic ASP overview its strengths and
weaknesses.
Time for something new: an examination of
Microsofts .NET Strategy.
[Link] to the Rescue!
Comparing and Contrasting [Link] and
classic ASP.
For more information
The Evolution of the Web
Dynamic Scripts Distributed, Compiled
Static Web Pages
Dynamic scripts allowed for Programs
Content was static. To
user interaction with a Web
alter the look and feel of a
site. Web content could be Web pages are actual,
Web page, a programmer
dynamically generated programs created using
had to physically alter the
based on a number of object-oriented
contents of the page itself.
variables, such as user programming techniques.
The static nature of the input. Allowed for the Web These programs are
Web at this time removed to serve as an application compiled instead of
any possibility of a user medium.
interpreted like the scripts
interacting with a Web site
or interaction among Web
Development was anything of the past.
but easy. The scripting
sites. A focus on Inter-Web
nature of development led
Performance was great to poor programming server communication
and development easy, practices and messy code. allows developers to build
but the Web lacked any Also, interaction among Web truly distributed
real usability. sites was possible, but applications on the Web.
limited and difficult.
Classic ASP - Strengths
Low cost of entry
Quick and easy to learn for experienced
developers and new developers alike.
Can create very useful Web applications in
a relatively short amount of time.
An active ASP community
Many, many great classic ASP books, Web
sites, training classes, and conferences.
Classic ASP - Weaknesses
Script-based technology used, leading to
poorer performing, less readable code than a
compiled counterpart.
Encouraged developers to shamelessly
intermix code (script) and content (HTML).
Difficult to debug.
Lacked modern programming features, such
as trycatch exception handling, true object-
orientation, etc.)
Fixing Classic ASP
[Link], as well shortly see, fixes all of
these problems inherent in classic ASP!

Before we look at [Link], specifically,


lets first turn our attention to
Microsofts .NET Strategy.
Ready or .NET, here it comes!
In July 2000, Microsoft announced their .NET
Vision at their Professional Developer
Conference (PDC).
The main components of .NET include:
A runtime system (the Common Language
Runtime, or CLR)
A large set of classes that serve as an API for
programs run through the CLR (commonly
referred to as the .NET Framework classes, or the
.NET SDK).
New programming languages.
The CLR
Whenever a .NET program is executed, it is
fed into the CLR, which executes the
program.
The code expected by the CLR needs to be in
a special intermediate language (MSIL,
Microsoft Intermediate Language).
So, compilers like [Link] turn source code
into this MSIL. This MSIL code is like a high-
level, architecture independent assembly
language.
The CLR (continued)

When the CLR first runs a .NET


program, it must convert this abstract
high-level assembly language into
platform-specific code (referred to as
Just-In-Time (JIT) compilation).
This JITed copy can then be run by the
CLR each time the program needs to be
run.
The CLR (Continued)

[Link] [Link] Intermediate


Source Code
Compiler
Code

JITed

Your
application CLR
running!!!
The .NET Framework
The .NET Framework contains a plethora of
developer libraries that insulates the OS from
the developer.
These libraries are broken down into
hundreds of classes grouped in logical
namespaces, where each namespace
separates a different set of classes.
The .NET Framework is similar in concept to
the Win32 API, except the .NET Framework is
OO-based and sensibly arranged with helpful
documentation.
The .NET Framework (Continued)

[Link] and the inherent server controls are


classes in the .NET Framework. The
[Link] namespace encapsulates the
classes used by [Link].
This means that you can access and utilize .NET
classes from within an [Link] page, meaning
through an [Link] Web page you can do:

File Uploads Image manipulations


On the fly (de|en)cryption
Systems-level activities (Event log, perf. mon., etc.)
New Programming Languages
To create .NET programs, you need to
use a .NET programming language (one
that compiles to MSIL and uses the
.NET Framework classes). Such
languages include:
[Link] C#
[Link] MS C++ .NET
[Link] [Link]
Visual Basic .NET
[Link] introduces many new modern
concepts into VB:
Try Catch exception handling
True OOP
Short-circuit Boolean operators, variable
initialization, standard array base (0), etc.
[Link] has a handful of breaking changes:
No more default properties
Set/Let support dropped
Subs require parenthesized parameters
Example [Link] Code
'Create an ArrayList
Dim myArrayList as New ArrayList()
[Link]("[Link]")
[Link]("is")
[Link]("cool!")
[Link](GetRandomWord(myArrayList))

Function GetRandomWord(myAL as ArrayList)


Dim rndNumber as New Random()
Return myAL([Link]([Link]))
End Function
C#
Microsofts newest language offering.
Similar to Java in syntax and semantics:
Case sensitive
Statements delimited by semicolons
Blocks delimited by curly braces
Like every .NET language, very OO.
Example C# Code
// Create an ArrayList
ArrayList myArrayList = new ArrayList();
[Link]("[Link]");
[Link]("is");
[Link]("cool!");
[Link](GetRandomWord(myArrayList));

string GetRandomWord(ArrayList myAL)


{
Random rndNumber = new Random();
return myAL[[Link]([Link])];
}
What Language to Use?
[Link] and C# both rely on the classes in
the .NET Framework to accomplish their
tasks.
Therefore, essentially anything you can do
with C#, you can do with [Link].
Programs written in C# and [Link] are
relatively equal in performance.
Therefore, choose the programming language
that you and your team knows best!
Language Interoperability
Realize that every data type (int, string,
object, etc.) is defined as a class in the .NET
Framework.
That means an int in C# and an Integer in
[Link] are the same thing an instance of
the Int32 class in the .NET Framework.
Since all .NET languages:
Compile to standard MSIL
Use the same data type definitions
components written in one language can be
used in another.
[Link] to the Rescue!
[Link] solves for many of the
disadvantages in classic ASP.
[Link] Web pages are compiled .NET
programs created by modern .NET
programming languages ([Link], C#,
[Link], [Link], etc.)
[Link] provides excellent debugging options
and opportunities, especially through tools
like Visual Studio .NET
[Link] to the Rescue! (Continued)

[Link] encourages separation of code


and content (HTML) in many ways:
The use of Code-behind pages which
physically separate the code from the
content.
Use of server controls, which provide VB-
like control functionality through a Web
page. (Johns talk next will address server
controls in great detail!)
Examining [Link]
[Link] is comprised of two major areas: [Link]
Web pages and [Link] Web services.
[Link] Web pages are akin to classic ASP pages
Web surfers visit them through a browser and
are returned valid HTML.
[Link] Web services provide for inter-Web server
communications. This allows an [Link] Web
page (or a stand-alone application) to access a
remote program to obtain information. (More on
this topic in tomorrows talk on Web services.)
Examining [Link] (Continued)

[Link] Web pages and Web services are


compiled programs. So when a user visits
one of your [Link] Web pages, an actual
program is being executed the [Link]
Web page.
These Web pages and Web services are
compiled on-demand, meaning that when a
Web page or Web service is first visited, it is
compiled. From then on, a cached version
(using disk-based caching) of the
intermediate code is referenced.
Comparing [Link] and ASP
Classic ASP [Link]
ASP pages output standard [Link] contains Web
HTML code, thereby not controls that return HTML
requiring any specific browser. 3.2-compliant HTML.

Could use ADO to access Can access databases via


database information. [Link].

Developers could create [Link] development is even


ASP pages quickly and quicker and easier than classic
ASP and utilizes [Link], which is
easily using VBScript very similar to VBScript.
Contrasting [Link] and ASP
Classic ASP [Link]
Uses scripting languages Uses compiled, .NET-
(VBScript / JScript/PerlScript) compatible language ([Link]
/ C# / [Link], etc.)
Web pages contain .asp Web pages contain .aspx
extension extension.

HTML and server-side Server-side script placed in


script intermixed. distinct SCRIPT blocks or
even separate source files.
Getting Started with [Link]
Need to install the .NET Framework
Only runs on Windows 2000 and Windows XP Pro
(requires that IIS 5.0+ be installed).
The .NET Framework is freely available to
download from [Link]
Once the .NET Framework has been installed
you can create [Link] pages simply by
creating a file (using your favorite editor
(Notepad / Visual Studio, etc.) with a .aspx
extension in a Web directory (I.e.,
C:\InetPub\wwwroot\).
The Good News
[Link] and Classic ASP can run side-by-side
on a Web server. That is, you can have
[Link] Web pages and classic ASP pages
running on your Web site.
One of .NETs goals is to provide side-by-side
functionality, meaning you should be able to
run [Link] v2.0 and v1.0 on the same Web
server at the same time (whenever [Link]
v2.0 comes out, that is!).
Getting Started with [Link]
(Some Simple [Link] Web Pages Examples)

[Link] Web Pages can be created to look


just like classic ASP pages. Show
[Link].
Note that when we run this demo, there is a
slight delay. The .NET Framework is actually
running an instance of the [Link] compiler!
This delay only occurs when the page is
loaded for the first time after it is created or a
change to the source code has occurred.
Also note that [Link] Web pages output
regular HTML, just like classic ASP pages.
Getting Started with [Link]
(Some Simple [Link] Web Pages Examples)

[Link] Web pages are actual, OOP programs,


consisting of a class derived from the Page class
in the .NET Framework.
[Link] pages can be coded to handle the Page
class events (the most commonly used Page class
event handler youll create is for the Load event,
which fires when an [Link] page is visited).
[Link] pages ideally will contain server-side
SCRIPT blocks instead of in-line (<% %>)
script.
Show [Link]
Online Resources
There are a plethora of .NET Web sites:
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
There are many newsgroups and listservs and
online forums as well:
[Link]
[Link]
Questions???

Now would be a great


time to ask questions!

You might also like