1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Internet Development doc

53 317 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Internet Development
Trường học Sybex Inc.
Chuyên ngành Internet Development
Thể loại sách
Năm xuất bản 2000
Thành phố Alameda
Định dạng
Số trang 53
Dung lượng 770,34 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Chapter 8 DLL—dynamic linking and static linking Client- and server-side scripting Describe the differences between popular client-side and server-side programming languages.. Text and

Trang 1

Chapter 8

 DLL—dynamic linking and static linking

 Client- and server-side scripting

 Describe the differences between popular client-side and server-side programming languages Examples could include the following:

 Content could include the following:

 When to use the languages

 When they are executed

Trang 2

 Identify when to integrate a database with a Web site and the technologies used to connect the two.

 Demonstrate the ability to create HTML pages Content could include the following:

 HTML document structure

 Coding simple tables, headings, forms

 Compatibility between different browsers

 Difference between text editors and GUI editors

 Importance of creating cross-browser coding in your HTML

 Identify popular multimedia extensions or plug-ins Examples could include the

 Windows Media Player

 Describe the uses and benefits of various multimedia file formats Examples could include the following:

Trang 3

The state of the art in Internet software development is a pery thing New technologies are always emerging; others fade away as they’re recognized as too weak, too complicated, or too expensive Your job

slip-as an Internet professional is to stay familiar, in a broad way, with what’s new in software development Then, when you’re called upon to solve a par-ticular problem, you should be able to consult books and Internet resources

to figure out which technologies apply and how to use them There are no authorities, only people willing to teach themselves quickly

This chapter endeavors to introduce you to some Internet software and media development concepts that seem built to last, at least for a while Understanding these will help you grasp the new developments as they appear

Network Software Concepts

Sun Microsystems notes in its advertisements that “the network is the computer.” Increasingly, computation has more to do with sharing informa-tion among machines than with processing it on any given machine Clients request data from servers; servers make requests of other servers; processing jobs are shared among many machines and therefore accomplished faster This section has to do with the design of software systems that are meant to operate in networked environments

Trang 4

340 Chapter 8  Internet Development

Client-Server Architecture

Client-server architecture describes a particular kind of relationship between two computers It’s easy to assume that a server is a big, powerful computer and that a client is an everyday personal computer, but that’s not necessarily true The server in a client-server relationship is simply a computer on which

a particular resource—particular data—resides The client is a computer that requests a copy of that information for its own use

Clients and servers don’t have to be thought of as items of hardware They can be separate pieces of software, and indeed the two pieces of software in the equation can be running under the same processor You can install a Web server—Apache, Personal Web Server, whatever—on your machine and request Web pages from it, using a Web browser that’s running as a separate process For this reason, you’ll hear Web browsers referred to as “Web cli-ents,” just as programs like Apache are called “Web servers,” independent of the hardware they run on

When you surf the Web, you’re acting as the client in a series of server relationships The computers that are identified by domain names—

client-yahoo.com, amazon.com, and so on—contain collections of data When you request a document that’s identified by a particular URL, a copy of that doc-ument is sent from the computer on which it resides (the server) to your com-puter (the client) Similarly, when you use your computer to send a query to

a database server and receive a particular set of data in response, your machine is the client in a client-server relationship Client-server transactions need not involve Web pages by any means However, Web servers and Web clients illustrate many client-server concepts clearly, so we’ll focus on them for the present

Client Software

In the case of Web surfing, a Web browser is the client software in a server relationship People use their Web browsers to request information from other computers The browsers then receive the requested information and are responsible for presenting it to their users properly The process of interpreting and presenting information is not trivial because Web pages can consist of several different kinds of data:

client- Text with embedded markup information

 Special, embedded content that browsers can interpret without side help

Trang 5

out-Network Software Concepts 341

 Code written in a scripting language, which must be interpreted and

executed

 Code written in Java or an ActiveX language

 Content that must be interpreted by a plug-in

Let’s explore these different kinds of content in greater detail

Text and Markup Languages

The simplest Web pages are just text documents—sequences of characters,

formatted as American Standard Code for Information Interchange

(ASCII)—with special sequences of characters inserted here and there to

indi-cate what the text means and how it should be displayed You’re probably

