cs 160: software engineering october 8 class meeting department of computer science san jose state...
TRANSCRIPT
CS 160: Software EngineeringOctober 8 Class Meeting
Department of Computer ScienceSan Jose State University
Fall 2014Instructor: Ron Mak
www.cs.sjsu.edu/~mak
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
2
Midterm Review
What is software engineering?
Complexity and change Collaboration, communication, and coordination
Processes and methodologies_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
3
Midterm Review
Web application architecture
Client-server Static and dynamic web pages
Web development tools and technologies
Tomcat and NetBeans Servlets, JSPs, and JavaBeans MySQL relational database manager
_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
4
Midterm Review, cont’d
Servlets
Application logic Redirection to other servlets or to JSPs
JavaServer Pages (JSP)
Translated to servlets by Tomcat_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
5
Midterm Review, cont’d
Deploying web applications (.war files)
Manual deployment to Tomcat Tomcat web application manager Development and deployment with NetBeans
_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
6
Midterm Review, cont’d
Project phases
Waterfall model
Agile software development_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
7
Midterm Review, cont’d
Requirements
Elicitation Functional and nonfunctional
Use cases
UML use case diagrams Use case descriptions
_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
8
Midterm Review, cont’d
Version control system
Git File states Clone, push, pull Add, commit Conflict resolution GitHub SmartGit
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
9
Midterm Review, cont’d
Conceptual design
Problem statement Product objectives and features Major modules
_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
10
Midterm Review, cont’d
Analysis model
Functional model Analysis object model Dynamic model
System design
Subsystem decomposition, partitioning, and layering Framework classes and the initial thread of control Loose coupling vs. high cohesion
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
11
Midterm Review, cont’d
Model-View-Controller architecture
Controller (servlets) View (JSPs) Model (JavaBeans) objects Loose coupling and parallel development
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
12
Midterm Review, cont’d
Server-side architecture
Multilayered Data access layer
Unified Modeling Language (UML)
Package, class, and sequence diagrams Aggregations, compositions, and inheritance Attributes and methods
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
13
Midterm Review, cont’d
Data repository
Data independence, redundancy, inconsistency, access, disparity, concurrency, security, and integrity
Data modeling
Conceptual, logical, and physical models Entities and relationships One-to-one, one-to-many, many-to-many Normalization: 1NF and 2NF ER diagrams
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
14
Midterm Review, cont’d
MySQL relational database management system (RDBMS) Command-line interface
SQL
Create and drop databases and tables Query tables Joining tables Insert, update, and delete record
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
15
Midterm Review, cont’d
MySQL Workbench
View and manipulate table data EER diagrams Forward and reverse engineering
_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
16
Midterm Review, cont’d
JDBC Java connection to a database
connection pool
Statements and prepared statements Query, insert, update, delete records
Result sets Object-relational mapping
JavaBeans
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
17
Example Midterm Questions
Briefly describe the contents of each of the following:
Requirements specification Software prototype Conceptual design Design document
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
18
Example Midterm Questions, cont’d
Consider the use case where a user moves a file from one directory into another within the file system. Suppose you implemented it with a graphical user interface (GUI) based on the model-view-controller (MVC) architecture. The user does the file move by dragging the image of a document on the screen with the mouse from one folder image into another. Identify the model, the view, and the controller objects. Draw a UML sequence diagram of the interaction
described by this use case.
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
19
Example Midterm Questions, cont’d
Model
File system components Physical files and directories that exist on disk
View
GUI objects Folders and documents as shown on the screen
_
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
20
Example Midterm Questions, cont’d
Controller
The interface (“bridge”) between the GUI and the file system.
The code that translates the GUI actions to operations on the underlying file system._
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
21
Example Midterm Questions, cont’d
User
SourceFolder
GUI-FSBridge
FileSystem
DestinationFolder
select document
send move commandwith source file path anddestination directory path
confirm file move
confirm selection
end dragsend destination folder info
detach documentfrom source folder
send source folder and source document infostart drag
confirm file movedisplay document in destination folder
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
22
Example Midterm Questions, cont’d
Suppose a teaching assistant for this CS 160 class wanted to build a relational database to keep track of the project teams. His first attempt at the database consists of a single table, as shown in the ER diagram.
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
23
Example Midterm Questions, cont’d
For each of the following queries, either write the SQL statement to perform the query based on this database, or explain why the query would be difficult to do.
What are the name and URL of team Alpha’s product?
SELECT product_name, product_URLFROM teamWHERE team_name = ‘Alpha’
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
24
Example Midterm Questions, cont’d
Who’s on team Beta?
Which team is Mary Jones on and what is her project grade?
Difficult (tedious, at least) to do because of the repeated student fields. Each first name/last name pair would need to be listed separately in the SELECT clause.
Also difficult to do because the test for Mary Jones would have to be duplicated for each student in the row and then OR’d together.
Computer Science Dept.Fall 2014: October 8
CS 160: Software Engineering© R. Mak
25
Example Midterm Questions, cont’d Normalize to 2NF the project
team database. Remember that each student on a particular project team will receive the same project grade.
PK
FK
PK
FK