Content. Client-Server Model. Server Roles

Similar documents
CE212 Web Application Programming Part 3

G51PRG: Introduction to Programming Second semester Applets and graphics

Web Architecture AN OVERVIEW

For live Java EE training, please see training courses at

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

Overview of Web Application Development

Setup and Getting Startedt Customized Java EE Training:

13. Databases on the Web

ICOM 5016 Database Systems. Database Users. User Interfaces and Tools. Chapter 8: Application Design and Development.

Front End Programming

Goals. Java - An Introduction. Java is Compiled and Interpreted. Architecture Neutral & Portable. Compiled Languages. Introduction to Java

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Java Applet & its life Cycle. By Iqtidar Ali

Pearson Education 2007 Chapter 7 (RASD 3/e)

WebStore9 Services. Web Development Services

Software System/Design & Architecture. Eng.Muhammad Fahad Khan Assistant Professor Department of Software Engineering

MVC: Model View Controller

Java Applets, etc. Instructor: Dmitri A. Gusev. Fall Lecture 25, December 5, CS 502: Computers and Communications Technology

Getting Started with Java. Atul Prakash

CHAPTER 1 Introduction to Computers and Java

CS506 Web Design & Development Final Term Solved MCQs with Reference

Chapter 11 Program Development and Programming Languages

Chapter 10 Web-based Information Systems

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform

CT 229 Arrays in Java

PHP. MIT 6.470, IAP 2010 Yafim Landa

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

Model-View Controller IAT351

Ruby on Rails. SITC Workshop Series American University of Nigeria FALL 2017

CSD Univ. of Crete Fall Java Applets

Web Programming Paper Solution (Chapter wise)

Topics. From UI prototype... About user interfaces. ... via design to implementation. Pearson Education 2005 Chapter 7 (Maciaszek - RASD 2/e) 6

Pearson Education 2005 Chapter 7 (Maciaszek - RASD 2/e) 2

Introduction to Computer Science I

Tutorial Point On Html5 Pdf

An applet is a program written in the Java programming language that can be included in an HTML page, much in the same way an image is included in a

Lecture 4: UI Software Architecture. Fall UI Design and Implementation 1

Enterprise Java Unit 1- Chapter 3 Prof. Sujata Rizal Introduction to Servlets

Advanced Web Applicatio Design Patter. Rupak Raj Ghi

Modern Web Application Development. Sam Hogarth

GUI-Hanger syndrome SOFTWARE ARCHITECTURES. Architectural Design Choices. Why software architectures? Monolithic Architecture / 2

Windows and Events. created originally by Brian Bailey

Ch04 JavaServer Pages (JSP)

Software Elements of Electronic Business Sites

CS1004: Intro to CS in Java, Spring 2005

1. What is Jav a? simple

Tutorial Point Servlets Pdf

MaTraca v.3: Maintaining Traceability Links

Oracle Applications OAF, MSCA, MA and ADF. May 06, 2011

EPHP a tool for learning the basics of PHP development. Nick Whitelegg School of Media Arts and Technology Southampton Solent University

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Discovering Computers Chapter 13 Programming Languages and Program Development

Building Rich Applications with Appcelerator

INTERNET PROGRAMMING. Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology

Lecture 1 - Introduction (Class Notes)

Programming the World Wide Web by Robert W. Sebesta

Implementing a Web Server on OS/390: Part III Writing Common Gateway Interfaces and Installing Java Virtual Machine

We will talk about Alt-Tab from the usability perspective. Think about: - Is it learnable? - Is it efficient? - What about errors and safety?

Enterprise Software Architecture & Design

Web Architecture and Technologies

CPET 581 E-Commerce & Business Technologies. Topics

Introduction. Introduction to OOP with Java. Lecture 01: Introduction to OOP with Java - AKF Sep AbuKhleiF -

Cloud Computing Platform as a Service

Presentation and content are not always well separated. Most developers are not good at establishing levels of abstraction in JSPs

SSC - Web development Model-View-Controller for Java Servlet

Web Technologies VU ( ) Vedran Sabol. Nov 13, ISDS, TU Graz. Vedran Sabol (ISDS, TU Graz) Web Technologies Nov 13, / 60

