• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 20. Building Reusable Components > Custom Tags That Encapsulate Busines...

Custom Tags That Encapsulate Business Rules

Often it's helpful to create custom tags to represent the business rules or logic your application needs to enforce or adhere to. After these custom tags are written correctly, you can rest assured that your application will not violate the corresponding business rules.

For instance, looking at the tables in the ows example database, it is easy to see that several tables will be involved when someone wants to place an order from Orange Whip Studios' online store. For each order, a record will be added to the MerchandiseOrders table, and several records can be added to the MerchandiseOrdersItems table (one record for each item the user has in the shopping cart). In addition, you will need to verify the user's credit-card number and perhaps send a confirmation email as an acknowledgment of the user's order. In a real-world application, you might also need to decrease the current number of items on hand after the order has been placed, and so on.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint