Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 5 pages
Class notes

Lecture Note Chapter 8 - Business Logic and JavaScript

Document preview thumbnail
Preview 1 out of 5 pages

An intuitive brief note of the lecture content and the slides. I got 1.3 in the exam with this note and hope you will find it helpful for your review before the exam.

Content preview

Ch1. The Internet
Ch2. The Internet protocol stack
Ch3. Web Servers
Ch4. HTML
Ch5. Apache and PHP
Ch6. Databases
Ch7. Databases and PHP
Ch8. Business Logic and JavaScript
Ch9. Security
Ch8. Business Logic and JavaScript
I. PHP business logic
1. Get available cars:
Need a logic to avoid this overlapping:
(1) The rentals start before the requested end date
(2) The rentals end after the requested start date
➔ Logic: rental.startDate < request.endDate && rental.endDate > request.startDate
2. Data flow
(1) Browser: GET searchresults.php?startDate=2019-05-20&endDate=2019-05-22
HTTP/1.1
(2) Web server (PHP interpreter): send SELECT query to DB
(3) DB: Return car table + rental table.
(4) The searchresults.php proceed data and return the list of available cars to the browser
(client).
3. Get available cars (function)
(1) Get all rentals from DB
(2) Find overlapping rentals with our request
(3) Store overlapping rentals in a list of as rented cars
(4) Get all cars (ID) from DB
(5) Available cars = All cars – rented cars
II. Improving our architecture
Improve by dividing web server into 2 main blocks:
➢ Front end: only focuses on creating HTML.
➢ REST API Server:
- focus on dealing with data.
➔ Advantage: Separation of concern.
The browser can directly communicate with REST API server:
e.g. while you are typing, the browser may send it to the server, asking for recommendations.
➔ To do this, we need data exchange formats (XML, JSON).
1. Data exchange format

Connected book
 image
Publisher: Unknown ISBN: 9781482217650 Edition: 1

Document information

Study
Uploaded on
March 20, 2021
Number of pages
5
Written in
2020/2021
Type
Class notes
Professor(s)
Christian becker
Contains
Lecture 8 - business logic and javascript
$4.14

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
1
Items
0
Last sold
5 year ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions