Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz.

Slides:



Advertisements
Similar presentations
Adding Dynamic Content to your Web Site
Advertisements

DT228/3 Web Development WWW and Client server model.
2 Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how statecharts can be used to describe system behaviors  Use statecharts.
Java, Access, SQL, HTML. Three-tier architecture involves: Client - Browser Server - Tomcat Database - Access - Server-side language - JSP could just.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
DT211/3 Internet Development Application Internet Development Application.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
Introduction to Web Interface Technology (CSE2030)
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
LYU9901-Travel Net LYU9901-Travel Net Supervisor: Prof. Michael R. Lyu Students: Ho Chi Ho Malcolm Lau Chi Ho Arthur (Presentation on )
Apache Tomcat Server Typical html Request/Response cycle
Java Server Pages Russell Beale. What are Java Server Pages? Separates content from presentation Good to use when lots of HTML to be presented to user,
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Java database Programming JDBC Trademarked name of a Java API that supports Java programs that access relational databases Stand for Java DataBase Connectivity.
Three-Tier Architecture Oracle DB Server Apache Tomcat App Server Microsoft Internet Explorer HTML Tuples HTTP Requests JDBC Requests Java Server Pages.
Enterprise/Server-side Java Slide edited by NAS Introduction Welcome! As usual the module lasts for 12 weeks with the last.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
UNIT-V The MVC architecture and Struts Framework.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Thursday, October 18, 2012 Session 7: PHP.
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
Chapter 1: Introduction to Web
Server-side Scripting Powering the webs favourite services.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
AJAX Making Dynamic Web pages more Dynamic Jim Hendricks April 25th, 2006.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
MySQL, Java, and JDBC CSE 3330 Southern Methodist University.
JDBC Tutorial MIE456 - Information Systems Infrastructure II Vinod Muthusamy November 4, 2004.
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
 What software components are required?  How do I install the Oracle JDBC driver?  How do I connect to the database?  What form is the data in and.
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.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 32.1 Reviewing the Bookstore Application 32.2.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Chapter 6 Server-side Programming: Java Servlets
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
JSP program that interacts with HTML form & Access Data Base.
Accessing Database using JDBC. JDBC Objectives Gain basic knowledge of Java JDBC Become familiar with the basics of interacting with a database using.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Programming Brian Toone 8/27/2014. Outline for today 1.Understanding the architecture of the web 2.Overview of programming languages – Client-side.
Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Leman Akoglu 11/11/ Fall 2009 Recitation Homework 9 Building A Web Application Phase-II School of Computer Science.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 31.1 Reviewing the Bookstore Application 31.2.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
Interactive Web Tehcnologies Teppo Räisänen LIIKE/OAMK 2011.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
OOSSE Week 7 Java Server Pages Format of lecture: Introduction What are Java Server Pages? (JSPs) What do you need to run JSPs? Demo of an example of a.
Vakgroep Informatietechnologie – Onderzoeksgroep (naam) Web Centric Design of Distributed Software.
Apache Struts Technology A MVC Framework for Java Web Applications.
JSP/Database Connectivity Instructor: Dr. M. Anwar Hossain.
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.
Java Access to RDB Relational databases (RDBs) dominate today, due to:
CS320 Web and Internet Programming Database Access with JDBC
PHP / MySQL Introduction
Lecture 1: Multi-tier Architecture Overview
School of Computer Science
Presentation transcript:

Domain Driven Web Development With WebJinn Sergei Kojarski College of Computer & Information Science Northeastern University joint work with David H. Lorenz

Outline Background Overview Problem Solution Conclusion Future work

Web Application Web App Web App ClientHTTPServer BrowserResource An HTTP gateway to a server–side resource HTTP Request/Response model Converts between HTTP and Resource termsBACKGROUND

Web Development Written in two programming languages: Functionality (e.g., Java, C, Perl) Presentation (e.g., XML, HTML)BACKGROUND

Theory and Practice Well-understood Simple functionality Interactions patternsBACKGROUND Difficult to create Complicated implementations No reusable components ConceptState of the art

Schema HTTP Resource Schema Functionality server-side operations Presentation HTML response Control high-level control-flow Functionality Presentation Control <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select name, ,message from guestbook");%> Visitor: '> Guest book is empty. <%} } finally {conn.close();} } catch (Exception e) {%> Server error: The Problem: Tangling and Scattering page code example: name message Visitor: OVERVIEW OVERVIEW

