Prev | Current Page 62 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

The data
tier needs to be called, because it stores and manages the entire web site??™s data, including users??™
shopping cart information.
At step 4, the data tier updates the database and eventually returns a success code to the
business tier. At step 5, the business tier handles the return code and any errors that might
have occurred in the data tier while updating the database and then returns the output to the
presentation tier.
Figure 2-2. Internet visitor interacting with a three-tier application
At step 6, the presentation tier generates an updated view of the shopping cart. At step 7,
the results of the execution are wrapped up by generating aHypertext Markup Language (HTML)
web page that is returned to the visitor where the updated shopping cart can be seen in the
visitor??™s web browser.
Note that, in this simple example, the business tier doesn??™t do a lot of processing, and its
business logic isn??™t very complex. However, if new business rules appear for your application,
you would change the business tier. If, for example, the business logic specified that a product
could be added to the shopping cart only if its quantity in stock was greater than zero, an additional
data tier call would have been made to determine the quantity. The data tier would be
requested to update the shopping cart only if products are in stock.


Pages:
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
traktorki ogrodowe terapia magnetyczna Pompy zatapialne mapa Niemiec Wnętrza Poznań