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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.11 Exercise 3Build the basic user registration and login pages. Use HTTP cookiesto make the rest of the semester's work easier.Questions: Can someone sniffing packets learn your user'spassword? Gain access to the site under your user's credentials?What happens to a user who <strong>for</strong>gets his or her password?5.12 Exercise 4Build the site administrator's pages <strong>for</strong> working with users. The siteadministrator should be able to (1) see recently registered users, (2)look up a particular user, (3) exclude a user from the site, and (4) seecurrent and historical statistics on user registration.Questions: How can the administrator control who is permitted toregister and use the site? What email notification options does thesite administrator have that relate to user registration?5.13 Exercise 5Look at your tables again <strong>for</strong> referential integrity constraints andquery per<strong>for</strong>mance. How long will it take to look up a user by emailaddress? What if this email address is capitalized differently fromwhat you've stored in the database? Is it possible to have two userswith the same email address? [Note that by <strong>Internet</strong> standards alowercase email address or hostname is the same as an uppercaseemail address or hostname.]Many Web applications contain content that can only be viewed bymembers of a specific user group. With your data model, how manytable rows will the RDBMS have to examine to answer the question"Is User #541 a member of Group #90"? If the answer is "every rowin a big table", i.e., a sequential scan, what kind of index could youadd to speed up the query?5.14 More• SQL <strong>for</strong> Web Nerds, data modeling chapter, athttp://philip.greenspun.com/sql/data-modeling• <strong>for</strong> a discussion of indices, see SQL <strong>for</strong> Web Nerds, tuningchapter, at http://philip.greenspun.com/sql/tuningA good rule of thumb is that every table you add to your data modelimplies roughly 5 user-accessible URLs and 5 administrative URL.So far we're up to 4 user pages and if you were to launch this featureyou'd need to build some admin pages.14.4 Exercise 3: Encouraging Searching Be<strong>for</strong>eAsking and the Google APIsA major challenge threatening online communities is the clutter ofrecurring questions and the ef<strong>for</strong>t of pointing those who ask them tothe FAQ or the search engine. An existing content item on yourserver or elsewhere on the <strong>Internet</strong> might not provide a completeanswer to Joe Newbie's question but reading it would perhaps causehim to focus his query in a different direction.In this exercise you'll create an alternative post confirmation processthat will entail writing two new Web scripts, the search capabilitiesthat you developed in the Search chapter(http://philip.greenspun.com/seia/search), and the the Google WebAPIs service (http://www.google.com/apis/). The goal is to put someinternal and external links in front of Joe Newbie and encourage himto look at them be<strong>for</strong>e finalizing his question <strong>for</strong> presentation to theentire community.Your new post confirmation process should be invoked only <strong>for</strong>questions that start a discussion thread, not <strong>for</strong> answers to aquestion. Our experience with online communities is that it is moreimportant to moderate the questions that determine what will bediscussed rather than individual answers.If your current post confirmation page is at /<strong>for</strong>um/confirm wesuggest adding a -query suffix <strong>for</strong> your new script, e.g.,/<strong>for</strong>um/confirm-query. This page should have the following<strong>for</strong>m:1. at the top, the user's question as it will appear in the <strong>for</strong>um,with "Confirm" and "Edit" buttons underneath2. the top 5-10 matches among the site's articles and existingdiscussion <strong>for</strong>um postings that match the user's question ina full-text search (feed the one-line summary or perhaps theentire question to your local search engine)3. the top 5-10 matches in the Google database <strong>for</strong> the user'squestion, again using the user's question as the Googlequery string92257

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

Saved successfully!

Ooh no, something went wrong!