1993 version of Mosaic browser.

Slides:



Advertisements
Similar presentations
IST 535 Week 1 Class Orientation / Review of Web Basics.
Advertisements

HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
1 HTML and CGI Scripting CSC8304 – Computing Environments for Bioinformatics - Lecture 10.
HTML 101 MPM What is a website? A website is basically a collection of web pages stored on a particular computer (called a web server) and accessed.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
Web Application Programming Carol Wolf Computer Science.
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
1 John Magee 9 November 2012 CS120 Lecture 17: The World Wide Web and HTML Web Publishing.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Introduction to Web & HTML
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Web Design – Week 2 Introduction to website basics Website basics: How the Web Works Client / server architecture Packet switching URL components.
What’s Really Happening
National College of Science & Information Technology.
Intro to HTML CS 1150 Spring 2017.
Web Architecture & HTML
Web Basics: HTML/CSS/JavaScript What are they?
4.01 How Web Pages Work.
Introduction to HTML:.
Block 5: An application layer protocol: HTTP
How HTTP Works Made by Manish Kushwaha.
Intro to HTML CS 1150 Fall 2016.
Building Web Apps with Servlets
Web Basics: HTML and HTTP
CS320 Web and Internet Programming Generating HTTP Responses
HTTP – An overview.
The Hypertext Transfer Protocol
CISC103 Web Development Basics: Web site:
How does it work ?.
Introduction to HTML.
Software Design.
Web Languages What Is a Web Page?
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Introduction Web Environments
Application HTTP.
Internet Programming.
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
Uniform Resource Locators
Web Languages What Is a Web Page?
CISC103 Web Development Basics: Web site:
HTTP Hypertext Transfer Protocol
Multimedia and Networks
Hypertext Transfer Protocol
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
Hypertext Transfer Protocol
Uniform Resource Locators (URLs)
Intro to Web Development HTML Structure
World Wide Web Uniform Resource Locator hostname [:port]/path
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
Hypertext Transfer Protocol
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
Uniform Resource Locators

CIS 133 mashup Javascript, jQuery and XML
Web Development 101 Workshop
MVC Controllers.
CS3220 Web and Internet Programming Cookies and Session Tracking
HyperText Markup Language
Application Layer Part 1
An Introduction to JavaScript
HTTP Hypertext Transfer Protocol
Uniform Resource Locators (URLs)
Hypertext Transfer Protocol
Presentation transcript:

http://www. computerhistory http://www.computerhistory.org/timeline/images/1993_mosaic_browser_large.jpg 1993 version of Mosaic browser. Must be loading Yahoo! from the late 90s (note ’N Sync link). MVC and the View

Today’s Goal: Program “View” in Rails Prerequisites: How to program HTML How the Web works How Rails MVC architecture works

Today’s Goal: Program “View” in Rails Prerequisites: How to program HTML How the Web works How Rails MVC architecture works

Implies formatting tags What is HTML? Implies links Implies formatting tags HyperText Markup Language Main language for writing web pages that can be displayed in a web browser

Brief History of HTML 1991ish: Born Thru 1990s: Evolves Versions 0 to 4 By 2000: Ver. 4.01 wins! Still most common/supported? 2008: HTML5 introduced Rich media and mobility Finalized Oct ’14 Not fully supported? We’ll use HTML5

Web Pages = 3 Technologies I’ll cover HTML for Structure Cascading Style Sheets (CSS) for Style JavaScript for Behavior Explore on your own

Then load it in a browser How HTML Works <!DOCTYPE html> <html> <head> <title>Hello!</title> </head> <body> <h1>Howdy Y'all</h1> <p> How do ya like my HTML? </p> </body> </html> You write HTML text Then load it in a browser

<p>This is a paragraph.</p> HTML Elements Start tag End tag <p>This is a paragraph.</p> Note slash! Renders as This is a paragraph.

<p>This is a <b>paragraph</b>.</p> Elements can be nested Nested element <p>This is a <b>paragraph</b>.</p> Renders as This is a paragraph.

Elements can have attributes <p style="color:blue">I'm blue!</p> Equals Attribute name Value string Renders as I’m blue!

head element for metadata body element for content HTML Page Structure Doctype info <!DOCTYPE html> <html> <head> <title>Hello!</title> </head> <body> <h1>Howdy Y'all</h1> <p> How do ya like my HTML? </p> </body> </html> html element head element for metadata body element for content

Oh yeah, and … A few tags don’t come in pairs: E.g.: <br> for line breaks E.g.: <img> for images Browsers collapse whitespace (spaces, newlines): Consecutive whitespace treated as single space Leading/trailing whitespace eliminated Special symbols: E.g.:   for non-breaking space See: http://www.w3schools.com/html/html_entities.asp and http://www.w3schools.com/tags/ref_symbols.asp

