Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to ASP.NET

Similar presentations


Presentation on theme: "Introduction to ASP.NET"— Presentation transcript:

1 Introduction to ASP.NET
Kevin McManus Adapted from material by Gill Windall and Mark Sapossnek

2 the University of Greenwich
Contents An overview of what .NET is and some of its key features Describe the areas of .NET likely to have an impact on how web applications are developed What is Microsoft .NET? Some views Web Services ASP .NET versus ASP .NET Platform and .NET Framework Common Language Runtime (CLR) © K.M. 2/11/2007 the University of Greenwich

3 What is Microsoft .NET? that new language C#
Microsoft putting XML into everything the next version of Visual Basic the next version of ASP the next version of Visual Studio Microsoft trying to kill Java being able to run everything across the Net it’s a good thing it’s rubbish!!! © K.M. 2/11/2007 the University of Greenwich

4 the University of Greenwich
What is Microsoft .NET? Initially announced as the latest release of everything Microsoft ASP.NET, VB.NET, VisualStudio.NET With are some big changes the new language C# got rid of VB at last the Common Language Runtime (CLR) language integration - shared libraries possible platform independence – Mono CLR an attack on JRE ability to develop and use software components over the web XML based Web Services simplified deployment of Windoze software an end to DLL hell no use of the “registry” no more mixing HTML and script code in ASP © K.M. 2/11/2007 the University of Greenwich

5 the University of Greenwich
Web Services Allow remote access to software components via standard web protocols Use XML to exchange structured data Microsoft .NET is just one implementation of Web Services but there are many others The idea of Web Services is not exclusive to Microsoft “Last Wednesday, Microsoft released a new software development program called Visual Studio.Net. …. it represents the company's big leap into Web services, which many hope will trigger the next generation of corporate computing innovation. Microsoft spent $2 billion developing Visual Studio.Net and C#, but just about every other technology company on the planet -- including IBM and Sun Microsystems -- is also placing big bets on Web services.” ZDNet Feb 2002 © K.M. 2/11/2007 the University of Greenwich

6 Web Services and Microsoft .NET
There are three main angles on this: 1. Microsoft plans to provide a number of Web Services that application developers can use for a fee Microsoft .NET Passport - authentication service offers single sign-on capability for any Web site now Windows Live ID Microsoft .NET My Services - set of user-centric, XML Web services to manage, protect personal information e.g. Calendar, Contact, Inbox 2. Using ASP.NET you can create Web Services that others can use 3. Using a .NET language (or ASP.NET) you can write a program that uses Web Services © K.M. 2/11/2007 the University of Greenwich

7 Programming the Web Server-Side Code
What is server-side code? Software that runs on the server, not the client Receives input from URL parameters HTML form data Cookies HTTP headers Can access server-side databases, servers, files, mainframes, etc. Dynamically builds a custom HTML response for a client This course will focus on server-side .NET technologies. © K.M. 2/11/2007 the University of Greenwich

8 Programming the Web Server-Side Code
Why server-side code? Availability You can reach the Internet from any browser, any device, any time, anywhere Manageability Does not require distribution of application code Easy to change code Security Source code is not exposed Once user is authenticated, can only allow certain actions Scalability Web-based 3-tier architecture can scale out © K.M. 2/11/2007 the University of Greenwich

9 Programming the Web Server-Side Technologies
Common Gateway Interface (CGI) not language specific Internet Server API (ISAPI) Netscape Server API (NSAPI) Active Server Pages (ASP) now obsolete Java Server Pages (JSP) PHP Hypertext Processor (PHP) Cold Fusion (CFM) actually J2EE with the arrival of ColdFusion MX ASP.NET © K.M. 2/11/2007 the University of Greenwich

10 Programming the Web Active Server Pages (ASP)
Technology to easily create server-side applications ASP pages are written in a scripting language usually VBScript but also Jscript or PerlScript An ASP page contains static HTML interspersed with server-side code ASP script is commonly used to access and update a database 3-tier systems © K.M. 2/11/2007 the University of Greenwich

