World Wide Web Programming

The future? C#.NET. ◇ Language created entirely for the .NET platform. ◇ Strongly uses XML. ◇ Object Oriented. ◇ Very similar to Visual Basic ...
180KB taille 9 téléchargements 312 vues
World Wide Web Programming 2 – Main Programming Languages

The basics - HTML HTML: HyperText Markup Language ‹ Universal Resource Identifier ‹

• Every page has a URI, sometimes known as URL. Ex… ‹

‹

‹

Joe Cool http://somesite.com/html/top.html#section_2

Relative URIs •

What is the use of URIs on HTML? ‹ ‹ ‹ ‹ ‹ ‹ ‹ ‹

Link to another document or resource Link to an external style sheet or script Include an image, object, or applet in a page Create an image map Submit a form Create a frame document Cite an external reference Refer to metadata conventions describing a document

What is HTML? Publishing language for WWW ‹ The actual version is HTML4 ‹ It is a markup language ‹ Interpreted directly by the browsers ‹ It’s a “client-side” language ‹

The Creator - SGML SGML is a system for defining markup languages ‹ HTML is an example of a markup language ‹ Uses a DTD (Document Type Definition) to define the syntax of markup constructs ‹

Other SGML derived languages ‹

XML (eXtensible Markup Language) • Huge role in data exchange • Defines types of files

‹

XSL (eXtensible Stylesheet Language) • Language for expressing stylesheets • Thanks to XSLT (XSL Transformations) it can transform an XML document into something well formatted

The good old Java Java has gained a big importance on the Web through technologies such as J2EE or J2ME ‹ Most common use is the creation of web applets ‹ Slow, terribly slow ‹ Complicated to use, terribly complicated to use (at least for the Web) ‹

Something different: JavaScript Compact, object-based scripting language for developing client and server Internet applications ‹ Most applications run on client side, so the code is visible ‹ Different than Java! ‹

Java vs. JavaScript ‹

JavaScript

• Interpreted (not compiled) by client • Object-based Uses built-in, extensible objects, but no classes or inheritance • Code integrated with HTML • Variable data types not declared • Dynamic binding. Object references checked at runtime • Cannot automatically write to hard disk

‹

Java

• Compiled bytecodes downloaded from server to client • Object-oriented Applets consist of object classes with inheritance • Applets distinct from HTML • Variables data types MUST be declared • Static binding. Object references must exist at compile-time • Cannot automatically write to hard disk

The savior: PHP ‹ ‹ ‹

‹ ‹ ‹

‹

Recursive acronym for Hypertext Preprocessor Open Source scripting language Suited for Web development, embedded into HTML Server-side execution Extremely simple to learn (as you’ll all see) Can be used to create server-side applications, command line scripting, client-side GUI applications (with PHP-GTK) Works with all major databases (compatible with a total of 21, including Oracle, MySQL, PostgreSQL, ODBC, Sybase, …)

The rival: ASP.NET ASP Language is another powerful scripting language ‹ Built on the Common Language Runtime used for the .NET platform ‹ Used for Web Services ‹ Very efficient, loved by many companies, but not open source… ‹ It’s a kind of “PHP for high class” ‹

The “myth”: CGI ‹ ‹ ‹

‹

‹

Common Gateway Interface Not an actual language Standard for interfacing external applications with information servers Executed in real-time, so the output is dynamic A CGI program can be written on C/C++, Fortran, PERL, TCL, any UNIX shell, Visual Basic or AppleScript

Another big option: Perl Open Source ‹ Popular due to its facility with text manipulation and rapid development cycle ‹ Amazon.com partly built on Perl ‹ Can be embedded on any Web server ‹ Can interface with external C/C++ libraries through XS or SWIG ‹

The future? C#.NET Language created entirely for the .NET platform ‹ Strongly uses XML ‹ Object Oriented ‹ Very similar to Visual Basic ‹

Client-side vs. Server-side ‹

Client-side applications: • Usually run by the browsers thanks to plug-ins • Code is totally visible

‹

Server-side applications: • Executed on the server so only the output can be read by the client • Impossible to read the code

Why PHP & MySQL? PHP is one of the most powerful free languages for Web programming ‹ Easy to learn (appropriate for a single semester course) ‹ MySQL is also a powerful FREE database that couples perfectly with PHP ‹ Also because I decided so… ‹