chapter 1

24
The .NET Framework

Upload: application-developer

Post on 21-Dec-2014

1.777 views

Category:

Technology


0 download

DESCRIPTION

The .NET FrameWork

TRANSCRIPT

Page 1: Chapter 1

The .NET Framework

Page 2: Chapter 1

AGENDA

• Brief History of Internet

• Server Side programming

• Client Side programming

• Server vs. Client side applications

• What is ASP.NET

• How ASP.NET works

• Introduction to .NET Framework

• Web Platform Installer

• Introduction to Visual Studio IDE

• Creating ASP.NET projects

Page 3: Chapter 1

History of Internet

• To create a truly resilient information network—one that could withstand the loss of several computers without preventing the others from communicating.

• It flourished as a tool for academic collaboration, allowing researchers across the globe to share

• The first generation of websites often looked more like brochures, consisting mostly of fixed HTML pages.

• HTML 2.0 introduced the first seed of web programming with a technology called HTML forms.

Page 4: Chapter 1

Server-Side ProgrammingTechnology in which a user's request is verified by running a script directly on the web server to generate dynamic web pages

Server-side scripts are never visible to the browser as these scripts are executed on the server and emit HTML corresponding to user's input to the page.

It is usually used to provide interactive web sites that interface to databases or other data stores.

Page 5: Chapter 1

Server-Side ProgrammingIn the earlier days of the web, server-side scripting was almost exclusively performed by using a combination of C programs, Perl scripts and shell scripts using the Common Gateway Interface (CGI).

These and other on-line scripting languages such as ASP and PHP can often be executed directly by the web server

Page 6: Chapter 1

Examples of Server-side scripts• ASP • ColdFusion Markup Language (*.cfm) • Java via JavaServer Pages (*.jsp) • JavaScript using Server-side JavaScript (*.ssjs,

*.js) • Perl CGI (*.cgi, *.ipl, *.pl) • PHP (*.php) • Python (programming_language) via Django

(Web_framework) (*.py) • Ruby, e.g. Ruby on Rails (open source)

Page 7: Chapter 1

Client-Side Programming

Refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side (on the web server)

Client-side scripts are often embedded within an HTML or XHTML document (hence known as an "embedded script"), but they may also be contained in a separate file, which is referenced by the document (or documents) that use it (hence known as an "external script").

Page 8: Chapter 1

Examples of Client-Side Scripts

• JavaScript• VBScript• Java applets• Active-X controls• Plug-ins Shockwave, Flash, Real Audio etc.

Page 9: Chapter 1

Sever vs. Client web applications

Page 10: Chapter 1

ASP vs. ASP.NETMicrosoft's previous server side scripting technology ASP (Active Server Pages)

ASP.NET is the next generation ASP, but it's not an upgraded version of ASP.

ASP.NET is an entirely new technology for server-side scripting. It was written from the ground up and is not backward compatible with classic ASP.

Page 11: Chapter 1

What is ASP.NET

ASP.NET is an engine or a program (aspnet_isapi.dll) embedded in IIS Server and is an integral part of .NET framework.

It allows to combine the best of client-side and server-side programming.

The best ASP.NET controls can intelligently detect the features of the client browser.

You can super-charge ordinary ASP.NET pages with Ajax features, which use even more client-side JavaScript.

Page 12: Chapter 1

How does ASP.NET work?

• When a browser requests an HTML file, the server returns the file

• When a browser requests an ASP.NET file, IIS passes the request to the ASP.NET engine on the server

• The ASP.NET engine reads the file, line by line, and executes the scripts in the file

• Finally, the ASP.NET file is returned to the browser as plain HTML

Page 13: Chapter 1

The .NET Framework

A high level development platform developed by Microsoft which allows developers to program dynamic web pages without worrying about the low-level implementation details.

It provides high level features such as ability to authenticate users, store personalized information, display records from database.

The applications running on .NET framework are robust, well managed, scalable, and can keep up with the demand of too many simultaneous users without slowing down or crashing

Page 14: Chapter 1

Introduction to the .NET Framework

The .NET framework is a software platform that provides:

1. A managed computing platform2. A secured runtime/execution environment3. Language Choice4. An Object-Oriented Programming environment5. A collection of built-in class library and functions 6. Integrated Development Environment Visual

Studio

Page 15: Chapter 1

.NET Framework consists of:

1. The .NET languages:2. The Common Language Runtime

(CLR):3. The .NET Framework class library:4. ASP.NET Engine5. Visual Studio:

Page 16: Chapter 1

.NET Languages

• Visual Basic• C# (Sharp) • Visual C++• Jscript

Intermediate Language (IL)

All the .NET languages are compiled into a lower-level language called the Common Intermediate Language (CIL, or just IL). Because all .NET languages are designed based on IL, they all have profound similarities. In fact, the languages are so compatible that a web page written with C# can use a VB component in the same way it uses a C# component, and vice versa.

Page 17: Chapter 1

The .NET Framework formalizes this compatibility with something called the Common Language Specification (CLS).

Essentially, the CLS is a contract that, if respected, guarantees that a component written in one .NET language can be used in all the others. One part of the CLS is the Common Type System (CTS), which defines the rules for data types such as strings, numbers, and arrays that are shared in all .NET languages.

The CLS also defines object-oriented ingredients such as classes, methods, events, and quite a bit more.

For the most part, .NET developers don’t need to think about how the CLS works, even though they rely on it every day.

Page 18: Chapter 1

.Common Language Runtime

The Common Language Runtime (CLR) is the run time environment that provides the underlying infrastructure for the .NET Framework. It is where the source code of an application is compiled into an intermediate language.

CLR translates the IL into the native code of the operating system using a just-in-time (JIT) compiler.

Not only does the CLR execute code, but it also provides a whole set of related services such as code verification,optimization, and object management.

Page 19: Chapter 1
Page 20: Chapter 1

.NET Class Library• The .NET class library is a giant repository of

classes that provide prefabricated functionality for everything from reading an XML file to sending an e-mail message.

• Any .NET language can use the .NET class library’s features by interacting with the right objects.

• Provides the tedious infrastructure so that application developers need only to write business specific code. For example, the .NET Framework deals with thorny issues such as database transactions and concurrency, making sure that hundreds or thousands of simultaneous users can request the same web page at once.

Page 21: Chapter 1

ASP.NET Engine

It hosts the web applications that you create with .NET and supports almost any feature from the .NET framework class library.

It also includes a set of web specific services such as secure authentication and data storage.

Page 22: Chapter 1

Visual StudioProvides a rich environment where you can rapidly create advanced applications. Although in theory you could create an ASP.NET application without Visual Studio (for example, by writing all the source code in a text editor and compiling it with .NET’s command-line compilers), this task would be tedious, painful, and prone to error.

Some of the features of Visual Studio include the following:

• Page design• Automatic error detection• Debugging tools• IntelliSense

Page 23: Chapter 1

Web Platform Installer

Page 24: Chapter 1

Summary

This chapter presented a high-level overview that gave you your first taste of ASP.NET and the .NET Framework.

You also looked at how web development has evolved, from the basic HTML forms standard to the modern ASP.NET platform.

In the next chapter, you’ll get a comprehensive overview of the C# language.