CSC309: Introduction to Web Programming. Lecture 11

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

FILE - JAVA WEB SERVICE TUTORIAL

Database Applications

Web Programming. Lecture 11. University of Toronto

CHAPTER 1. Introduction to JAVA Programming

Software Architecture

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

UNIT I Java Bean, HTML & Javascript

The future of dynamic languages. Gabor Szabo Perl Training Israel - Raz Information Systems -

Syllabus INFO-GB Design and Development of Web and Mobile Applications (Especially for Start Ups)

Architectural Styles II

1Z Oracle. Java Platform Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert

Design Considerations When Developing Applications Using SAS. Vijay Rajandram Amadeus Software Ltd

IT2353 Web Technology Important Questions 2 Marks and 16 Marks Unit 1 Part A 1. Differentiate Internet with Intranet. 2. What are HTML tags? 3.

AJAX and Persistence: Emerging Patterns and Pain Points

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

Software. Programming Languages. Types of Software. Types of Languages. Types of Programming. Software does something

Model-View-Controller Patterns and Frameworks. MVC Context

Pervasive Web Application Architecture. History Scalability Availability Development Application Architecture

Chapter 12 Databases and Database Management Systems

Course title: WEB DESIGN AND PROGRAMMING

The Basic Web Server CGI. CGI: Illustration. Web based Applications, Tomcat and Servlets - Lab 3 - CMPUT 391 Database Management Systems 4

Web Development for Dinosaurs An Introduction to Modern Web Development

Groovy & Grails Scripting for Modern Web Applications. Rohit Nayak Talentica Software

Credits: Some of the slides are based on material adapted from

Programming in the Real World

CS 177 Recitation. Week 1 Intro to Java

Web Frameworks MMIS 2 VU SS Denis Helic. March 10, KMI, TU Graz. Denis Helic (KMI, TU Graz) Web Frameworks March 10, / 18

But before understanding the Selenium WebDriver concept, we need to know about the Selenium first.

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 9: Writing Java Applets. Introduction

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

Transcription:

IT4409: Web Technologies and e-services Content Spring 2017 Web Development Models Dr. Nguyen Kiem Hieu Department of Information Systems School of Information and Communication Technology Hanoi University of Science and Technology Web Application Architecture: client-server Programming Languages on client side Javascript, Flash, Applet,... Programming Languages on server side PHP, Server page, Servlet,... 3-tier architecture and MVC model Client-Server Model Server Roles Manage and store data, including: User data Application data Provide processing services for data Centralize data Manage user authentication, authorization mechanisms via login function Client side Server side

Client Roles Client-Server Advantages Provide user interface Can store some small data (using cookie) Can process data (check validity of data that are entered by users) Thin client: only provides user interface, centralize data processing on server side Thick client: realizes data processing on client side Can be accessed from everywhere with minimal software installation Centralized storage and processing. Switch from CAPEX to OPEX No data redundancy Enhance the ability of sharing data If data are distributed on multi-systems of users, it will cause difficulties in sharing the data because each system has its own database architecture 3-Tier Architecture 3-Tier Architecture Advantages Database Tier (Data Access Layer) Stores and accesses data in low-level Server Tier (Business Logic Layer) Manages application connections and process data Client Tier (Presentation Layer) Provides interface and processing Centralized Database can be accessed by many servers at the same time Allow load balance of user connections on many application servers Data Access Layer is consistently designed with hardware in order to serve specific its tasks: Data manipulations: update, insert, remove, etc. Need more reliable hard drives Business Logic Layer are designed to provide connection points for user connections and run multi-applications Need more computing power of CPU Presentation Layer Business Logic Layer Data Access Layer

Programming Languages Client Programming Language Client Server Database Html Java, Ruby SQL JavaScript Visual Basic NoSQL Flash PHP, Perl Python JavaScript Event Handling Statements (like C / Java) Operators Variables global (default) Or local (e.g. var x = 1) Types can change Eg. x = 1; x = Hello Function definition (reuse) Message Alerts Page element access with Document Object Model Views HTML page as a tree of elements Hello World Example What are Applets? This provides an annoying popup try it! <html> <body> <a href="http://www.google.co.uk" onmouseover="(alert( 'Follow link to search on Google') )"> Search on Google </a> </body> </html> An applet is a special Java program that can be embedded in HTML documents. It is automatically executed by (applet-enabled) web browsers. In Java, non-applet programs are called applications.