somewhat familiar with the most popular Web markup language—it’s called

Hypertext Markup Language (HTML)—and we’ll cover some of its details

later in this chapter For now, just know that every Web browser incorporates

an HTML interpreter that interprets the HTML tags in documents

There are other markup languages; eXtensible Markup Language (XML)

isn’t as concerned with how text is displayed as with the meaning of

individ-ual passages of text XML is one way to share database information among

machines

Native Embedded Content

In addition to their ability to interpret and display HTML-formatted text,

Web browsers can display certain other kinds of data that is referred to in

HTML documents Graphics fall into this category All Web browsers can

interpret JPEG and GIF graphics; various browsers can interpret other image

formats as well (Microsoft Internet Explorer, for example, can display BMP

images) The pieces of software that interpret these embedded files—the

interpreters—are inseparable parts of the Web browsers

Scripting Languages

Sometimes, the markup tags that define Web documents include passages of

code in scripting languages like JavaScript or VBScript You can use scripting

languages to provide your Web pages with a certain level of interactivity and

animation The code that makes up programs—you’ll learn more about it

later in this chapter—is never compiled It always remains readable to

human beings Web browsers that are capable of running scripting-language

programs interpret the code directly, without it first being compiled

Trang 6

342 Chapter 8  Internet Development

Java and ActiveX Content

Though they’re kind of like graphics in the sense that they’re assigned a angular region and interpreted separately from the HTML document in which they’re embedded, Java applets and ActiveX controls deserve special mention Java applets and ActiveX Controls are little pieces of software that occupy portions of the browser windows in which they run

rect-Plug-In Content

Although browsers can make sense of and display certain kinds of content natively, other kinds of files—such as those containing certain kinds of sounds, three-dimensional graphics, and other special media—fall outside the browser’s built-in capabilities The most popular browsers, however, can

take plug-ins, which are software modules that users add to their browsers

to expand their capabilities When a browser encounters a piece of ded media that it can’t interpret natively, it checks its roster of plug-ins to see

embed-if one of them can handle the content If so, the handling is seamless—it looks to the user as if the browser can handle the content by itself

The problem with plug-ins is that no one has all of them, and you’re asking a lot of a user if you ask her to download and install a particular plug-in just to view your content The basic rule is to stick to media that browsers can inter- pret natively If you need to use plug-in content to get an effect you need—

chemists, for example, use special file formats to display images of complex molecules in three dimensions—make sure the benefits to users are great enough to warrant the trouble of downloading and installing the plug-in

Server Software

In the client-server equation as it applies to Web publishing, the Web server

is both a piece of software (the program that doles out pages in response to client requests) and a unit of hardware (the physical machine on which the server software runs)

Popular Web server software includes:

 Apache

 Microsoft Internet Information Server (IIS)

 Netscape Enterprise Server

Trang 7

Each handles requests for Web pages They may also have capacities to work with server-side scripting languages, extensions, Java servlets, and inde-pendent server-side programs that provide some sort of processing service.

Server Extensions

A server extension is sort of like a plug-in for Web server software A

soft-ware module that expands the capabilities of the server softsoft-ware itself, server extension may be published by the same company that put out the server software or by another publisher The Microsoft FrontPage Extensions are perhaps the most popular server extensions around They allow servers to support some of the interactive features Microsoft FrontPage lets developers embed in their pages

Java Servlets

Java servlets are special Java programs that expand the capabilities of Web

server software Similar to server extensions, the advantage of a Java servlet

is that a single, properly designed servlet will run under any operating tem for which there is a Java Virtual Machine (JVM)—the same as any Java program

sys-Server-Side Scripting Languages

Server-side scripting languages are programming languages designed for writing code that’s embedded in Web pages and interpreted before those pages are sent out to the client Active Server Pages (ASP) and Hypertext Pre-processor (PHP), both covered later in this chapter, are two of the most pop-ular server-side scripting languages

Compiled Server-Side Programs and Other Servers

In addition to exercising their native capabilities and those provided by

add-in servlets and extensions, Web servers may also cooperate with other kadd-inds

of server software, such as a database server When a program written in a server-side scripting language requests data from a database server, the Web server is capable of allowing the script to access the database server and retrieve the information it needs

