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.

and start the high-level document <strong>for</strong> this module with (a) a statementof purpose <strong>for</strong> the subsystem, and (b) a list of object types,housekeeping elements shared among types, and type-specificelements.For ease of evaluation and interaction with your classmates, wesuggest placing the user pages at http://yourservername/km/.15.4 Exercise 2: Design a Metadata Data ModelThe document that you wrote in the preceding exercise is a goodbasis <strong>for</strong> discussion among your team members, the client, andteaching assistants. However it is not machine-readable. In theorynothing would be wrong with developing a machine-readablemetadata repository in a tab-separated file system file, to be editedwith a text editor. In practice, however, systems are cleaner whenthere are fewer mechanisms underneath. Thus far your primarysource of persistence has been the relational database managementsystem so you might as well use that <strong>for</strong> your metadata repository aswell. At the very least, the database is where a programmer new tothe project would expect to find the metadata.Here's an example SQL data model <strong>for</strong> a metadata repository:-- note that this is designed <strong>for</strong> the Oracle 8i/9i RDBMS-- we'll have one row in this table <strong>for</strong> every object type-- and thus <strong>for</strong> every new SQL table that gets defined; an-- object type and its database table name are the same;-- Oracle limits schema objects to 30 characters and thus-- we limit a table_name to 21 characters so that we can-- have some freedom to create schema objects whose names-- are prefixed with an object type);-- make it fast to get all extra fields-- <strong>for</strong> a particular usercreate index users_extra_info_by_user onusers_extra_info(user_id);Here is a example of how such a data model might be filled:users tableUser_id first_names last_name email password1 Wile E. Coyote supergenius@yahoo.com IFUx42bQzgMjEuser_info_id user_id field_nameusers_extra_info tablefield_typevarchar_value1 1 birthdate date -- --2 1 biography blob_text --3 1aim_screen_nameblob_valueCreatedby ChuckJones...string iq207 -- --4 1 annual_income number 35000 -- --date_value1949-09-17---- a "pretty name" is a synonym used when presenting-- pages to users; the prettiness could be as simple as-- replacing underscores with spaces or spelling out-- abbreviations;-- e.g., <strong>for</strong> an object type of "airplane_design", the-- pretty <strong>for</strong>m might be "airplane design", and-- pretty_plural "airplane designs"create table km_metadata_object_types (table_name varchar(21) primary key,pretty_name varchar(100) not null,pretty_plural varchar(100));27277

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

Saved successfully!

Ooh no, something went wrong!