CSSE490 Web Services Development Introductions, REST, and Back-end - - PowerPoint PPT Presentation

csse490 web services development
SMART_READER_LITE
LIVE PREVIEW

CSSE490 Web Services Development Introductions, REST, and Back-end - - PowerPoint PPT Presentation

CSSE490 Web Services Development Introductions, REST, and Back-end tools Motivation for this course Sabbatical at Software Engineering Professionals Worked on a variety of projects o Programming locks for businesses so they can use


slide-1
SLIDE 1

CSSE490 Web Services Development

Introductions, REST, and Back-end tools

slide-2
SLIDE 2

Motivation for this course

  • Sabbatical at Software Engineering Professionals
  • Worked on a variety of projects
  • Programming locks for businesses so they can use Apple HomeKit to

access locks

  • Discovery Windows 8 Desktop application to assess ability to bid on

client project

  • Internal AngularJS front-end, Java back-end web application to help

managers manage resources.

  • Backbone-marionette enrolment and registration front-end

application for financial institution

  • Study groups and special interest groups
slide-3
SLIDE 3

Motivation for this course

  • Sabbatical at Software Engineering Professionals
  • Became fascinated with evolution of the web
  • New technologies, approaches, modules, libraries
  • Node.js
  • Evolution of JavaScript as front-end & back-end development

platform

  • Web 2.0
  • REST architectural style
slide-4
SLIDE 4

Motivation for this course

  • Limited experience with Web courses at Rose
  • Introduction to Web Programming (CSSE280)
  • Web App Frameworks with AppEngine (CSSE480)
  • Decided to use lessons learned from sabbatical experience to introduce

course on Web Services Development: q MEAN Technology stack q REST architectural style q Jasmine unit testing for front-end q Bootstrap for html-and css-based styling of front-end views q SASS (Syntactically Awesome Style Sheets) as CSS language q Mocha for testing back-end application

slide-5
SLIDE 5

REST

  • Representational State Transfer (REST) architectural

style for distributed hypermedia system

  • Characterized by 6 constraints:
  • Client-Server:
  • Separation of concerns is the principle behind the client-server

constraints

  • Separating the UI concerns from the data storage concern improves

portability

  • Stateless:
  • No client context is stored on the server between requests
  • Each request contains all the information needed to service the

request

  • Cacheable:
  • Require that the data within a response to a request be implicitly or

explicitly labeled as cacheable or non-cacheable

slide-6
SLIDE 6

REST

  • Characterized by 6 constraints:
  • Layered System:
  • Allows an architecture to be composed of hierarchical layers
  • Each component cannot "see" beyond the immediate layer with

which it is interacting

  • A client cannot ordinarily tell whether it is connected directly to the

end server, or to an intermediary along the way.

  • Intermediary servers may improve system scalability by enabling load-

balancing and by providing shared caches. Layers may also enforce security policies.

  • Uniform Interface:
  • Central feature that distinguishes the REST architectural style from
  • ther network-based styles
  • Defines the interface between clients and servers
  • Simplifies and decouples the architecture, which enables each part

to evolve independently

slide-7
SLIDE 7

REST Guiding principles

  • Resource-Based
  • Individual resources are identified in requests using URIs as resource

identifiers.

  • The resources themselves are conceptually separate from the

representations that are returned to the client.

  • For example, the server does not send its database, but rather, some

JSON , XML that represents some database

slide-8
SLIDE 8

REST Guiding principles

  • Manipulation of Resources Through Representations
  • When a client holds a representation of a resource, including any

metadata attached, it has enough information to modify or delete the resource on the server, provided it has permission to do so.

  • Verbs that make up REST Uniform Interface:
  • GET
  • POST
  • PUT
  • DELETE
slide-9
SLIDE 9

REST Guiding principles

  • Self-descriptive Messages
  • Each message includes enough information to describe how to process

the message.

  • For example, which parser to invoke may be specified by an Internet

media type (previously known as a MIME type).

  • Responses also explicitly indicate their cache-ability.
slide-10
SLIDE 10

REST Guiding principles

  • Hypermedia as the Engine of Application State

(HATEOAS)

  • Clients deliver state via body contents, query-string parameters, request

headers and the requested URI (the resource name).

  • Services deliver state to clients via body content, response codes, and

response headers.

  • This is technically referred-to as hypermedia (or hyperlinks within

hypertext).

slide-11
SLIDE 11

REST

  • Characterized by 6 constraints:
  • Code-on-demand (only optional constraint):
  • Server can temporarily extend client
  • Server transfer logic or executable to client
  • Client executes logic
  • For example: Java Applet, JavaScript
  • Compliance with REST constraints allows:
  • Scalability
  • Simplicity
  • Modiafiability
  • Visibility
  • Portability
  • Reliability
slide-12
SLIDE 12

http://joaopsilva.github.io

slide-13
SLIDE 13

Editor

  • Editor – Sublime Text 3
  • http://www.sublimetext.com/3
  • To configure:
  • Preferences à Settings – User
  • Whitespace settings: insert 4 spaces for tab
slide-14
SLIDE 14

Backend Tools: Node.js

  • A JavaScript runtime built on Chrome’s V8

JavaScript engine

  • https://nodejs.org/en/
  • Install with Homebrew (http://brew.sh/) on Mac
  • brew install node
  • Will install NPM – Node Package Manager - https://docs.npmjs.com/
  • Testing Node.js installation
  • node –v
  • node
  • Enter node statements
  • Press ‘CTRL’ + ‘c’ TWICE to exit
slide-15
SLIDE 15

Backend Tools: express.js

  • Node.js web application server framework
  • http://expressjs.com/
  • Is typically installed locally or each backend web development project
  • $ npm install express --save OR
  • Follow instructions posted at http://expressjs.com/starter/installing.html
  • Hello world example at http://expressjs.com/starter/hello-world.html
slide-16
SLIDE 16

Backend Tools: mongoDB

  • MongoDB – NoSQL Cross platform document-
  • riented database
  • http://docs.mongodb.org/manual/installation/ - installation instructions
  • https://docs.mongodb.org/manual/ - Documentation
  • https://docs.mongodb.org/getting-started/shell/ - Getting started with

MongoDB

  • MongoDB Shell
  • Import Example Dataset