Robert Zimmer Room 6, St Johns 29 R.Zimmer@gold.ac.uk Office Hours: Web-Based Computing.

Post on 28-Mar-2015

216 views 0 download

Tags:

transcript

Robert ZimmerRoom 6, St Johns 29

R.Zimmer@gold.ac.ukOffice Hours:

Web-Based Computing

The Return of Mickey Mouse

Last year, we saw the Sorcerer's Apprentice as an example of how software projects can go wrong

This year, we see it as a model of modern computing system

Mickey has a lot of water to moveFor water, thing about information

At first, he delivers it all himself

Then he has a system to deliver it one load (two buckets) at a time

Then he has a brilliant accident:He makes lots of new wap-enabled brooms all getting the information at the same time

Notice that each broom is really controlling himself

This can be a problemBut it can be an opportunity

So, we have one pool of water (The Server) and lots of different brooms (the clients)

And that is what the course is aboutAlmost

Really there are lots of different pools of water and brooms going around from pool to pool

The image:We have lots of pools of waterSome spilled waterAnd lots of brooms surfing in the water from pool to pool, taking water out of eachSometimes even putting water into some of the poolsThe Surfing Broom

So what kinds of problems come up?

Too many brooms at the same pool

Two Brooms politely waiting for each other to go first

A broom gets lost: Impossible to work out which pools have the right kind of water

It gets too slow for a broom get his water if there are lots of brooms there alreadyThe water keeps going off and need to be replaced by the water that complies with the new European Standard

What this course is about

Applications distributed across a number of computers

Maintaining your own well

Not principally a programming coures, but Java used for illustration

The rationale for using Java

PortableExhibits all the main features of object orientationHas hooks into the main distributed technologiesFree and widely available

Distributed system functions

Core functions

Core functions

Distributed functions

Core functions are those which are found in any type of application, maintaining the well

Distributed functions are those concerned with maintaining distributed system and controlling access (talking to the brooms)

Example (i) auction sitesAuctions either held in real-time or in elapsed timeUses the WebProfit made from commissions and also from banner adverts

Example (ii) search engines

Used to find information on the WebMany general purpose engines, for example Lycos, YahooMainly use automatic indexing, some use human indexersRevenue from advertising

Change notification sitesThe Web is incredibly dynamic: pages disappear or are updated very frequentlySuch sites inform webmasters when these events happenRevenues raised from charging for the service or banner adverts

Email providersProvide Web-based email servicesSometimes the service is tiered with the lower tier freeRevenues from banner advertising.One of the most popular applications

The main facilities of the Internet

The World Wide WebFTPEmail

Mailing listsNewsgroups

The World Wide Web

Browsers

Browsers

Browsers

Web server

The WebSimple but large distributed systemServers provide Web filesBrowsers consume and display Web files

Web documents expressed in HTMLTwo way communication, via formsExample of clients and servers

Issues in distributed application development (i)

Legacy technologySpace problemsStateless server dispensing static pagesSecurity and privacyProgramming and abstraction

Issues in distributed application development (ii)

TransactionsSpeed of development StandardsDesign

Legacy technologyThe initial design of the Web was simple: static pages and no dynamic content ChangedAddresses running out ChangingWeb protocol is stateless Changed

Security and privacyInternet is an open system.Architecture and protocols are publicGood effect is that errors can be spotted and rectified quicklyBad effect is that privacy can be compromised

How secure is the Internet?

In 1996 Dan Farmer, one of the leading members of the Internet security community, analysed a number of Internet sites using a tool known as SATAN which reports on security vulnerabilities. He discovered that out of the 2200 sites he accessed, 1700 were relatively easy to attack (77 per cent of the sites). This is a staggering figure; however, what makes it more staggering is the fact that Farmer chose sites which should have been neurotic about security, for example sites owned by banks, government agencies, insurance companies and credit card companies.

Speed of developmentFaster development times needed for Internet applicationsHence the need for OO languagesA potential use for patternsMore and more companies using rapid development methods

Problems with transactions

A transaction is applied to stored data and can alter the dataConcurrency problemsInconsistent update problemsData changed in the presence of failure

Distributed system designDesigning core functions is just as in conventional systemsHowever there are design issues concerned with:

ReliabilityTransmission mediaSpeed

Design

Client Client

Client

Server

Transmissionmedia can be slow

A server can malfunction

Transmission media can fail

Design issuesCoping with server failureCoping with transmission media failureCoping with slow transmission speeds such as those found in the InternetCoping with synchronicity

The Internet

The Internet is an open system

Details publicly availableA lot of software is freeLots of publicly available expertise available via such things as newsgroupsDangers with privacy

Implications of open systems

Wide variety of implementations, for example of TCP/IPCost of implementation lessHigh level of compatibilityWide variety of developers selling products

The First Problem we will address

How to make it clear what kinds of water you haveHow to get your data in a form that everybody can understand

