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.

In this case we'd store the string "17 18" in the group_membershipscolumn. This is known as a repeating group or a multivalued columnand it has the following problems:82• you might not have enough space if the number of values inthe column grows larger than anticipated• the combination of table name, column name, and key valueno longer specifies a datum• the basic INSERT, UPDATE, and SELECT operations arenot sufficient to manipulate multivalued columns• programmers' brains will have to adapt simultaneously tounordered data in table rows and ordered data inside amultivalued column• design opacity. If you use multivalued columns even once,people will never know what to expect when they look underthe hood of your design; did you use multiple tables toexpress a many-to-one relation or multivalued columns?To get the data model into First Normal Form, in which there are nomultivalued columns, you'd create a mapping table:create table user_group_map (user_id not null references users;user_group_id not null references user_groups;unique(user_id, user_group_id));Note that in Oracle the unique constraint results in the creation of anindex. Here it will be a concatenated index starting with the user_idcolumn. This index will make it fast to ask the question "To which groupsdoes User 37 belong?" but will be of no use in answering the question"Which users belong to Group 22?"A good general rule is that representing a many-to-one relationrequires two tables: Things A and Things B, where many Bs can beassociated with one A. Another general rule is that representing amany-to-many relation requires three tables: Things A, Things B, anda mapping table to associate arbitrary numbers of As with arbitrarynumbers of Bs.5.5 Derivable DataStoring users and groups in three tables seems as though it might beinefficient and ugly. To answer the question "To which groups doesNorman Horowitz belong" we must JOIN the following tables:users, user_groups, user_group_map:If nothing else, a knowledge sharing system provides a means <strong>for</strong>employees at the leaf nodes a hierarchy to converse. Consider theorganization depicted in Figure 1 below. Suppose that a worker inSingapore has a question that could be answered by a worker in DesMoines. The act of finding the coworker and getting assistancerequires going all the way the hierarchy to the chief executive inLondon and then back down a different path through the hierarchy toDes Moines. This bottleneck could be eliminated by eliminating thehierarchy. However, most organizations don't want to eliminate theirhierarchies. It is the hierarchy that enables the corporation to reducemanagement complexity by establishing profit-and-loss responsibilityat intermediate levels. Better to supplement the hierarchy with anin<strong>for</strong>mal mechanism by which the Singapore-based worker can ask<strong>for</strong> help and the Des Moines-based worker can offer it, i.e., aknowledge sharing system.**** insert drawing of corporate hierarchy ****Figure 1: Multinational corporations are organized around acommand-and-control hierarchy. This is good <strong>for</strong> assigning profitand-lossresponsibility but creates in<strong>for</strong>mation flow bottlenecks.Building a knowledge sharing system is one way to facilitatein<strong>for</strong>mation flow among the leaves of the tree.15.3 Exercise 1: Develop an OntologyThe American Heritage Dictionary defines ontology as "The branch ofmetaphysics that deals with the nature of being." Computer scienceresearchers speak of "an ontology" as a structure <strong>for</strong> knowledgerepresentation, i.e., the ontology constrains the kinds of in<strong>for</strong>mationthat we can record (you will be <strong>for</strong>given if you confuse this advancedComputer Science concept with mere data modeling).Your ontology will consist of class definitions and, because arelational database is the source of persistence behind your onlinecommunity, your implementation of this ontology will consist of SQLtable definitions, one table <strong>for</strong> each class. To assist you in developinga useful ontology <strong>for</strong> your community, here are a couple of examples.Example Ontology 1: Computer ScienceCorporations all have knowledge management systems even thoughgenerally they may not have any knowledge. Universities claim tohave knowledge and yet none have knowledge management267

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

Saved successfully!

Ooh no, something went wrong!