11 Programming the Web ASP
HTTP request (form data, HTTP header data) HTTP response HTML, XML ASP page (static HTML + server-side logic) An ASP page receives input from a HTTP request, and then dynamically generates a new HTML page that is returned to the client. ASP can also return XML or other types of data. © K.M. 2/11/2007 the University of Greenwich

12 Introduction to .NET What is .NET?
A vision web sites will be joined by web services new smart devices will join the PC user interfaces will become more adaptable and customizable enabled by web standards .NET will enable the next generation of applications. © K.M. 2/11/2007 the University of Greenwich

13 Introduction to .NET What is .NET?
A platform the .NET Framework Visual Studio.NET .NET Enterprise Servers database, messaging, integration, commerce, proxy, security, mobility, orchestration, content management .NET Building Block Services Passport .NET My Services (“Hailstorm”) goal: make it incredibly easy to build powerful web applications and web services } The focus of this course Microsoft is providing a suite of products and services to facilitate building this next generation. This course focuses on the .NET Framework and Visual Studio.NET. © K.M. 2/11/2007 the University of Greenwich

14 Introduction to .NET What is .NET?
A business model software as a service subscription-based services application hosting © K.M. 2/11/2007 the University of Greenwich

15 Introduction to .NET The .NET Platform
Clients Applications Web Form Web Service Protocols: HTTP, HTML, XML, SOAP, UDDI .NET Framework Tools: Visual Studio.NET, Notepad Windows and Linux and… Each blue box represents a separate computer (or cluster of computers). Your Internal Web Service .NET Foundation Web Services Third-Party Web Services .NET Enterprise Servers © K.M. 2/11/2007 the University of Greenwich

16 The Microsoft .NET Platform
Visual Studio .NET .NET Enterprise Servers SQL Server 2005 Win Server 2003 .NET Framework CLR, C#, ASP.NET, etc. .NET Services e.g. Microsoft Passport Operating System e.g. Windows XP, Windows 2000, Linux © K.M. 2/11/2007 the University of Greenwich

17 the University of Greenwich
Web Services A programmable application component accessible via standard web protocols The centre of the .NET architecture Exposes functionality over the Web Built on existing and emerging standards HTTP, XML, SOAP, UDDI, WSDL, … The definition of a Web service is “a programmable application component accessible via standard Web protocols.” In other words, it is a component that can be called remotely from a client application, over the Internet. Web Services will allow people, companies, customers, suppliers, doctors, patients, etc. to interact using different computers, different operating systems, and different applications. For example, you could use the same Web Service to store your personal and work calendar information. You could access this information from different applications and view and change it in different ways. © K.M. 2/11/2007 the University of Greenwich

18 Web Services Evolution of the Web
HTML, XML Generation 3 Web Services XML Generation 1 Static HTML HTML Generation 2 Web Applications HTML © K.M. 2/11/2007 the University of Greenwich

19 The .NET Framework What Is the .NET Framework?
A set of technologies for developing and using components to create: web forms web services windows applications Supports the software lifecycle development debugging deployment maintenance The .NET Framework provides a set of technologies that makes creating, deploying, using and maintaining applications (including Web applications and Web Services) much easier and more robust. © K.M. 2/11/2007 the University of Greenwich

20 The Microsoft .NET Framework
XML based Web Services Web Forms ASP.NET Windows Forms Library classes for accessing data and XML (ADO.NET, SQL, XML, XSLT) Library Framework Base classes (IO, string, collections, security) Common Language Runtime © K.M. 2/11/2007 the University of Greenwich