Server error: Server error: Separation of concerns <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { PreparedStatement pst = conn.prepareStatement( (“insert into guestbook (name, ,message) values (?,?,?)”); pst.setString(1,request.getParameter(“name”); pst.setString(2,request.getParameter(“ ”); pst.setString(3,request.getParameter(“message”); pst.execute(); %> Message was successfully added } finally {conn.close();} } catch (Exception e) {%> <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select name, ,message from guestbook");%> Visitor: '> Guest book is empty. <%} } finally {conn.close();} } catch (Exception e) {%> New Message Your Name Message select.jspdoInsert.jsp insertForm.jsp name message name message pst.setString(1,request.getParameter(“name”); Your Name pst.setString(1,request.getParameter(“ ”); pst.setString(1,request.getParameter(“message”); Message ?,?,? Visitor: Main contribution: schema concern modularization OVERVIEW OVERVIEW

Outline Background Overview Problem Solution Conclusion Future work

Example:Guestbook PROBLEM PROBLEM

Example: Guestbook Typical client-server interaction Typical components (select, insert) Typical problems intra-crosscutting inter-crosscutting PROBLEM PROBLEM

Guestbook Architecture Browser guestbook database table SQL queries select.jsp doInsert.jsp insertForm.jsp HTTP PROBLEM PROBLEM Retrieves messages A form for adding a message Posts a new message

Select records from guestbook table Print “Content” Load driver and connect to database If table is not empty then Else Print “No records” Close database connection Catch exception Print “Service not available” select.jsp <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select name, ,message from guestbook");%> Visitor: '> Guest book is empty. <%} } finally {conn.close();} } catch (Exception e) {%> Server error: page codedescription name message Visitor: select name, , message from … name message href=“ > PROBLEM PROBLEM

Construct and execute SQL insert statement Print “Fail” Print “Message added” doInsert.jsp <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { PreparedStatement pst = conn.prepareStatement( (“insert into guestbook (name, , message) values (?,?,?)”); pst.setString(1,request.getParameter(“name”); pst.setString(2,request.getParameter(“ ”); pst.setString(3,request.getParameter(“message”); pst.execute(); %> Message was successfully added } finally {conn.close();} } catch (Exception e) {%> Server error: Load driver and connect to database Close connection Catch exception page codedescription name message pst.setString(1,request.getParameter(“name”); pst.setString(1,request.getParameter(“ ”); pst.setString(1,request.getParameter(“message”); ?,?,? PROBLEM PROBLEM

insertForm.jsp Return an HTML form that the visitor can fill in order to add a new message into the guestbook. New Message Your Name Message page codedescription Your Name Message PROBLEM PROBLEM

Intra- versus inter-crosscutting Intra  Tangling  Dynamic pages  Page scoped  OOP solution Inter  Scattering  Dynamic and static  Crosscuts pages  AOP solution All scheme expressions relate to the same instance insertForm.jsp select.jspdoInsert.jsp Illustration New Message Your Name Message <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select name, ,message from guestbook");%> Visitor: '> Guest book is empty. <%} } finally {conn.close();} } catch (Exception e) {%> Server error: <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { PreparedStatement pst = conn.prepareStatement( (“insert into guestbook (name, ,message) values (?,?,?)”); pst.setString(1,request.getParameter(“name”); pst.setString(2,request.getParameter(“ ”); pst.setString(3,request.getParameter(“message”); pst.execute(); %> Message was successfully added } finally {conn.close();} } catch (Exception e) {%> Server error: Tangling Scattering Dynamic pages Dynamic and static Page scoped Crosscuts pages OOP solution AOP solution PROBLEM PROBLEM

High development cost High maintenance cost Loss of reuse opportunities Increases dependency between developer groups, error-prone, etc. Natural language Correct? Consequence of inter-crosscutting PROBLEM PROBLEM High development cost High maintenance cost Loss of reuse opportunities Changes to the schema trigger complex code updates Cost of schema changes out- weights reuse benefits

Outline Background Overview Problem Solution Conclusion Future work

<%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { PreparedStatement pst = conn.prepareStatement( (“insert into guestbook (name, ,message) values (?,?,?)”); pst.setString(1,request.getParameter(“name”); pst.setString(2,request.getParameter(“ ”); pst.setString(3,request.getParameter(“message”); pst.execute(); %> Message was successfully added } finally {conn.close();} } catch (Exception e) {%> Server error: Unweaving inter-crosscutting <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select name, ,message from guestbook");%> Visitor: '> Guest book is empty. <%} } finally {conn.close();} } catch (Exception e) {%> Server error: New Message Your Name Message name message name message pst.setString(1,request.getParameter(“name”); Your Name pst.setString(1,request.getParameter(“ ”); pst.setString(1,request.getParameter(“message”); Message ?,?,? Visitor: Schema-related expressions are clustered by operation select.jspdoInsert.jsp insertForm.jsp Constructing SQL select statement Constructing SQL insert statement Rendering guest book messages as HTML table Rendering HTML form for inserting a message XP1 XP2 XP4 1. Substitute clusters with schema-shy extension points To unweave inter-crosscutting we… 2. Specify schema-related code in a separate module <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { PreparedStatement pst = conn.prepareStatement( (“insert into guestbook (name, ,message) values (?,?,?)”); pst.setString(1,request.getParameter(“name”); pst.setString(2,request.getParameter(“ ”); pst.setString(3,request.getParameter(“message”); pst.execute(); %> Message was successfully added } finally {conn.close();} } catch (Exception e) {%> Server error: <%try{ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); java.sql.Connection conn; conn = DriverManager.getConnection( "jdbc:mysql://localhost/database?user=login&password=pass"); try { Statement st = conn.createStatement(); ResultSet rs = st.executeQuery("select name, ,message from guestbook");%> Visitor: '> Guest book is empty. <%} } finally {conn.close();} } catch (Exception e) {%> Server error: New Message Your Name Message XP1 XP2 XP3 XP4 Abstract application Schema Weaver XP3 3. Employ weaver to produce executable code XP Model SOLUTION SOLUTION

DDD model SOLUTION SOLUTION DDD = MVC + XP What about having one model that solves both problems?

Solution space SOLUTION SOLUTION ProblemModelFramework Intra- crosscutting MVCApache Struts Inter- crosscutting XPWebJinn/XP Intra- and Inter- crosscutting DDDWebJinn

WebJinn Architecture Resource Model Controller View request response Java classes JSP pages Controller servlet Schema SOLUTION SOLUTION

Benefits of WebJinn Decreased dependency between developer groups Adaptability to schema changes High code reusability SOLUTION SOLUTION

Dynamic page DDD evolution Conclusion CONCLUSION CONCLUSION Intra- crosscutting Inter- crosscutting Static page CGI scripts MVC XP

Future Work AOP Model  AOP Web Development More Information 

Questions Coffee?

Related Models & Frameworks Apache Struts Java Server Facets The MVC Model JSP PHP ASP RELATED WORK