Trang 8

Communication between Client and Server

If you’re going to have software that takes advantage of client-server tecture, you must have mechanisms in place for transmitting information back and forth between the two elements in the equation

archi-Forms

As far as the Web is concerned, client-server communications rely upon forms in Web pages that collect information from the user The data the user

puts into those forms is then submitted (or posted) to the program on the

server side The form data is packaged and sent to the server in a format defined by the Common Gateway Interface (CGI) specification

Common Gateway Interface (CGI)

The Common Gateway Interface (CGI) specification defines a way of

pack-aging text data (such as the contents of a form) for transmission over a work The CGI specification takes the contents of a form and the names of the form elements (as specified in HTML) and assembles them all into a long string of characters That string can then be passed to a program on the server side for processing and a response A CGI submission might tell

net-a server-side dnet-atnet-abnet-ase interfnet-ace to senet-arch for something net-and return net-a results page, for example Computers running Microsoft’s Internet Information

Server (IIS) support the Internet Services Application Programming

Inter-face (ISAPI), which can be used to carry out CGI-like tasks on IIS-equipped

Security

The problem with CGI is that it involves the transmission of a text string—that is by default readable to anybody who cares to intercept it—across a network If you’re using CGI to move data over the Internet, you’re exposing yourself and your client-side users to security risks You shouldn’t ever enter

Trang 9

sensitive information such as credit card data into a form for CGI sion unless you’re sure the transmission will be protected.

transmis-How are CGI submissions protected? Typically, Secure Sockets Layer (SSL) encrypts data transmitted between a client and a server Read all about SSL and other encryption technologies in Chapter 7

Trends in Network Computing

For many years, the trend in computing technology was toward more age space, faster processors, more capable software, and lower prices on everything Now it seems that, although “more, faster, and cheaper” will always be appealing, computer technology is getting to be “good enough” for many everyday applications Personal computers spend most of their processor cycles idling, waiting for their human users to do something

stor-The trends in computer technology have mainly to do with network

computing, which is computing performed by multiple computers linked

together on some kind of network Whether the collaborative computing has

to do with sharing information or sharing processor power, it seems that

a network often provides more computing power than its component machines could if they were acting alone You can distinguish the two main trends in networking by determining what is shared:

 In enterprise computing, it’s typically the data that’s shared One machine can access and operate upon information from another or from a central repository

 In distributed computing, the processing work is spread over several machines

Of course, there’s some overlap, and it’s not always easy to tell where cessing begins and data-sharing ends Let’s explore these trends further

pro-Enterprise Computing

Enterprise computing has to do with sharing information among the

appli-cations with which an organization, such as a company or a unit of ernment, does its business This kind of sharing can help the company realize efficiencies in its overall process of buying, making, processing, and selling goods and services and in the accounting, finance, human resources, and management infrastructures it maintains to facilitate those processes

gov-An Enterprise Resource Planning (ERP) system, because of its purchasing

Trang 10

features, might note that two different plants were buying the same part from different suppliers Because of its integration with the manufacturing process, it might note that one supplier’s products had far fewer defects than the other’s did The two purchasing agents at the plants might have had spotty communication without the ERP system, but the ERP system is much better able to spot situations like this and advise the buyer of the faulty parts to try the other plant’s supplier.

SAP (pronounced as three distinct letters), a German company, is ally recognized as the world leader in enterprise computing Its flagship ERP product, SAP R/3, is standard equipment among very large organizations all over the world, and SAP consultants make very good coin planning, imple-menting, and expanding SAP R/3 installations The trend is beginning to trickle down to smaller companies, as well, and some pundits expect that technologies like XML will make it easier to share information among small-business software products from many publishers

gener-SAP has several Web sites, each of which highlights some aspect of its ness The main one, www.sap.com, will direct you to the information you need Another site, www.mysap.com, focuses on SAP’s products and services for companies somewhat smaller than enormous.

busi-Distributed Computing

Distributed computing has to do with spreading portions of a computing job

over several machines This is not parallel processing, in which an operating

system divides the running of some program over several CPUs, but rather

a system of sharing discrete business tasks over several machines The crete tasks might include the following:

