+ All Categories
Home > Documents > 15-415 Fall 2009 Recitation Homework 9 Building A Web Application Phase-I

15-415 Fall 2009 Recitation Homework 9 Building A Web Application Phase-I

Date post: 19-Jan-2016
Category:
Upload: paloma
View: 21 times
Download: 0 times
Share this document with a friend
Description:
School of Computer Science. 15-415 Fall 2009 Recitation Homework 9 Building A Web Application Phase-I. Leman Akoglu 11/4/2009. HW9 Outline. Building a simple Web application (CMUBook) using JSP 2 phases Phase I : design and documentation due 11/10  next Tue! hard copy in class - PowerPoint PPT Presentation
29
Leman Akoglu 11/4/2009 15-415 Fall 2009 Recitation Homework 9 Building A Web Application Phase-I School of Computer Science
Transcript
Page 1: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Leman Akoglu11/4/2009

15-415 Fall 2009 Recitation

Homework 9

Building A Web Application Phase-I

School of Computer Science

Page 2: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

HW9 OutlineBuilding a simple Web application

(CMUBook) using JSP2 phasesPhase I : design and documentation

due 11/10 next Tue!hard copy in class

Phase II : implementationdue 11/19 both hard copy in class and via email.

Page 3: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Database Design Methodology [N. Roussopoulos and R.T. Yeh]

Page 4: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Phase-I Phase-II

Page 5: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Recitations11/4 2:30pm-3:20pm DH 212211/4 3:30pm-4:20pm DH 2105 11/1011/11 2:30pm-3:20pm DH 212211/11 3:30pm-4:20pm DH 2105

11/18 2:30pm-3:20pm DH 212211/18 3:30pm-4:20pm DH 2105 11/19

Phase-1

Phase-2

Q&A

Send additional questions to [email protected]

Phase-1 due

Phase-2 due

Page 6: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Today’s OutlineHomework 9 description

Data requirementsFunctionality requirements

DeliverablesTop-level Information Flow Diagrams

(IFDs)Document formsEntities & RelationsSchema (in BCNF or 3NF)

Page 7: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Phase-I Phase-II

Page 8: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Homework 9 CMUBookA mini web application like FacebookUsers could upload/tag photos, add friends,

etc.

Tasks to implement1. Registration2. Login/Logout3. Photo Upload4. Photo Browsing5. Photo Tagging6. Profile Review7. Search by User Name8. Friendship Management9. Reporting

Page 9: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Phase-I Phase-II

Page 10: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

reg. form

T1-reg.

user rec.

Top level information flow diagram

System boundary

tasks

internal doc.s (db tables)

external doc.s(web forms)

Page 11: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

reg. form

More on top level diagram

login form

T2 - login

?

T1-reg.

user rec.

?

?

profile form

Page 12: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Phase-I Phase-II

Page 13: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Document + Task formsTask forms and task list

not required for this homework

Document forms and document list

• D1: registration form• D2: login form• D3: profile form• …• Dx: user record• …

internal

external

Page 14: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Document formsD1: registration

formlogin namepasswordname…

D3: profile form• name?List-of:

photo-id (URL) ?friend-id (login name) ?…

Dx: user recordlogin namepasswordname…

Page 15: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Phase-I Phase-II

Page 16: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

E-R diagram for CMUBook

user photo

login emailURL...

...owns

?-1 ?-1

passw

?-2

How about friendships, photo tags, …?

o ?-1: Specify cardinalitieso ?-2: Think about weak/strong entities

Page 17: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Relational schemauser( login, passw, name, email-add.) photo( URL, … ) ?….

SQL DDL statementscreate table user (login char(20), passw

char (20) NOT NULL (?), … );create table photo (URL char(200), … );

...

Page 18: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Phase-I Phase-II

Page 19: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Task emulation/pseudo-code

Task1: Registration read login, password, name and emailif ( login does not exist in ‘user’){ insert into user values

( :login, :password, :name, :email);} else{

print “error: login exists, choose another”} should be valid

SQL queries

Page 20: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

description

req. anal.

top level I.F.D.

sys. anal.

conc. mod. impl.+test.

task + doc forms.

schema.code.

task emul.

tests

user’s man.

pseudo-code

Phase-I Phase-II

Page 21: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Phase IIYou will develop

JSP pages that handle user interactionsProcessing logic written in Java classManipulating data in database, connect from

JSP to database using JDBC

Page 22: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Outline of the next recitationSchema outline

A Typical Web Application ArchitectureCMUBook architecture

Brief introduction to JSPJSP mini demo register.jspSession and cookie management login.jspExceptions

MVC (Model-View-Controller) pattern (optional) Better Software Design

Page 23: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Users

Web app

(JSP, ASP, PHP)

Apache, Tomcat,

Windows IIS

Web Server

Java Virtual Machine

Web app backend

component

Backend Server

Database

Server

Client

Web Application ArchitectureMulti-tier architecture

http e.g. RMI

JDBC

ODBC

Page 24: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Homework 9:CMUBook architecture

Tomcat 5.5

CMUBook

JSP, Java

Web Servernewcastle.db.cs.cmu.edu

PostgreSQL

Database Servernewcastle.db.cs.cmu.e

du

hw9 database

Client

Browser

User

http

JDBC

Page 25: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

CMUBook architectureRegistration example –register.jsp

Tomcat 5.5

CMUBook

JSP, Java

Web Servernewcastle.db.cs.cmu.edu

PostgreSQL

Database Server

newcastle.db.cs.cmu.edu

hw9 database

Client

Browser

User

http://newcastle.db.cs.cmu.edu:8080/lakoglu415/register.jsp

register.jsp

html page with input FORM

Submit FORM with login, name, password and email

JDBC exec. queryjava.sqlStatement.executeUpdate()

JDBC insert succeeds

Html page with successful info

1

2

3

4

5

6

Page 26: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I
Page 27: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I
Page 28: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

Better Software Design? Design Pattern

Design Patterns: Elements of Reusable Object-Oriented Software, Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides

Thinking in Patterns (http://www.mindviewinc.com/downloads/TIPatterns-0.9.zip)

Design Pattern for Web App:MVC pattern (Model – View – Controller)Basic idea: break software functionalities and

interfacesTool: struts

(Optional)

Page 29: 15-415 Fall 2009  Recitation Homework 9  Building A Web Application  Phase-I

MVC

(Optional)


Recommended