13.07.2015 Views

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

What if the user typed multiple words? The queryselect *from contentwhere upper(body) like upper('%running shoes%')would not pick up a message that contained the phrase "shoes <strong>for</strong>running". Instead we'll need multiple where clauses:select *from contentwhere upper(body) like upper('%running%')and upper(body) like upper('%shoes%')This AND clause isn't quite right. If there are lots of documents thatcontain both "running" and "shoes", these are the ones that we'd liketo see. However, if there aren't any rows with all query terms weshould probably offer the user rows that contain some of the queryterms. We might need to use OR, a scoring function, and an ORDERBY so that the rows containing both query terms are returned first.There are some deeper problems with the Caveperson SQLProgrammer approach to full-text search. Suppose that a messagecontains the phrase "My brother-in-law Billy Bob ran 20 milesyesterday" but not the word "running". Or a message contains thephrase "My cousin Gertrude runs 15 miles every day". These shouldbe returned as relevant to the query "running" but the LIKE clausewon't do the job. What is needed is a system <strong>for</strong> stemming both thequery terms and the indexed terms: "running", "runs", and "ran"would all be bashed down to the stem word "run" <strong>for</strong> indexing andretrieval.What about a message saying "I attended the 100th anniversaryBoston Marathon"? The LIKE query won't pick that up. What isneeded is a system <strong>for</strong> expanding queries through a thesauruspowerful enough to make the connection between "running" and"marathon".12.2 What's Wrong with SQL (Per<strong>for</strong>mance)Let's return to the simplest possible LIKE query:select *from contentwhere body like '%running%'After you've got a few articles in, step back and ask the followingquestions:• Is this data model working?• Is it taking a reasonable number of clicks to get somecontent live?• Do the people who need to approve new content have aneasy way of figuring out what needs approval and what hasbeen approved or rejected already? Must those editorscome to site every few hours and check or will they getemail alerts when new content needs review?A skeletal implementation should have stable and consistent URLs,i.e., the home page should be just the hostname of the server andfilenames should be consistent. If you haven't had a chance to makeabstract URLs work (see the "Basics" chapter), this is a good time todo it. Every page should have a descriptive title so that the browser'sBack button and bookmarks ("favorites") are fully functional. Everypage should have a "View Source" link at the bottom and a way tocontact the persons responsible <strong>for</strong> page function and content. Somesort of consistent navigation system should be in place (also seebelow). The look and feel of a skeletal implementation will be plainbut it need not be ugly or inconsistent. Look to Google <strong>for</strong> inspiration,not the personal home pages of fellow students at your university.6.17 Look and FeelAt this point you have some content on your server. It is thus possibleto begin experimenting with the look and feel of HTML pages. A goodplace to start is with the following issues:• space• time• words• colorScreen SpaceIn the 1960s a computer user could tap into a 1/100th share of acomputer with 1 MB of memory and capable of executing 1 millioninstructions per second, viewing the results on a 19-inch monitor. In2002, a computer user gets a full share of a computer with 1000 MBof memory (1 GB) and capable of executing 2 billion instructions persecond. This is a 100,000-fold improvement in available computing228121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!