dis- Collecting data

 Managing a database that stores the data

 Analyzing the data

 Performing financial operations (such as billing) based on the dataAny given task might require work from several machines, each of which is responsible for one of the above The load is spread, and therefore the job is completed more quickly

Trang 11

JavaBeans are the epitome of componentization in the Java language It’s possible to build a Bean with an elaborate feature set and considerable power, then use it as a sort of “black box” that carries out some particular duty in various software systems of which it is a part You can distribute your Beans to others as well, either freely or, because Beans are compiled and have no visible source code, commercially Beans have found application in Sun’s own graphical user interface toolkit, as well as in other projects

Component Object Model (COM)

The Component Object Model (COM) is Microsoft’s answer to JavaBeans

It’s a means of writing independent code modules and having them nicate with one another The idea is that you could have a single, specialized COM module that various other pieces of software (other COM modules and non-COM programs) refer to for different reasons

commu-A single COM module might, for example, serve to perform queries on any specified database One program might refer to that COM module to query an employee database; another COM module might refer to the query module for accessing a sales database It’s an economy of scale: one COM module does double duty

Distributed Component Object Model (DCOM)

Distributed Component Object Model (DCOM) components are really no

different from COM components DCOM is a subset of COM that includes COM modules running on different machines and referring to one another across a network

Understanding Programming Languages

A programming language is any system of syntax and grammar that,

when used to generate sets of instructions called programs, can have an effect

on the behavior of a computer Programming languages broadly include everything from HTML to C++ Here, we’ll focus on highly capable, full-featured development languages and slightly less capable (but simpler) scripting languages

Trang 12

Full-Featured Development Languages

A full-featured development language is one that can be used to write

stand-alone programs You can use a full-featured development language to write

an elaborate word processor, a Web browser, or a database front end You could write a whole operating system with certain languages if you wanted

to Examples of such languages in the network software milieu include:

Windows 3.x, and another version for MacOS That’s not acceptable on the

Internet, where a server might have to provide the same program to many different kinds of computers—and might not be able to determine what kind

of computer needed the program at a given time Plus, it’s a pain—an sive pain—for software developers, who must multiply the effort required to write a program by the number of platforms they want to support

expen-The single biggest attraction of Java is that, theoretically, you can write one Java program, compile it, and expect it to run similarly under Win-dows 95, MacOS, Solaris, and half a dozen other operating environ-ments—a feature called architecture neutrality In practice, architecture

Trang 13

neutrality doesn’t work as well as many programmers would like, cially with complicated graphical programs But it works fine with simple programs, and future versions of Java will surely have even better archi-tecture neutrality And, most important, other languages don’t even make attempts at architecture neutrality.

espe-Visual Basic

Microsoft Corporation designed Visual Basic as a tool for fast development

of programs for its Windows operating systems The latest versions of Visual Basic incorporate a certain amount of sensitivity to network software devel-opment, but the primary use of Visual Basic is in writing software for use under Microsoft Windows 98 and Windows NT A large portion of the work done with Visual Basic involves the creation of user interfaces for databases.Lately, Visual Basic has become more oriented toward network pro-gramming You can use Visual Basic to create ActiveX controls for embed-ding in Web pages that will be interpreted by Microsoft Internet Explorer You also can use Visual Basic to create Component Object Model (COM) components

You’ll find the latest Microsoft news about Visual Basic at msdn.microsoft com/vbasic/.

C and C++

Widely regarded as the top of the heap as far as general-purpose ming languages are concerned, C and C++ are the standards by which most

program-other such languages are measured You can do anything with C and C++,

from manipulating the pixels on a video screen individually to reading the contents of memory one bit at a time Programs written in the C languages are fast, too

What’s the difference between C and C++? The latter is object oriented, which means (to cite one important characteristic) it supports the creation of code modules that can inherit traits from other such modules Say you’d cre-ated a module that performed a countdown operation If you wrote that module generically enough, you could write other modules that exploited the countdown capability in different ways You might, for example, write one program that displayed a countdown in Roman numerals and another that

Trang 14

used Thai numerals, both based on the same abstract underpinnings You’ll often note that C and C++ programs consist of more than one file There’s usually a primary executable, then several libraries Windows uses dynamic link libraries (DLLs) most of the time; other platforms use static linking arrangements.