Application vs. Applet Java Application Example Application Trusted (i.e., has full access to system resources) Invoked by Java Virtual Machine (JVM, java), e.g. java HelloWorld Should contain a main method, i.e., public static void main(string[]) Applet Not trusted (i.e., has limited access to system resource to prevent security breaches) Invoked automatically by the web browser Should be a subclass of class java.applet.applet HelloWorld.java public class HelloWorld { public static void main(string[] args) { System.out.println( Hello World! ); } } HelloWorldApplet.java Java Applet Example Server Programming Language Java source in HelloWorldApplet.java import java.awt.*; import java.applet.applet; public class HelloWorldApplet extends Applet { public void paint(graphics g) { Dimension d = getsize(); g.setcolor(color.black); g.fillrect(0, 0, d.width, d.height); // paint background g.setfont(new Font("San-serif", Font.BOLD, 24)); g.setcolor(new Color(255, 215,0)); g.drawstring("hello, world!", 60, 40); g.drawimage(getimage(getcodebase(), Rabbit.jpg"), } } 20, 60, this); Java uses Java servlets, Java Server Pages (JSP) and Java Beans. Ruby on Rails uses ruby programs and Embedded Ruby (ERB). Visual Basic Uses VB programs and Active Server Pages (ASP). Others: PHP (Personal Home Page originally) CGI (Common Gateway Interface) Perl (Named after the parable of the pearl) Python (Named for the Monty Python skits) Tcl (Tool Command Language)

PHP Simple PHP Example Hacky, but (also?) very c-like Classes, etc., work very much like c/c++ Designed to work in the world of HTML Is run-time interpreted by the web server Reminder: it s hacky PHP is meant to be invoked inline with content Page escapes into and out of a regular html document File extension is.php (was.php3 for version 3) <html> <head>test page</head> <body> The time is now <?php echo date();?> <hr> </body> </html> JSP Example Date_jsp.java (extract) This extract shows the part that produces the output compare it with the JSP: <html> <head> <title> Hello JSP </title> </head> <body> <p> Hello World: <%= new java.util.date() %> </p> </body> </html> See also the Servlet this page is translated to out = pagecontext.getout(); _jspx_out = out; out.write("<html>\r\n"); out.write("<head> "); out.write("<title> Hello JSP "); out.write("</title> "); out.write("</head>\r\n"); out.write("<body> \r\n"); out.write("<p> Hello World:\r\n "); out.print( new java.util.date() ); out.write("\r\n"); out.write("</p>\r\n"); out.write("</body>\r\n"); out.write("</html>\r\n");

Produced MVC Development Model Architectural Pattern from Smalltalk (1979) Decouples data and presentation Eases the development MVC The Model MVC The View The Model contains the data Has methods to access and possibly update it s contents. Often, it implements an interface which defines the allowed model interactions. Implementing an interface enables models to be pulled out and replaced without programming changes. The View provides a visual representation of the model. There can be multiple views displaying the model at any one time. For example, a companies finances over time could be represented as a table and a graph. These are just two different views of the same data. When the model is updated, all Views are informed and given a chance to update themselves.

MVC The Controller It interprets mouse movement, clicks, keystrokes, etc Communicates those activities to the model eg: delete row, insert row, etc Example Control Flow in MVC User interacts with the VIEW UI CONTROLLER handles the user input (often a callback function attached to UI elements) CONTROLLER updates the MODEL VIEW uses MODEL to generate new UI UI waits for user interaction MVC General Example MVC Advantages MVC decouples the model, view, and controller from each other to increase flexibility and reuse. You can attach multiple views to the model without rewriting it. You can change the way a view responds to user input without changing the visual presentation. For example, you might use a pop-up menu instead of keyboard command keys.

Business 3 Tier Layers vs. MVC Presentation Summary Client-Server Model 3-Tier Architecture Dynamic Web Programming Languages MVC Model Database Presentation: View is the user interface (e.g. button) Controller is the code (e.g. callback for button) Data: Model is the database email: hieunk@soict.hust.edu.vn Q&A