21 The .NET Framework The .NET Framework and Visual Studio.NET
VB C++ C# JScript Common Language Specification ASP.NET: Web Services and Web Forms Windows Forms Visual Studio.NET ADO.NET: Data and XML The .NET framework exposes numerous classes to the developer. These classes allow the development of rich client applications and Web-based applications alike. The classes are shown here, divided into four areas. ASP.NET provides the core Web infrastructure, such as Web Forms for UI-based development and Web Services for programmatic interface development. User interface development on the Windows platform can be done using Windows Forms. ADO.NET and XML provide the functionality for data access. The core base classes provide infrastructure services such as security and transaction management. You can create code in any of a large number of languages. This code will integrate in a deep, seamless manner via a standard called the Common Language Specification. Visual Studio.NET provides tools that increases your productivity when creating applications. .NET Framework Base Classes Common Language Runtime © K.M. 2/11/2007 the University of Greenwich

22 The .NET Framework .NET Framework Classes
System.Web System.Windows.Forms Services UI Form Button Description HtmlControls MessageBox ListControl Discovery WebControls Protocols System.Drawing Caching Security Drawing2D Printing Configuration SessionState Imaging Text System.Data System.Xml OLEDB SQL XSLT Serialization Design SQLTypes XPath This is but a brief illustration of the breadth of classes provided by the .NET Framework. We will explore many of these classes during this course. All of these classes are available to ALL languages. System Collections IO Security Runtime InteropServices Configuration Net ServiceProcess Diagnostics Reflection Text Remoting Serialization Globalization Resources Threading © K.M. 2/11/2007 the University of Greenwich

23 Common Language Runtime Goals
Development services deep cross-language interoperability increased productivity Deployment services simple, reliable deployment fewer versioning problems – NO MORE ‘DLL HELL’ Run-time services performance scalability availability The Common Language Runtime provides the underlying infrastructure for the .NET Framework. It provides very little application-visible functionality itself (security being a notable exception), but provides services to make development, deployment and execution much better in almost every way. reliability security safety © K.M. 2/11/2007 the University of Greenwich

24 Common Language Runtime
Programs can run on any platform for which the CLR has been implemented just like the JVM The CLR is no longer only available for Microsoft operating systems there are initiatives to port to other platforms Mono on Linux released 24th Nov 2004 There are many .NET languages Microsoft C# , C++, VB.NET, JScript Third Party Cobol, Fortran, Perl, Python, Smalltalk CLR gives language integration a class written in one language can be used by a class written in another share exactly the same libraries one API to learn © K.M. 2/11/2007 the University of Greenwich

25 Common Language Runtime Compilation
Source Code Assembly Compiler As a developer you can write code in the language of your choice. Your code is compiled into an Assembly, which is represented as a DLL or EXE. csc.exe or vbc.exe C++, C#, VB or any .NET language DLL or EXE © K.M. 2/11/2007 the University of Greenwich

26 Common Language Runtime
Program written in any .NET supported language C#, VB.NET, etc. compile Intermediate Language (IL) - like Java bytecode (.exe or .dll) Common Language Runtime Loads and executes code, garbage collects etc © K.M. 2/11/2007 the University of Greenwich

27 Common Language Runtime Assemblies
Assembly logical unit of deployment contains manifest, metadata, MSIL and resources Manifest metadata about the components in an assembly (version, types, dependencies, etc.) Type metadata completely describes all types defined in an assembly: properties, methods, arguments, return values, attributes, base classes, … IL is always compiled, never interpreted. © K.M. 2/11/2007 the University of Greenwich

28 Common Language Runtime Assemblies
Microsoft Intermediate Language MSIL or IL all languages compile to IL (managed code) IL is always compiled to native code before being executed Just In Time (JIT) compilation Resources data, images, audio, etc. © K.M. 2/11/2007 the University of Greenwich

29 Common Language Runtime Execution Model
Source code VB C# C++ Compiler Compiler Compiler MSIL Assembly Assembly Assembly Ngen Common Language Runtime JIT Compiler When an assembly starts running, the JIT (Just In Time) compiler in the Common Language Runtime converts the IL in the assembly to efficient machine code. It is this code that is actually executed. Native code CLR Managed Code Managed Code Managed Code Unmanaged Code CLR Services Operating System Services © K.M. 2/11/2007 the University of Greenwich