Now, all you need to do is learn these tags: http://www. w3schools Now, all you need to do is learn these tags: http://www.w3schools.com/tags/ref_byfunc.asp (Ignore the ones marked “new” for now) (Ignore the “not supported” ones)

Today’s Goal: Program “View” in Rails Prerequisites: How to program HTML How the Web works How Rails MVC architecture works

So how does the Web work? When you open a web page in your browser, where does that HTML come from, and how does it get to your browser?

Architecture of the Web Head First Servlets and JSP (2nd edition), p. 3

Client-Server Interaction Head First Servlets and JSP (2nd edition), p. 4

How do you tell a browser to send a request to a particular server? Head First Servlets and JSP (2nd edition), p. 3

URL (Uniform Resource Locator) http://www.wickedlysmart.com:80/beeradvice/select/beer1.html Path Server Resource Port (optional) Protocol (http, https, etc.)

What protocol do these interactions follow? Head First Servlets and JSP (2nd edition), p. 4

HTTP (Hypertext Transfer Protocol) Request “methods” GET: Retrieve resource POST: Create resource PATCH: Update resource DELETE: Destroy resource … more … Response (only one type) CRUD: 4 basic operations of persistent storage

Example HTTP GET Request HTTP Method Path to resource Protocol version GET /select/selectBeerTaste.jsp HTTP/1.1 Host: www.wickedlysmart.com User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X… Accept: text/xml,application/xml,application/xhtml+xml… Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Request headers

Text version of status code Example HTTP Response Protocol version HTTP status code Text version of status code HTTP/1.1 200 OK Content-Type: text/html Content-Length: 397 Date: Wed, 19 Nov 2003 03:25:40 GMT Server: Apache-Coyote/1.1 Connection: close <html> … </html> Response headers Response body

Today’s Goal: Program “View” in Rails Prerequisites: How to program HTML How the Web works How Rails MVC architecture works

Model-View-Controller (MVC) Architectural Pattern Server Model-View-Controller (MVC) Architectural Pattern Timeout! What kind of diagram is this? Ye Olde Internet

Server Data Flow Diagrams components flows Ye Olde Internet

Model-View-Controller (MVC) Architectural Pattern Server Model-View-Controller (MVC) Architectural Pattern Timeout! What do we mean by “architectural”? Ye Olde Internet

Two levels of software design Architectural design: High-level structure of software system Detailed design: Low-level design of individual components/modules/classes

Model-View-Controller (MVC) Architectural Pattern Server Model-View-Controller (MVC) Architectural Pattern Being “architectural”, these components may contain many subcomponents (classes, etc.) Ye Olde Internet

MVC Component Responsibilities Server MVC Component Responsibilities Ye Olde Internet

Responsibility-Driven Design Frames object design as deciding How to assign responsibilities to objects How objects should collaborate What role each object should play in a collaboration http://flic.kr/p/btp5ZK

MVC Component Responsibilities Server MVC Component Responsibilities View: Responsible for UI (generating HTML) Ye Olde Internet

MVC Component Responsibilities Server MVC Component Responsibilities View: Responsible for UI (generating HTML) Model: Business logic, domain objects Ye Olde Internet

MVC Component Responsibilities Server MVC Component Responsibilities View: Responsible for UI (generating HTML) Model: Business logic, domain objects Controller: Translates UI actions into operations on domain objects Ye Olde Internet

Rails MVC – Fill in the blanks! Browser Rails MVC – Fill in the blanks! Ye Olde Internet DB Server ??? ??? ??? ???

Rails MVC – Fill in the blanks! Browser Rails MVC – Fill in the blanks! Ye Olde Internet DB Server View Router Controller Model

Router: Translates HTTP request into call to controller method Browser Router: Translates HTTP request into call to controller method Ye Olde Internet DB Server View Router Controller Model

Browser Programming a Rails web app mainly involves customizing the Router, Model, View, and Controller components Ye Olde Internet DB Server View Router Controller Model

Customize Ruby classes Ye Olde Internet Browser Customize Ruby classes Ye Olde Internet DB Server View Router Controller Model

Customize Ruby block Ye Olde Internet Browser DB Server View Router Controller Model

Customize ERB (Embedded Ruby) files Browser Customize ERB (Embedded Ruby) files Ye Olde Internet DB Server View Router Controller Model

Example ERB: HTML with embedded Ruby code <% … %> executes embedded code before printing subsequent HTML code <%= … %> executes embedded code and prints return value before printing subsequent HTML code

Activity Time: Let’s try programming Rails *VC! Browser Activity Time: Let’s try programming Rails *VC! Ye Olde Internet DB Server View Router Controller Model