Rules and Tips for Good Web Programming (and Programming in General)

Slides:



Advertisements
Similar presentations
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Advertisements

ODBC and JDBC What are they – libraries of function calls that support SQL statements Why do we need them –Provide a way for an application to communicate.
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
Midterm Exam Chapters 1,2,3,5, 6,7 (closed book) March 11, 2014.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
Mark Dixon 1 09 – Java Servlets. Mark Dixon 2 Session Aims & Objectives Aims –To cover a range of web-application design techniques Objectives, by end.
CS320 Web and Internet Programming Java Beans and Expression Language (EL) Chengyu Sun California State University, Los Angeles.
Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Web Design & Development 1 Lec Web Design & Development 2 More on JDBC.
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
COMP 321 Week 4. Overview Normalization Entity-Relationship Diagrams SQL JDBC/JDBC Drivers hsqldb Lab 4-1 Introduction.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add.
Database Access Using JDBC BCIS 3680 Enterprise Programming.
JDBC CS 260 Database Systems. Overview  Introduction  JDBC driver types  Eclipse project setup  Programming with JDBC  Prepared statements  SQL.
Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-
JDBC Chapter 1 JDBC Introduction
Advanced Java Session 5 New York University School of Continuing and Professional Studies.
Chapter 14 Using JavaBeans Components in JSP Documents.
CS320 Web and Internet Programming Web Application and MVC Chengyu Sun California State University, Los Angeles.
CS422 Principles of Database Systems Stored Procedures and Triggers Chengyu Sun California State University, Los Angeles.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
CS320 Web and Internet Programming Database Access with JDBC Chengyu Sun California State University, Los Angeles.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
1 Workshop - ODFDOM Lars Behrmann Frank Meies Svante Schubert Sun Microsystems, Hamburg 1.
CS3220 Web and Internet Programming Introduction to Java Servlets
CS3220 Web and Internet Programming Database Access with JDBC
Chengyu Sun California State University, Los Angeles
Unit Testing.
CS320 Web and Internet Programming Database Access with JSTL SQL
CS320 Web and Internet Programming SQL and MySQL
CS320 Web and Internet Programming Database Access with JDBC
Java Servlets.
Pre-assessment Questions
Chengyu Sun California State University, Los Angeles
Monitoring Java Applications with JAMon
Some Tips for Using Eclipse
CS5220 Advanced Topics in Web Programming Spring – Web MVC
CS320 Web and Internet Programming Cookies and Session Tracking
CS320 Web and Internet Programming Expression Language (EL)
CS5220 Advanced Topics in Web Programming Angular – Routing
Java™ Web Application Development with Eclipse WTP - WTP Quick Tour
CS320 Web and Internet Programming Java Beans
CS320 Web and Internet Programming MVC Architecture
CS3220 Web and Internet Programming Cookies and Session Tracking
Objectives In this lesson you will learn about: Need for servlets
CS5220 Advanced Topics in Web Programming Spring – Web MVC
Java™ Web Application Development with Eclipse WTP - WTP Quick Tour
Java™ Web Application Development with Eclipse WTP - WTP Quick Tour
Chengyu Sun California State University, Los Angeles
CS3220 Web and Internet Programming Introduction to Java Servlets
CS3220 Web and Internet Programming SQL and MySQL
CS3220 Web and Internet Programming Expression Language (EL)
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
JDBC Example.
CS3220 Web and Internet Programming Cookies and Session Tracking
CS3220 Web and Internet Programming Expression Language (EL)
CS4961 Software Design Laboratory Understand Aquila Backend
Chengyu Sun California State University, Los Angeles
CS3220 Web and Internet Programming SQL and MySQL
CS3220 Web and Internet Programming About Data Models
CS3220 Web and Internet Programming Database Access with JDBC
CS3220 Web and Internet Programming JavaScript Basics
CS3220 Web and Internet Programming Database Access with JDBC
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Rules and Tips for Good Web Programming (and Programming in General) Chengyu Sun California State University, Los Angeles

Follow naming conventions Use descriptive names Start with Data Java model classes and table schemas Use package Follow naming conventions Use descriptive names The different between primitive types vs class types

One servlet (i.e. controller) per operation Identify operations Display Add Rename Delete One servlet (i.e. controller) per operation One view per operation except for form processing operations, in which case we need two: one form view, one result view

JDBC driver only needs to loaded once per project; it has to be loaded before other servlets (use loadOnStartup) Use Id, do not use Name Use PreparedStatement  it's safe, and more readable than string concatenation

Reuse code by refactoring them into their own classes/methods Pass data to JSP using Request Scope Do NOT use Application scope (i.e. getServletContext()) Avoid using Session scope for anything other than login/logout

Use SQL whenever possible Form processing operation Form view Result View After add a new folder Display the added folder Or Display the parent folder Redirect is a special view

Forward: pass data from controller to view Redirect: send the user to a different operation (controller) Use View Source Use the Debug feature in Eclipse