100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Lecture Note Chapter 8 - Business Logic and JavaScript $3.23   Add to cart

Class notes

Lecture Note Chapter 8 - Business Logic and JavaScript

 2 views  0 purchase
  • Course
  • Institution
  • Book

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.

Preview 1 out of 5  pages

  • March 20, 2021
  • 5
  • 2020/2021
  • Class notes
  • Christian becker
  • Lecture 8 - business logic and javascript
avatar-seller
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller sonphan. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $3.23. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67474 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$3.23
  • (0)
  Add to cart