What most data looks like now: HTML

<HTML><HEAD>

<TITLE> John’s Sheep Farm </TITLE></HEAD><BODY><H1> My Sheep Farm </H1>Hi I have a farm where I keep sheep. Sheep are lovely and woolly. So am I.<UL>

<LI> My favourite sheep is called Buttercup </LI><LI> My first sheep was called Betty. </LI><LI> I am a fanatical Welsh rugby supporter. </LI></UL>

</BODY></HTML>

Some Things to noticeThe tags come in pairsThe tags are only about formattingThere is no way to know that a browser should not be turn up this page for a query about the flowers called buttercups.

Anchors and linksHTML provides facilities whereby documents can link to other documents either on the same computer or on another oneUses anchorsClicking a link transfers to the new page

An example

<UL><LI> <A HREF = “http://www.SheepAreUs.com/home”> A good place

to buy sheep online </A> </LI></UL>

URLKnown either as Uniform Resource Locator or Universal Resource LocatorIs an address of a Web page or other resourceLinks can be web pages, mail, newsgroups, FTP etc

An example of a URL

http://www.open.ac.uk/staff/Darrel

Specifies Web page Specifies computer

Specifies locationof Web page

FormsHTML has facilities for making GUIs for form filling,m for exampleForms contain visual objects such as text fields, buttons, select boxes etc.When a form is completed data is sent to the Web server and a program executed

An example of an HTML form (i)

<FORM METHOD=”POST” ACTION=”/cgi-bin/Form1process”><P>

Please type your name below</P><P>

<INPUT TYPE=”TEXT” NAME=”nameField” MAXLENGTH=”30”></P><P>

Please type your address below</P><P>

<TEXTAREA NAME=”addField” ROWS=”5” COLS=”40”></TEXTAREA>

</P><P>

Male<INPUT TYPE=”RADIO”NAME=”maleButton”VALUE=”mButt”>

</P>

An example of an HTML form (ii)

<P>Female<INPUT TYPE=”RADIO”NAME=”femaleButton”

VALUE=”fButt”></P><P>  <INPUT TYPE=”SUBMIT”  VALUE=”Submit”></P></FORM>

Form contains two radio buttons, a text field and a text area

Our First Real Topic: XML

XMLExtensible—that’s what the X means

Not a markup language but a language for defining markup languages

Tags not about layout, but about meaning (semantics)

Rationale for XML

Difficulties with browser displayHTML non-standardDifficult to impossible to discern semantics from a markup language

Aims of the XML designers

Easy to use on the InternetCapable of supporting a large number of applicationsCompatible with SGMLShould not be complicated to develop XML processorsOnly a small number of optional facilitiesDocuments in XML should be easy to understandEditors should be capable of constructing HTML documents

XML as a central repository of data

Documentin XML

Spreadsheet

Web pages

Word processeddocument

Relationaldatabase

An example of a simple XML-based markup language

<PRODUCT><PRODUCTNAME> CoatBlue</PRODUCTNAME><PRODUCTPRICE> 34000</PRODUCTPRICE>..</PRODUCT> Similar to

HTML but contains semanticmarkers

An example of an XML definition

<?xml version = “1.0” encoding =”UTF-8"?><!DOCTYPE ENTRY[<!ELEMENT ENTRY ENTRYPAIR*><!ELEMENT ENTRYPAIR (NAME, DEFINITION)><!ELEMENT NAME (#PCDATA)><!ELEMENT DEFINITION (#PCDATA)>]>

Sequence of pairs consisting of a name and a definition.

XML used to define attributes

<!ELEMENT TOWN (COUNTY, POPULATION)><ATTLIST TOWN NAME CDATA #REQUIRED>

The element TOWN has an attribute NAMEwhich contains char data and is alwaysrequired

Processing XML documents (i)

Done via parsersParser can be conforming or non-conformingConforming checks everythingNon-conforming just makes rudimentary checksMost parsers conforming

Processing XML documents(ii)

Many parsers written in JavaParsers can be in-memory based: they build up a tree.Parsers can also be event-based: they trigger processing when some XML element is encountered

Event-based processing

public void startElement(String tagName){String currentTag = tagName;..}

Executed when a start element is encountered, for example <TOWN>. tagName assumes the valueof the tag name

An example of XML in action

Scaleable vector graphics (SVG)WWW standard Vector graphic standardAttempt to develop a standard for such graphicsCan be used for text searching

SVG source<SVG width = “3in” height = “2in”><DESC>This is a sample circle drawn for the book DistributedApplications and E-Commerce</DESC><G><CIRCLE style = “fill: red; stroke: black” cx = 100cy = 100 r = 100/></G></SVG>

Associated technologies

XHTML, a standard version of XMLXSL, a style sheet transformation technology used to convert XML source into some other form, for example rtfXSL formatting objects, transformation to text document