Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
NET framework
Course Organisers: Bruce Scharlau (CS3514) Judith Masthoff (CS5540)
Judith Masthoff, University of Aberdeen, 2004
Background
Client-side scripting (e.g. Javascript) Server-side scripting
PERL (Good at Pattern matching) ColdFusion (Looks like HTML) Python (0bject oriented, started from Unix) PHP Active Server Pages (ASP)
C#
J#
ADO .NET: Data and XML Base Class Library Common Language Runtime
CLR
Common Language Runtime
Compilation (Just-in-time compiler) Code execution Memory management Thread execution Error-handling Security support
Initially only for Windows, but others have appeared (Mono for Linux, Rotor for Mac).
Judith Masthoff, University of Aberdeen, 2004
Compilation in .NET
Code in VB.NET Code in C#
Code in another .NET Language
VB.NET compiler
Appropriate Compiler
Intermediate Language
.NET languages are compiled to an Intermediate Language (IL), not machine code.
CLR recompiles the IL code into machine code, just-in-time (JIT): done when a function is called. The JIT code stays in memory for subsequent calls (if memory allows).
Judith Masthoff, University of Aberdeen, 2004
Languages supported
Microsoft provides:
Visual Basic, C#, C++, J#, Jscript
C#
New language developed specifically for .NET Looks like JAVA or C++ Simpler than C++
System.Windows.Forms
Design ComponentModel
System.Drawing
Drawing2D Imaging Printing Text
System.Data
OleDb Common SqlClient SQLTypes XSLT XPath
System.Xml
Serialization
System
Collections Configuration Diagnostics Globalization IO Net Reflection Resources Security ServiceProcess Text Threading Runtime InteropServices Remoting Serialization
ASP.NET
ASP.NET, the platform services that allow to program Web Applications and Web Services in any .NET language
ASP.NET uses .NET languages to generate HTML pages. HTML page is targeted to the capabilities of the requesting Browser. ASP.NET Program is compiled into a .NET class and cached the first time it is called. All subsequent calls use the cached version.
Judith Masthoff, University of Aberdeen, 2004
ASP.NET
Logical Evolution of ASP
Supports multiple languages Improved performance Control-based, event-driven execution model More productive Cleanly encapsulated functionality
Web Applications
User browses to a web page Code runs on the server Pure HTML is sent to the browser Nothing to install on client machine Programming model is just like a Windows application
Event handling
Web Applications
Separation of UI and code
Helps productivity Allows better team work
Rich controls
Calendar, datagrid, etc All represented as HTML
Judith Masthoff, University of Aberdeen, 2004
Web Services
It is just an application that exposes its features and capabilities over the network using XML to allow for the creation of powerful new applications that are more than the sum of their parts
Windows Forms
Consistent way to create Windows applications across languages
Same designers Same event model Same controls
Mobile Development
Visual Studio supports building for smart devices. Same tools, controls, classes
Leverage skills
ADO.NET
Language neutral data access New objects (e.g., DataSets) Separates connected / disconnected issues Uses same types as CLR Great support for XML
Visual Studio.NET
Development tool that contains a rich set of productivity and debugging features We will be using a freeware alternative: Web Matrix.
C#
J#
ADO .NET: Data and XML Base Class Library Common Language Runtime
Conclusions
.Net provides way of implementing enterprise systems Different parts can be written in different languages, run in different environments (web, windows, etc), and still reuse code and skills
Tutorials
In the next three weeks, you will build an ASP.NET front end, using C#. Tutorial 1: Providing a user-interface for the application, and logic. Tutorial 2: Connecting your application to a database. Tutorial 3: Cleaning up the application, by separating the C# code out.
Judith Masthoff, University of Aberdeen, 2004