100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Lecture Note Chapter 8 - Business Logic and JavaScript

Rating
-
Sold
-
Pages
5
Uploaded on
20-03-2021
Written in
2020/2021

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.

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Study
Course

Document information

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

Subjects

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
$3.62
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
sonphan

Also available in package deal

Get to know the seller

Seller avatar
sonphan Universität Mannheim
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
4 year
Number of followers
1
Documents
0
Last sold
4 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions