create view tanganyikan_group_membersasselect * from userswhere exists (select 1from user_group_map, user_groupswhere user_group_map.user_id =users.user_idand user_group_map.user_group_id =user_groups.user_group_idand group_name = 'Tanganyikans');or, supposing that you know that you're going to need this in<strong>for</strong>mationalmost every time that you query the USERS table?create view users_augmentedasselectusers.*,(select count(*)from user_group_map ugm, user_groups ugwhere users.user_id = ugm.user_idand ugm.user_group_id = ug.user_group_idand ug.group_name = 'Tanganyikans') astanganyikan_group_membershipfrom userswhere exists (select 1from user_group_map, user_groupswhere user_group_map.user_id =users.user_idand user_group_map.user_group_id =user_groups.user_group_idand group_name = 'Tanganyikans');This results in a virtual table containing all the columns of users plusan additional column called tanganyikan_group_membership that is 1<strong>for</strong> users who are members of the group in question and 0 <strong>for</strong> userswho aren't. In Oracle, if you want the column instead to bear thestandard ANSI boolean data type values, you can wrap the DECODEfunction around the query in the select list:decode(select count(*) ..., 1, 't', 0, 'f') astanganyikan_group_membership_pNotice that we've added an "_p" suffix to the column name, harkingback to the Lisp programming language in which functions that couldreturn only boolean values conventionally had names ending in "p".If you're programmingone Web page at a time,you can switch to theLanguage du Jour insearch of higherproductivity. But youwon't achieve significantgains unless you quitwriting code <strong>for</strong> onepage at a time. Thinkabout ways to writedown a machinereadabledescription ofthe application and userexperience, then let thecomputer generate theapplicationautomatically.One thing that we hopeyou've learned duringthis course is the valueof testing with users anditerative improvement ofan application. If anapplication is machinegeneratedyou can test itwith users, edit thewould require 4 programmers working fulltime<strong>for</strong> 6 weeks. What's worse, in looking atthe specs we decided that the realizedsystem would be unusably complex,especially <strong>for</strong> busy salespeople.Instead of blindly cranking out the code, weassigned only one programmer to theproject, our friend Tracy Adams. She turnedthe human-readable design notebooks intomachine-readable database metadata tables.Tracy proceeded to build a program-to-writethe-programwith no visible results. Siemensand BCG were nervous until Week 4 whenthe completed system was available <strong>for</strong>testing."How do you like it?" we asked. "This is theworst in<strong>for</strong>mation system that we've everused," they replied. "How do you compare itto your specs?" we asked. "Hmmm... maybewe should simplify the specification," theyreplied.After two more iterations the system, dubbed"ICN Sharenet" was launched on time andwas adopted quickly, credited by Siemenswith $122 million in additional sales duringits first year of operation.specification based on their feedback, and regenerate the applicationin a matter of minutes, ready <strong>for</strong> a new test.We're going to explore metadata, data about the data model, andautomatic code generation in the problem domain of knowledgemanagement.15.1 What is "Knowledge Management"?A knowledge management or knowledge sharing system is a multiuserin<strong>for</strong>mation system enabling users to share knowledge about ashared domain of expertise or inquiry. What is "knowledge"? Oneway to answer this question is to spend 10 years in a universityphilosophy department's epistemology group. From the perspectiveof a relational database management system, however, it may beeasier to define knowledge as "text, authored by a user of thecommunity, to which the user may attach a document, photograph, or84265
Chapter 15Metadata (and Automatic CodeGeneration)In this section you'll build a machine-readable representation of therequirements of an application and then build a computer program togenerate the computer programs that implement that application.We'll treat this material in the context of building a knowledgemanagement system, one of the most common types of onlinecommunities, and try to introduce you to terminology used bybusiness people in this area.Organizations have complex requirements <strong>for</strong> their in<strong>for</strong>mationsystems. A period of rapid economic growth can result in insaneschedules and demands that a new in<strong>for</strong>mation system be readywithin weeks. Finally, organizations are fickle and have nocompunction about changing the requirements mid-stream.Technical people have traditionally met these challenges ... byarguing over programming tools. The data model can't represent thein<strong>for</strong>mation that the users need, the application doesn't do what whatthe users need it to do, and instead of writing code, the "engineers"are arguing about Java versus Lisp versus ML versus C# versus Perlversus VB. If you wantto know why computerprogrammers get paidless than medicaldoctors, consider thesituation of two traumasurgeons arriving at anaccident scene. Thepatient is bleedingprofusely. If surgeonswere like programmers,they'd leave the patientto bleed out in order tohave a really satisfyingargument over themerits of two differentkinds of tourniquet.264War StoryThe authors were asked to help Siemens andBoston Consulting Group (BCG) realize aknowledge sharing system <strong>for</strong> 17,000telephone switch salespeople spread among84 countries. This was back in the 1990swhen (a) telephone companies wereexpanding capacity, and (b) corporationsinvested in in<strong>for</strong>mation systems as a way ofbeating competitors.Siemens had spent 6 months working with aWeb development contractor that was expertin building HTML pages but had troubleprogramming SQL. They'd promised tolaunch the elaborately specified system 6weeks from our first meeting. We concludedthat many of the features that they wantedcould be adapted from the source codebehind the photo.net online community butthat adding the "knowledge repository"Keep in mind that data model complexity can always be tamed withviews. Note, however, that views are purely syntactic. If a query isrunning slowly when fed directly to the RDBMS it won't run any fastersimply by having been renamed into a view. Were you to have10,000 members of a group, each of whom was requesting one pageper second from the group's private area on your Web site, doing 3-way JOINs on every page load would become a substantial burdenon your RDBMS server. Should you fix this by denormalizing, thusspeeding up queries by perhaps 5X over a join of indexed tables?No. Speed it up by 1000X by caching the results of authorizationqueries in the virtual memory of the HTTP server process.Clean up ugly queries with views. Clean up ugly per<strong>for</strong>manceproblems with indices. If you're facing Yahoo! or Amazon levels ofusage, look into unloading the RDBMS altogether with applicationlevelcaching.5.6 Access Control and ApprovalSuppose that you are building a corporate knowledge sharing site.You might decide to place the server on the public <strong>Internet</strong> tofacilitate employee access while at home or traveling. Perhaps someclose collaborators within other organizations will be allowed access.However, you won't want random people registering at the site andgetting immediate access. Each new user should probably have to beapproved by an administrator.Or perhaps you're building a public online learning community. Youwant users to be identified and accountable at the very least to their<strong>Internet</strong> Service Provider. So you'll want to limit access to only thoseregistrants who've verified receipt of an email message at theaddress that they supplied upon registering. You may also want toreject registration from users whose only email address is athotmail.com or a similar anonymous provider.A community may need to change its policies as the membershipgrows.One powerful way to manage user access is by modeling userregistration as a finite-state machine:85
- Page 1 and 2:
SoftwareEngineering forInternetAppl
- Page 3 and 4:
Signature: ________________________
- Page 5 and 6:
end-users. We use every opportunity
- Page 7 and 8:
• availability of magnet content
- Page 9 and 10:
• we want to see if a student is
- Page 11 and 12:
you supply English-language queries
- Page 13 and 14:
What to do during lecturesWe try to
- Page 15 and 16:
The one-term cram courseWhen teachi
- Page 17 and 18:
332• spend a term learning how to
- Page 19 and 20:
Once we've taught students how to b
- Page 21 and 22:
has permission to perform each task
- Page 23 and 24:
UDDIUnixcustomer's credit card. If
- Page 25 and 26:
thousands of concurrent users. This
- Page 27 and 28:
OraclePerlnamed XYZ" without the pr
- Page 29 and 30:
LDAPLinuxbits per color, a vastly s
- Page 31 and 32:
FilterFirewallFlat-fileGIF318functi
- Page 33 and 34: when there is an educational dimens
- Page 35 and 36: system. The authors of the core pro
- Page 37 and 38: Sign-OffsTry to schedule comprehens
- Page 39 and 40: scheduling goals that both you and
- Page 41 and 42: Client Tenure In Job (new, mid-term
- Page 43 and 44: ReferencesEngagement ManagementSQL*
- Page 45 and 46: Decision-makers often bring senior
- Page 47 and 48: presentation to a panel of outsider
- Page 49 and 50: 300always been written by programme
- Page 51 and 52: 17.3 Professionalism in the Softwar
- Page 53 and 54: Try to make sure that your audience
- Page 55 and 56: Chapter 17WriteupIf I am not for my
- Page 57 and 58: Suppose that an RDBMS failure were
- Page 59 and 60: analysis programs analyzing standar
- Page 61 and 62: at 9 hours 11 minutes 59 seconds pa
- Page 63 and 64: found" will result in an access log
- Page 65 and 66: 15.18 Time and MotionThe team shoul
- Page 67 and 68: select 227, 891, 'algorithm', curre
- Page 69 and 70: create table km_object_views (objec
- Page 71 and 72: • object-create• object-display
- Page 73 and 74: The trees chapter of SQL for Web Ne
- Page 75 and 76: );274-- ordering within a form, low
- Page 77 and 78: and start the high-level document f
- Page 79 and 80: Example Ontology 2: FlyingWe want a
- Page 81 and 82: systems. What would a knowledge man
- Page 83: spreadsheet". Other users can comme
- Page 87 and 88: {site url}{site description}en-usCo
- Page 89 and 90: drawing on the intermodule API that
- Page 91 and 92: At this point you have something of
- Page 93 and 94: • description• URL for a photo
- Page 95 and 96: Here's a raw SOAP request/response
- Page 97 and 98: Chapter 14Distributed Computing wit
- Page 99 and 100: conduct programmer job interviews h
- Page 101 and 102: Most admin pages can be excluded fr
- Page 103 and 104: content that should distinguish one
- Page 105 and 106: Chapter 13Planning ReduxA lot has c
- Page 107 and 108: the Internet-specific problem of no
- Page 109 and 110: wouldn't see these dirty tricks unl
- Page 111 and 112: 12.8 Exercise 4: Big BrotherGeneral
- Page 113 and 114: than one call to contains in the sa
- Page 115 and 116: A third argument against the split
- Page 117 and 118: way 1 1/16One might argue that this
- Page 119 and 120: absquatulate 612bedizen 36, 9211cry
- Page 121 and 122: What if the user typed multiple wor
- Page 123 and 124: Chapter 12S E A R C HRecall from th
- Page 125 and 126: long as it is much easier to remove
- Page 127 and 128: features that are helpful? What fea
- Page 129 and 130: made it in 1938)? Upon reflection,
- Page 131 and 132: environment, we identify users by t
- Page 133 and 134: those updates by no more than 1 min
- Page 135 and 136:
Balancer and mod_backhand, a load b
- Page 137 and 138:
translation had elapsed--the site w
- Page 139 and 140:
It seems reasonable to expect that
- Page 141 and 142:
11.1.5 Transport-Layer EncryptionWh
- Page 143 and 144:
such as ticket bookings would colla
- Page 145 and 146:
give their site a unique look and f
- Page 147 and 148:
It isn't challenging to throw hardw
- Page 149 and 150:
Chapter 11Scaling GracefullyLet's l
- Page 151 and 152:
10.15 Beyond VoiceXML: Conversation
- Page 153 and 154:
Consider that if you're authenticat
- Page 155 and 156:
In this example, we:194• ask the
- Page 157 and 158:
As in any XML document, every openi
- Page 159 and 160:
(http://www.voicegenie.com). These
- Page 161 and 162:
Chapter 10Voice (VoiceXML)questions
- Page 163 and 164:
9.15 MoreStandards information:•
- Page 165 and 166:
9.14 The FutureIn most countries th
- Page 167 and 168:
9.10 Exercise 7: Build a Pulse Page
- Page 169 and 170:
9.6 Keypad HyperlinksLet's look at
- Page 171 and 172:
text/xml,application/xml,applicatio
- Page 173 and 174:
Protocol (IP) routing, a standard H