30 Common Language Runtime Services
Code management Conversion of MSIL to native code Loading and execution of managed code Creation and management of metadata Verification of type safety Insertion and execution of security checks Memory management and isolation Garbage collection Handling exceptions across languages Interoperation between .NET Framework objects, COM objects and Win32 DLLs Automation of object layout for late binding Developer services (profiling, debugging, etc.) The CLR provides many sophisticated services. © K.M. 2/11/2007 the University of Greenwich

31 Common Language Runtime Multiple Language Support
Common Type System (CTS) superset of the data types used by most modern programming languages Common Language Specification (CLS) subset of CTS that allows code written in different languages to interoperate What languages? Microsoft - C#, C++, VB.NET, Jscript third party Perl, Ada, Cobol, Java, Fortran, Delphi Eiffel, Smalltalk, Scheme, Oberon, Haskell, Python,… only practical if the language supports some sort of encapsulation The CTS supports many types of data. It allows each language to implement its own unique features. The CLS allows different languages to interoperate in a deep manner. For example, you can create a class in C# that derives from a class written in Eiffel, and is called from a Perl program. © K.M. 2/11/2007 the University of Greenwich

32 Common Language Runtime Applications
An application consists of one or more assemblies How does one assembly bind to another? based upon metadata and policy local (preferred) Assembly Global Cache (AGC) (accurate garbage collection?) Multiple versions of an assembly may exist on the same machine easier software deployment, updates and removal multiple versions of an assembly can even be used by the same application like this is a new thing? When we execute an application, how are the required assemblies located? Quite simply; the class loader (part of the CLR) will search the current directory for any assemblies. Assemblies should be kept within the same directory as the application that requires them. This allows different versions of the software to be installed on the machine without interfering with each other. However, if required, it is possible to share an assembly using the global assembly cache. © K.M. 2/11/2007 the University of Greenwich

33 Common Language Runtime Security
Evidence-based security (authentication) Based on user identity and code identity Configurable policies Imperative and declarative interfaces Before code in an assembly is run, the CLR looks at the identity of both the user and the code. You can specify policies that determine which code can be executed, and the priviledges that code will have when it runs. © K.M. 2/11/2007 the University of Greenwich

34 the University of Greenwich
Windows Forms Framework for building rich clients Built upon .NET Framework, languages Rapid Application Development (RAD) Visual inheritance Anchoring and docking Rich set of controls Extensible controls Data-aware Easily hooked into Web Services ActiveX support Licensing support Printing support Advanced graphics Windows Forms is a framework for building rich Windows client applications, and can be written in any language that supports .NET. Windows Forms provide the developer with many features, such as: The simplicity that Visual Basic 6 programmers are used to. Easy deployment. Windows Forms (as .NET applications) automatically takes advantage of the versioning and deployment features of the .NET Framework. Windows Forms offers an architecture for controls and control containers based on concrete implementation of the control and container classes. This significantly reduces control-container interoperability issues. Security. Windows Forms takes full advantage of the security features of .NET. This means that Windows Forms can be used to implement everything from an untrusted control running in the browser to a fully trusted application installed on a user's hard drive. Web Services Support. Windows Forms offer full support for quickly and easily connecting to Web Services. Rich Graphics. Controls. Windows Forms offer a rich set of controls that encompass all of the controls offered by Windows and new features such as new "flat look" styles for Buttons, Radio Buttons and Checkboxes. Data Awareness. Windows Forms offer full support for the ADO.NET data model. ActiveX Controls. Windows Forms offer full support for ActiveX controls. You can easily host ActiveX controls in a Windows Forms application. You can also host a Windows Form control as an ActiveX control. Licensing. Windows Forms take advantage of the .NET Framework enhanced licensing model. Printing. Windows Forms offer a printing framework that enables applications to provide comprehensive reports. Accessibility. Windows Form controls implement the interfaces defined by Microsoft Active Accessibility (MSAA), making it straightforward to build applications that support accessibility aids such as screen readers. © K.M. 2/11/2007 the University of Greenwich

35 the University of Greenwich
Web Forms Built with ASP.NET logical evolution of ASP similar development model: edit the page and go Requires less code actually more code but less programming New programming model event-driven/server-side controls rich controls (e.g. data grid, validation) data binding controls generate browser-specific code simplified handling of page state The first incarnation of ASP proved very successful. As part of the .NET Framework, Microsoft supports ASP.NET. ASP.NET is a logical evolution of ASP that addresses many of the issues previously associated with ASP. ASP.NET is now compiled and not interpreted. This of course can go some way towards improving efficiency and also means that code can now support strongly typed variables other than VARIANTS. This makes ASP.NET much more flexible and easier to code. A great deal of work has also been done to make sure that ASP.NET development has become cleaner and more productive. © K.M. 2/11/2007 the University of Greenwich

36 the University of Greenwich
Web Forms Allows separation of UI and business logic separation of concerns is a good thing cleaner, more maintainable code no more VB  Uses .NET languages not just scripting Easy to use components XCOPY/FTP deployment Simple configuration (XML-based) © K.M. 2/11/2007 the University of Greenwich

37 the University of Greenwich
Web Forms Caching (pages, fragments, custom) Scalable session state management Tracing support ASP.NET is extensible no ISAPI / ASP dichotomy Automatic process rollover Forms-based authentication © K.M. 2/11/2007 the University of Greenwich

38 ADO.NET ActiveX Data Objects
Similar to ADO, but better factored Language-neutral data access Supports two styles of data access disconnected forward-only, read-only access Supports data binding DataSet: a collection of tables Can view and process data relationally (tables) or hierarchically (XML) ADO.NET evolves from ADO, and is designed to deal with the issues of state, scalability and XML compatibility. Although existing ADO developers will find all of the old ADO classes inside the ADO.NET data model, they will also find that a few new classes have been introduced, including the DataSets, DataReaders and DataSetCommands classes. © K.M. 2/11/2007 the University of Greenwich

39 the University of Greenwich
Languages C# New language created for .NET a Java rip-off Safe, productive evolution of C++ but not as safe as Java until M$ sort out the exceptions Key concepts: component-oriented everything is an object robust and durable code preserving your investment whatever that means Submitted to the ECMA for standardization C# is a new language designed to take advantage of most of the features of the .NET Framework. C# was designed from the ground up to support component concepts like events, methods and properties. In C#, everything is an object, which allows the creation of very clean designs. C# was designed to make it easy to create robust and maintainable software. C# should allow you to preserve your existing investment by integrating easily with your existing code. © K.M. 2/11/2007 the University of Greenwich

40 Languages Visual Basic.NET
Modernizes and simplifies Visual Basic because the old VB was pants Now provides inheritance threading exception handling Support for late binding whatever that is Actually just C# with a different syntax almost VB.NET is a modernized version of Visual Basic. It is integrated with the .NET Framework, but still provides language constructs, features and syntax that is familiar to Visual Basic developers. © K.M. 2/11/2007 the University of Greenwich

41 the University of Greenwich
Conclusion dotNET is pretty neat really even if it does come from M$ A whole lot of good ideas have been gathered together without the accumulation of legacy bugware is observed in other M$ products Although .NET initially looked like another attempt by Mr Evil to take over the world it is remarkably open and standard compliant compared with other M$ offerings The best bit is probably Visual Studio with it’s tooled up approach to application development © K.M. 2/11/2007 the University of Greenwich

42 the University of Greenwich
More Resources .NET msnews.microsoft.com news server microsoft.public.dotnet.general newsgroup XML © K.M. 2/11/2007 the University of Greenwich


Download ppt "Introduction to ASP.NET"

Similar presentations


Ads by Google