WebFund 2014W Lecture 13: Difference between revisions

From Soma-notes
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
The video from the lecture given on February 28, 2014 is available:
* [http://www.screencast.com/t/PBuN6voQ7mw Small from screencast.com]
* [http://www.screencast.com/t/vgmtsqJV6 Large from screencast.com]
* [http://dl.cuol.ca/capture/Anil.Somayaji/COMP_2406_2014W_Lecture_13_-_20140301_010241_27.mp4 Original from CUOL]
==MongoDB==
==MongoDB==


Line 25: Line 31:
* retrieve value of a property
* retrieve value of a property
* => key/value store or associative array
* => key/value store or associative array
Transactions: (not in MongoDB)
* start a transaction
* specify queries to match documents/records
* specify changes to those documents/records
* commit changes if none of the specified data has been changed by others
* if others have changed documents/records, abort transactions and undo all changes
* Airline example: reserve seat and record payment
* If you want transactions, use SQL (e.g., PostgreSQL, Oracle, MySQL (sort of)), at the price of some performance


==Ethics==
==Ethics==


==client-side JS==
==client-side JS==
Key difference between client-side and server-side JS: THE DOM
* DOM = document object model
* tree representation of an HTML document
* with lots of access methods
* purpose: read and change HTML page under control of JS
jQuery
* standardized methods for accessing DOM (and other stuff)
* pattern: specify nodes => change nodes
* specify nodes via tag, id, & class (same identifiers used by CSS)

Latest revision as of 01:10, 6 March 2014

The video from the lecture given on February 28, 2014 is available:


MongoDB

Data "types":

  • Databases: sets of collections
  • collections: sets of documents
  • documents: sets of properties and values

Database operations:

  • create/add a database
  • drop/delete a database
  • add a collection to a database
  • remove a collection from a database
  • select a collection to use

Collection operations:

  • retrieve all documents
  • retrieve specific documents matching a set of conditions
  • add/insert a document
  • remove/delete a document
  • replace a set of document

Document operations:

  • stored as a JS object with _id unique identifier
  • set/change value of a property
  • retrieve value of a property
  • => key/value store or associative array

Transactions: (not in MongoDB)

  • start a transaction
  • specify queries to match documents/records
  • specify changes to those documents/records
  • commit changes if none of the specified data has been changed by others
  • if others have changed documents/records, abort transactions and undo all changes
  • Airline example: reserve seat and record payment
  • If you want transactions, use SQL (e.g., PostgreSQL, Oracle, MySQL (sort of)), at the price of some performance

Ethics

client-side JS

Key difference between client-side and server-side JS: THE DOM

  • DOM = document object model
  • tree representation of an HTML document
  • with lots of access methods
  • purpose: read and change HTML page under control of JS

jQuery

  • standardized methods for accessing DOM (and other stuff)
  • pattern: specify nodes => change nodes
  • specify nodes via tag, id, & class (same identifiers used by CSS)