} ?> Data and Application Logic Layer One

} ?> Data and Application Logic Layer One of the implicit design goals of this application is to separate application logic from the presentation layer (refer to Chapter 15 for more on this). In this application we will achieve this goal by implementing the data access and application logic in separate classes that are used by the presentation layer. The following is the list of classes implementing the data access and application logic: . Item: An abstract class encapsulating the common properties of different types of items. . Book_Item: This class models a book item. . Music_Item: This class models a music item. . Book_Shop: This class contains logic to get/search book items from BookShop table. . Music_Shop: This class contains logic to get/search music items from MusicShop table. . Shopping_Cart: This class models the user’s shopping cart. It implements the logic to add/remove items from the cart. . Transaction: The classes stores the details of user transaction. . Credit_Card: The class stores the credit card details. . Shipping_Address: The class stores the shipping address. . User: This class models the user. It stores all the user attributes and implements the checkout logic. It delegates all the save operations to User _Storage. . User_Storage: This class implements the save operation for the User object. . UserFactory: Implements functions for creating a new user and for loading users from the database. The Item Class The script Item.php contains the class definition of Item class: itemNo = $itemNo; $this->itemType = $itemType; $this->price = $price; } The function getItemNo() returns the value of member variable itemNo: function getItemNo() Page 561

Hint: This post is supported by Gama php5 hosting services

Comments are closed.