Custom Tags That Encapsulate Business Rules - macromedia COLDFUSION MX 7 Web Application Construction Kit [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

macromedia COLDFUSION MX 7 Web Application Construction Kit [Electronic resources] - نسخه متنی

Ben Forta, Raymond Camden, Leon Chalnick, Angela Buraglia

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











  • Custom Tags That Encapsulate Business Rules


    It's often 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 won't violate the corresponding business rules.

    For instance, looking at the tables in the ows example database, it's 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.

    You could place all those steps in a single custom tag. It could be called something such as <cf_PlaceMerchandiseOrder> and take a few simple and easily understood parameters that represent everything necessary to complete an order successfully. The tag might look like this when used in code:


    <!--- Place order for selected items and get new Order ID --->
    <cf_PlaceMerchandiseOrder
    contactID="4"
    merchIDList="2,6,9"
    shipToCurrentAddress="Yes"
    sendReceiptViaEmail="Yes"
    returnVariable="NewOrderID">

    Chapter 28, "Online Commerce."


  • / 281