C and C++ both have large communities of developers using them, which means there’s a large body of prewritten C and C++ code out there (both for sale and in the public domain) An increasing amount of the prewritten code has to do with communicating information over networks, so it’s fair to say that the languages are network friendly However, they don’t support cross-platform development like Java does If you compile a C program for MacOS, it’s a MacOS program forever

General-Purpose Scripting Languages

A scripting language is any language whose code is not compiled Further,

scripting languages rely on a host to interpret their programs and provide an

environment for them to operate in The host can be an operating system (most operating systems support at least one scripting language) or a stand-alone program (most programs’ macro languages are examples of scripting languages)

Because they’re easy to learn (relative to full-featured programming guages) and so well suited to quick-and-dirty solutions to problems, an awful lot of server site activity is coordinated by programs written in general-purpose scripting languages Oftentimes, developers will use an operating system’s native scripting language (shell scripting) or install and use a more capable (or more attractive) scripting language like Perl or Tcl

lan-Shell Scripting

Because of the need of users and administrators to automate miscellaneous

tasks, most operating systems have a shell scripting language A shell

script-ing language is a programmscript-ing language (usually a fairly simple one) that

can issue command-line instructions, manipulate files and directories, do some text management, and invoke other programs The MS-DOS batch language (which lives on in Windows NT 4 and elsewhere) is an example of

a shell scripting language

Users of Unix variants can typically install any of several shells on their machines to provide different sets of commands and different capabilities

Trang 15

These shells—csh, ksh, and bash are some examples of Unix shells—have their own shell scripting languages Microsoft Windows 98 is the first Microsoft operating system in some time to have a decent shell scripting language Its Windows Script Host (WSH), available as a retrofit for Windows NT 4 and slated to be standard equipment on all versions of Windows 2000, allows you

to perform shell scripting tasks with JavaScript, VBScript, or any other ing language for which someone makes available a WSH language module.For Web developers, shell scripting languages are suitable for certain user interactivity tasks You could use your shell scripting language to take infor-mation from a form and store it in a file or to assemble somewhat customized pages for users to view Still, compared to Perl, shell scripting languages are usually pretty weak

script-Perl

The darling of system administrators and Web developers everywhere (as well as one of the greatest triumphs of the open-source movement), Practical Extraction and Reporting Language (Perl) is like a good video game: easy to learn, but hard to master The odds are excellent that if the task you have in mind can be accomplished at all, it can be accomplished with Perl Server-side scripts written in Perl may not run as fast as compiled programs or exhibit the elegance of object-oriented programs, but they get the job done and usually can be written in a hurry

Perl excels at text processing, which means it’s great at picking tion out of form submissions and very good at assembling custom Web pages

informa-in response to surfer requests Its various modules—there are vide Perl programmers with easy access to many different environments, including all popular server-side databases Plus, it’s free Larry Wall and a community of developers have released Perl to the public domain and con-tinue to develop it for the public benefit Though Web developers are mainly concerned with command-line Perl programs that interface with remote Web clients, the language also can be used in conjunction with the Tk graph-ical user interface (GUI) toolkit to create programs with graphical interfaces

Trang 16

many—pro-The best way to learn about Perl is to install it and play with it yourself You can download the Perl tools (in source code form and in various compiled forms) from many sites, including the Comprehensive Perl Archive Network (CPAN) at www.cpan.org/.

Tcl

The Tool Command Language (Tcl) is a scripting language designed as a sort

of glue with which to share information among applications Pronounced

“tickle,” Tcl was developed by John Osterhout Like Perl, Tcl can work with the Tk GUI toolkit to create windowed applications You’ll often hear the two referred to collectively as Tcl/Tk Tcl isn’t as big a deal for Web devel-opment as Perl and shell scripting languages

There’s a collection of Tcl FAQs on the Web at www.tclfaq.wservice.com/ tcl-faq/ John Osterhout started a Tcl-related company called Scriptics; its Web site is www.scriptics.com You can download the Tcl development envi- ronment there.

Web-Specialized Server-Side Scripting Languages

A server-side scripting language is any language whose code is embedded in text documents and meant to be interpreted by the Web server program before it sends the documents (typically containing HTML and server-side scripting, as well) out to the client Server-side scripts can, for example, insert the current date and time in a document, customize a document with the user’s name, or insert a hit counter

Server-side scripting languages can sometimes work with arguments, which are extra pieces of data supplied with the client’s request for a docu-ment A client might, for example, request this document:

results.php3This is a Hypertext Preprocessor (PHP) program called results.php3 Pre-sumably, this program yields output in a form the client can understand—

Trang 17

typically HTML A client might also specify an argument by specifying this file:

results.php3?physics

That causes physics to be available to results.php3 as the value for one of

its variables Such a system might power a search engine, for example

Hypertext Preprocessor (PHP)

Deriving its abbreviation from its German spelling, Hypertext Preprocessor

(PHP) is a public-domain server-side scripting language It originally was

developed for Unix systems and continues to find most of its applications under Apache servers, but a version of the language for 32-bit Microsoft Windows machines is available, too Get the details at www.php.net

Active Server Pages (ASP)

Active Server Pages (ASP) is the server-side scripting solution for Microsoft

Web servers—mainly, Internet Information Server (IIS) If you’re running a Windows NT server as your platform for Web content and need the versa-tility of server-side scripting, ASP probably is the way to go It’s based on VBScript and you can use Microsoft Visual InterDev to automate some of the development process Get the details at msdn.microsoft.com

LiveScript

LiveScript is the server-side scripting solution for Netscape Communications Corporation’s Web servers Essentially, it’s a variant of JavaScript—often, you will in fact hear it called “server-side JavaScript.” Get the goods on this language at devedge.netscape.com

Client-Side Markup Languages

A client-side markup language is any system of adding tags (markup) to a text document to supply information about how the text should be rendered

or what it means Client-side markup languages are interpreted by the browser, so you’ll sometimes see subtle variations in how different browsers interpret the same markup

Trang 18

Hypertext Markup Language (HTML)

Hypertext Markup Language (HTML) is the most popular language for ating Web documents With fundamentals that are easy to learn and high-end capabilities that satisfy many advanced publishing requirements, HTML

cre-is the workhorse of Web publcre-ishing HTML code cre-is not always elegant, it does not lend itself to searching (the way XML does), and different browsers will frequently interpret the same HTML document differently, but at present HTML is the standard language of Web publishing

A basic orientation to HTML coding appears later in this chapter.

eXtensible Markup Language (XML)

While HTML describes how its surrounding text should appear in a browser

window, eXtensible Markup Language (XML) describes what the text

means Rather than lock publishers into a universal set of tags that must be made to apply in all situations (as HTML does), XML allows users to define their own tags as needed

The idea is that, within a given group of XML users—people in a given industry, say, or people wanting to communicate corporate financial infor-mation to shareholders—there would be a common XML specification

called a document type definition (DTD) One party could publish data in

conformance with that DTD, and another party, having access to the same DTD, could interpret it

Remember, XML isn’t so much about the display of data An XML ument on its own, in fact, is not renderable—you have to supply style sheets and other information in order to associate the data in an XML document with cosmetic characteristics a browser could use For this reason, XML is

doc-as much a data-interchange tool for communicating data among tions as a language for displaying data to a person

applica-Virtual Reality Markup Language (VRML)

Still primarily a novelty, Virtual Reality Modeling Language (VRML) is a

way of describing three-dimensional space via tags in a text document VRML includes means of describing shapes, relative positions, surface tex-tures, and light sources

Trang 19

Although it’s technically astute, fun to play with, and the center of a siderable community on the Internet, VRML really hasn’t found a killer application yet It’s a minor publishing language.

con-Client-Side Scripting Languages

A client-side scripting language is a scripting language whose code is preted on the client side of the client-server relationship Client-side scripting code typically is embedded in HTML documents It’s not executed when the server runs the server-side code Instead, it’s run by the client computer after the download is complete Client-side scripting languages can provide ani-mation and interactivity (such as form prevalidation and simple calcula-tions) without adding to the server’s processing load

inter-There are two main client-side scripting languages:

 JavaScript and JScript (technically two languages, but very similar ones)

 VBScriptThis section explores these languages

JavaScript and JScript

JavaScript is a powerful yet fairly simple scripting language you can use to

add “intelligence” and interactivity to your Web pages With JavaScript, you can do such things as:

 Make your browser’s status bar display a label when you pass your mouse pointer over a link

 Design a registration form that makes sure visitors to your site send in valid information

 Equip your pages with animated elements

JScript is Microsoft Internet Explorer’s version of JavaScript It can handle

any JavaScript program…more or less Though JScript is mostly compatible with JavaScript, Microsoft Internet Explorer doesn’t interpret everything the same way Netscape’s browser does The lesson to you: test your pages with Microsoft Internet Explorer as well as Netscape Navigator

Trang 20

Here’s an HTML document that incorporates a simple JavaScript gram, just to give you an idea of the basic syntax:

F I G U R E 8 1 The results of a simple JavaScript program

Trang 21

If JavaScript borrows much of its structure and syntax from Java, VBScript borrows a great deal from Visual Basic As Microsoft’s preferred client-side scripting language, VBScript can do all sorts of automation, animation, verification, and organization jobs on the client side If you know standard Visual Basic, you’ll probably find it easy to pick up a working knowledge

of VBScript In fact, you can use your VB development environment to do many VBScript development tasks

Here’s a simple VBScript program to give you a feel for the language’s appearance:

<H1>A VBScript Demonstration</H1>

<INPUT TYPE=BUTTON VALUE="Say Hello" NAME="Hello">

Trang 22

F I G U R E 8 2 A simple VBScript program that spawns a dialog box

Databases

A database is any collection of data A card file is a kind of database;

a list of telephone numbers on a piece of paper is a database Computer bases are essentially the same sorts of things, but with the information (and the labels identifying it) stored digitally

data-Database Management Systems (DBMSes) are programs that add data to

databases, extract data from them, organize the data for various tions, and generally attempt to guarantee that the database is fast, easily

applica-accessible, and secure from outsiders Data mining applications attempt to

analyze the data in databases and draw conclusions from it Data mining applications at Wal-Mart Stores, Inc., for example, realized that most people who buy breakfast cereal at Wal-Mart also buy bananas during the same visit The result of the data mining is that most Wal-Marts now stock bananas in their cereal aisles, hoping to encourage even more cereal buyers

to pick up some bananas on impulse

Non-Relational Databases

Non-relational databases (or flat-file databases) are essentially unadorned lists A non-relational database might serve to correlate names with e-mail

Trang 23

addresses or atomic symbols with atomic numbers Non-relational bases play a big role in the operation of the Internet because they store the Domain Name Services (DNS) lists that associate domain names with IP addresses.

data-The problem with non-relational databases is that they can’t keep track of sets of data with multiple relationships among the fields Non-relational databases that are used to keep track of data with such complex relation-ships end up having multiple instances of each piece of data—an inefficiency that’s one of the cardinal sins of database design Relational databases are better for applications that involve complicated relationships

Relational Databases

A relational database is a database with multiple tables, each having thing in common with at least one other Say, for example, that you work for your government’s automobile-registration organization You might have one table that correlates license plate numbers to Vehicle Identification Numbers (VINs) and another table that correlates VINs with the registered owners of the vehicles those VINs represent Still another table might con-tain contact information about the people who have registered vehicles with your government

some-So, if the police want to find the address of the woman who just held

up the liquor store in your town, they’d go to the motor vehicle authority with the license plate number of her getaway car The doughty database administrator there would be able to find the robber’s name and address by associating the plate number with a VIN, the VIN with a name, and the name

with an address There are three tables involved, all related to one another by

some common piece of information This is a relational database

Database Servers

A database server is any program that’s responsible for maintaining one or

more databases and responding to queries sent to them Database servers combine efficient storage and access with DBMS software All major data-base servers comply with the Structured Query Language (SQL) specifica-tion—more on that later—though many of them supplement standard SQL with proprietary or otherwise nonstandard extensions to the language

Trang 24

In addition, a computer that’s dedicated to running a database server gram is called a database server.

