All the application logic for the e-commerce application was pushed out of the pages and into a separate component library. Placing as much of your application logic as possible into separate components makes it easier to reuse the same methods across multiple pages in your website. The components are contained in the App_Code folder. The contents of this folder are dynamically compiled. You don't need to perform an explicit Build before using the components in the App_Code folder in your pages. Note Components are discussed in Part IV of this book, "Building Components." The App_Code folder contains the following components:
Each component performs a dual role. Each component represents a particular type of object and it also represents methods for working with objects of that type. For example, the Product component represents a product. It includes all of the product properties such as the product Name and Price properties. However, the Product component also contains all the methods for interacting with products. For example, it includes a method named SelectByCategoryId() that retrieves all the products contained in a particular category. |