Lecture 10 Rails Projects - PowerPoint PPT Presentation

About This Presentation
Title:

Lecture 10 Rails Projects

Description:

Fig 2.8 5,000 ft view Refining Middleware Architectures for Web Apps Left - page controller Sinatra Center top front controller J2EE servlets Center bottom ... – PowerPoint PPT presentation

Number of Views:92
Avg rating:3.0/5.0
Slides: 21
Provided by: Mant74
Learn more at: https://www.cse.sc.edu
Category:

less

Transcript and Presenter's Notes

Title: Lecture 10 Rails Projects


1
Lecture 10Rails Projects
CSCE 740 Software Engineering
  • Topics
  • SaaS
  • Readings SaaS book Ch 2, 4

February 24, 2014
2
SaaS round 2 -
  • Finish-up Last Lecture Slides
  • Slides ???
  • New
  • Summary of Rails
  • HAML
  • Cucumber
  • Capybara
  • Next Time
  • Last Time
  • RAILS
  • Fig 2.1 100,000 view
  • Client-server
  • HTTP URIs
  • HTML CSS
  • HAML


3
Rails Summary from Last time
  1. The MVC Architecture
  2. Components of Rails
  3. REST
  4. a New Rails Project
  5. Rails Application Dir
  6. Rails Appl Directory II
  7. Directory app
  8. HAML - lightweight
  9. YAML-human-readable data serialization format
  • Configuring a DB
  • Creating a DB
  • Starting Webrick
  • rails generate
  • Setting the Application Home Page
  • Rails Scaffolding
  • Whats Next?
  • Rails Summary
  • Active Record

CS 169 Saasbook Fox and Patterson
4
Chapter 2 SaaS Architecture Review
Saasbook Fox, Armando Patterson, David
(2014-01-31).
5
Review Fig 2.3 URI HTTPmethod
Saasbook Fox, Armando Patterson, David
(2014-01-31).
6
Fig 2.4 50,000 ft view
7
Fig 2.6 Refining Steps 2 and 3
Saasbook Fox, Armando Patterson, David
(2014-01-31).
8
Lamp
  • Early SaaS sites were created using the Perl and
    PHP scripting languages, whose
  • availability coincided with the early success of
    Linux, an open-source operating system, and
    MySQL, an open-source database.
  • Thousands of sites are still powered by the LAMP
    StackLinux, Apache, MySQL, and PHP or Perl.

Saasbook Fox, Armando Patterson, David
(2014-01-31).
9
Scalability
Saasbook Fox, Armando Patterson, David
(2014-01-31).
10
Fig 2.8 5,000 ft view Refining Middleware
11
Architectures for Web Apps
  • Left - page controller Sinatra
  • Center top front controller J2EE servlets
  • Center bottom PHP
  • Right MVC used by rails

Saasbook Fox, Armando Patterson, David
(2014-01-31).
12
Fig 2.10 5,000 ft view
Saasbook Fox, Armando Patterson, David
(2014-01-31).
13
2.6 500 Feet Active Record for Models
  • Active Record architectural pattern
  • a single instance of a model class (in our case,
    the entry for a single movie) corresponds to a
    single row in a specific table

Saasbook Fox, Armando Patterson, David
(2014-01-31).
14
CRUD
  • Create a new row in the table (representing a new
    object),
  • Read an existing row into a single object
    instance,
  • Update an existing row with new attribute values
    from a modified object instance,
  • Delete a row (destroying the objects data
    forever).

Saasbook Fox, Armando Patterson, David
(2014-01-31).
15
2.7 500 Feet Routes, Controllers, and REST
  • REST - In 2000, Roy Fielding proposed, in his
    Ph.D. dissertation, a consistent way to map
    requests to actions that is particularly well
    suited to a service-oriented architecture.
  • identify the various entities manipulated by a
    Web app as resources, and
  • design the routes so that any HTTP request would
    contain all the information necessary to identify
    both a particular resource and the action to be
    performed on it.
  •  In Rails, the route mappings are generated by
    code in the file config/routes.rb,

Saasbook Fox, Armando Patterson, David
(2014-01-31).
16
Fig 2.12 Rake Routes Summary
  • Operation Method URI action
  • Index (list) movies GET /movies index
  • Read (show) movie GET /movies/id show
  • Display fill-in form GET /movies/new new
  • Create from filled-in form POST /movies create
  • Display form to edit GET /movies/id/edit edit
  • Update movie PUT /movies/id update
  • Destroy movie DELETE /movies/id destroy

Saasbook Fox, Armando Patterson, David
(2014-01-31).
17
Fig 2.13 Restful vs nonRestful
  • Login to site
  • Non-RESTful site - POST /login/dave
  • URI RESTful site - POST /login/dave
  • Welcome page
  • Non-RESTful - GET  /welcome
  • URI RESTful - GET  /user/301/welcome
  • Add item ID 427 to cart
  • Non-RESTful - POST /add/427
  • URI RESTful - POST /user/301/add/427

Saasbook Fox, Armando Patterson, David
(2014-01-31).
18
  • View cart
  • Non-RESTful - GET / cart
  • URI RESTful - GET  /user/301/cart
  • Checkout
  • Non-RESTful - POST /checkout
  • URI RESTful - POST /user/301/checkout

Saasbook Fox, Armando Patterson, David
(2014-01-31).
19
ELABORATION REST vs. SOAP vs. WS-
  • SOA standards bodies created committees to
    develop standards for SOA interoperation.
  • One approach resulted in a collection of
    elaborate protocols for Web Services including
    WS-Discovery, WS-Description, and others,
    sometimes collectively called WS- and jokingly
    called WS-Deathstar by David Heinemeier
    Hansson, the creator of Rails.
  • The competing SOAP standard (Simple Object Access
    Protocol) was a bit simpler but still far more
    complex than REST. By and large, practicing
    developers perceived SOAP and WS- as
    overdesigned committee-driven standards burdened
    by the archaic design stance

Saasbook Fox, Armando Patterson, David
(2014-01-31).
20
Fig 2.14 500 ft Template views HAML
  • Haml HTML
  • brclear gt left ltbr clearleft/gt
  • p.foo Hello ltp classfoogtHellolt/pgt
  • pfoo Hello ltp idfoogtHellolt/pgt
  • .foo ltdiv classfoogt. . . lt/divgt
  • foo.bar ltdiv idfoo classbargt. . . lt/divgt

Saasbook Fox, Armando Patterson, David
(2014-01-31).
Write a Comment
User Comments (0)
About PowerShow.com