pro-Many companies publish database server software They all have their fans Some fit better into certain applications than others; some cost more than others Evaluate the companies’ offerings next to your organization’s needs Here are the big players, in alphabetical order:

 Hughes Technologies puts out mSQL, a server for small- and mid-size applications that’s free for use under certain circumstances Read about it at www.hughes.com.au/

 Microsoft publishes Microsoft SQL Server 7, which runs best under Windows NT Details are at www.microsoft.com/sql/

 Oracle made its name with database servers Its latest products are the servers of the Oracle 8I family Details appear at www.oracle.com/database/oracle8i/

 Sybase also has been selling database servers for years Its latest ones compose the Adaptive Server family Read all about them at www.sybase.com/products/databaseservers/

 T.c.X DataKonsult improved upon mSQL and came out with MySQL, which also is free under some circumstances The server has

a Web site: www.mysql.com/

Structured Query Language Fundamentals

Structured Query Language (SQL) is the standard language for working

with relational databases It’s a complex, powerful language that’s far beyond the scope of this book and the i-Net+ exam, but its fundamentals are worth a mention here

SQL is a descriptive language, which is a kind of language different from the procedural and object-oriented languages that characterize most soft-ware development jobs Here’s an analogy Say you went to a delicatessen to acquire a ham sandwich If you were only able to speak in procedural lan-guages, you’d have to tell the guy exactly what to do in order to yield the results you wanted You’d have to say, “Cut the roll in half and place the

Trang 25

halves side-by-side, cut side up Spread mustard on the halves Slice ham until you have a quarter-pound of it Remove the ham from the slicer….” You get the idea.

With a descriptive language, you could just describe the results you want

“I want a ham sandwich on a Kaiser roll with Dijon mustard and an olive,” you’d say And then the counterman, being a skilled maker of sandwiches, delivers what you want The process is a lot easier In the case of databases, the database server knows how to extract information from the databases it knows about Clients who make requests for data from the databases

describe the data they want with SQL These requests are called queries.

Let’s take a look at an example of an SQL query:

SELECT firstName, lastName FROM employeeTable;

That query would yield a list—called a report—of all values in the firstName

and lastName fields of every record in the employeeTable table What if we didn’t want all of them? We could try this:

SELECT firstName, lastName FROM employeeTable WHERE wage > 8.5;

That would yield the contents of the firstName and lastName fields in every record in which the wage field contained a value greater than 8.5

Note that queries don’t have to extract data from databases The SQL instructions that create tables, insert data into them, and establish relation-

ships (called joins) among tables are called queries, too.

There’s a good SQL tutorial on the Web at w3.one.net/~jhoffman/

sqltut.htm.

HTML Fundamentals

Most Web publishing involves Hypertext Markup Language (HTML) to some degree or another This section aims to orient you to the barest fundamentals of the language Detailed coverage of HTML is beyond

Trang 26

the scope of this book and the i-Net+ exam For further information on the language and its uses, refer to a specialized tutorial or reference book.

How to Write an HTML Document

If you’re going to write HTML, you need a tool for doing so You have two options:

 A text editor for editing the HTML code directly

 A graphical editing environment that handles code generation for you

Editing Code Directly

If you understand HTML, you may find it preferable to work with the code directly Because HTML files are just ASCII text files with special tags added, you can edit HTML code with any text editor Which text editor you use is more a matter of preference than anything else, though some editors ship with macros and other aids that speed the HTML writing process

Some popular text editors include:

 Wilson WindowWare’s WinEdit (www.winedit.com)

 Bare Bones Software’s BBEdit dit/bbedit.html)

(www.bbedit.com/products/bbe- Fookes Software’s NoteTab (www.notetab.com)

 SimpleText (ships with MacOS)

 Notepad (ships with Microsoft Windows)

 Emacs (ships with most versions of Unix)There also are some hybrid editors on the market These editors allow you

to switch back and forth between a direct view of the code (as in a text tor) and a view of the formatted page as it would appear in a browser (as in

edi-a WYSIWYG editor, discussed next) Alledi-aire HomeSite (edi-avedi-ailedi-able for triedi-al download at www2.allaire.com/products/homesite/) is such a product

Using a WYSIWYG Editor

Some people prefer not to fool with HTML code directly and would rather use a development tool that lets them see how things will look right away

Ngày đăng: 21/12/2013, 04:19

TỪ KHÓA LIÊN QUAN

w