Prev | Current Page 676 | Next

Emilian Balanescu and Cristian Darie

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

This enables the order processor class to access each stage in a standard way. We??™ll also
define several utility functions and expose several common properties in the order processor
class, which will be used as necessary by the pipeline stages. For example, the ID of the order
should be accessible to all pipeline stages, so to save code duplication, we??™ll put that information
in the order processor class.
Now, let??™s get on to the specifics. We??™ll build a number of files in the business folder containing
all the new classes, which we??™ll reference from TShirtShop. The new files we??™ll create
are the following:
CHAPTER 18 ?–  IMPLEMENTING THE ORDER PIPELINE: PART 1 571
OrderProcessor: Main class for processing orders.
IPipelineSection: Interface definition for pipeline sections.
PsInitialNotification, PsCheckFunds, PsCheckStock, PsStockOk, PsTakePayment,
PsShipGoods, PsShipOk, PsFinalNotification: Pipeline section classes. We??™ll create these
classes in Chapter 19; here we??™ll use a dummy (PsDummy) class instead.
The progress of an order through the pipeline as mediated by the order processor relates
to the pipeline shown earlier (see Figure 18-3).
CHAPTER 18 ?–  IMPLEMENTING THE ORDER PIPELINE: PART 1 572
Figure 18-3. Pipeline processing
Stock tock
Check
Cre Credit Car it Card
Authorization thorization
Cus ustomer tomer
Notification
Cus ustomer tomer
Notification
Shippin hipping Payment
PsInitialNotification InitialNotification
PsCheckF CheckFunds ds
PsTakePayment TakePayment
PsFinalNotification FinalNotification
PsCheck CheckStock tock
PsS sStockOk tockOk
PsS sShip hipGoo oods ds
PsS sShipOk hipOk
Or OrderProce erProcess ssor or
Or OrderProce erProcess ssor or
Or OrderProce erProcess ssor or
Checko Checkout pa t page
Or Order ers admin pa min page
Or Order ers admin pa min page
Or Order Place er Placed
Confirmation
In Stock tock
Shippe hipped
TShirtShop interface Order pipeline processing
Confirmation
Confirmation
The process shown in this diagram is divided into three sections:
??? The customer places order.


Pages:
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688
praca rzeszów twojemiastopoznan.pl kontrola dostępu Pozycjonowanie angielski przez skype