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.

Here's a raw SOAP request/response pair <strong>for</strong> a hypothetical "who'sonline" service that returns in<strong>for</strong>mation about users who have beenactive in the last N seconds:Request (plus whitespace <strong>for</strong> readability)POST /services/WhosOnline.asmx HTTP/1.1Host: somehostContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://jpfo.org/WhosOnline"600Response (plus whitespace <strong>for</strong> readability)HTTP/1.1 200 OKContent-Type: text/xml; charset=utf-8Content-Length: lengthEve2546.1 A Simple Data Model <strong>for</strong> ArticlesHere's a very basic data model <strong>for</strong> storing articles:create table articles (article_id integer primary key,-- who contributed this and whencreation_user not null references users,creation_date not null date,-- what language is this in?-- visit http://www.w3.org/International/O-charset-lang-- to see the allowable 2-character codes-- (en is English, ja is Japanese)languagechar(2) references language_codes,-- could be text/html or text/plain or-- some sort of XML documentmime_type varchar(100) not null,-- will hold the title in most casesone_line_summary varchar(200) not null,-- the entire article; 4 GB limitbody clob);Should all articles in the database be shown to all users? Perhaps itwould be nice to have the ability to store an article and hold it <strong>for</strong>editorial examination:create table articles (article_id integer primary key,creation_user not null references users,creation_date not null date,languagechar(2) references language_codes,mime_type varchar(100) not null,one_line_summary varchar(200) not null,body clob,editorial_status varchar(30)check (editorial_status in('submitted','rejected','approved','expired')));Do you trust all the programmers in your organization to remember toinclude a where editorial_status = 'approved' clause inevery script on the site? If not, perhaps it would be better to renamethe table altogether and build a view <strong>for</strong> use by applicationprogrammers:create table articles_raw (article_id integer primary key,...editorial_status varchar(30)check (editorial_status in95

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

Saved successfully!

Ooh no, something went wrong!