I've recently been asked to write and article for TPJ about Handel, which has forced me to come to terms with starting the next phase of that hobby...er package. While I've always intended for Handel to be a generic commerce framework, it currently only contains the shopping cart stuffs. There is no checkout code.

I don't want to impliment the world, but I want to allow others to do so if they desire.

I'm thinking about keeping orders just like the cart: Handel::Order and Handel::Order::Item. They're data. Nothing more. Nothing less. Then putting the magic in Handel::Checkout; loading Handel::Checkout::Plugins along the way to handle the various phases of an order. The phase could be:

  1. Initialization
  2. Address Verification (Address Scrubbing)
  3. Data Validation (SKU valid? Can ship part non US location?)
  4. Payment Authorization (Paypal, Verisign, POS)
  5. Order Delivery (Fax, Email, Printer)

Anyone been through a phased design like this before? Is the plugin method for each phase a sound one, or is it just asking for trouble? Is it all for knot and a waste of time? :-)

Update: I forgot one part of my question. If it were you, would you make each plugin have 1 method (like execute or process) and the plugin is added to a specific phase; or would you have each plugin subclass ::Plugin, which had method calls for each phase (like init, validate, auth, deliver)?


In reply to Phases Of The Spoon by jk2addict

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.