Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Handel::Manual::Cookbook::WritingCustomStorage 1.00006

    Download button

    No screenshots available
    Downloads: 338  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Very Good (4.5/5)
    2 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Christopher H. Laco | More programs
    Perl Artistic License / FREE
    December 21st, 2007, 11:06 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Handel::Manual::Cookbook::WritingCustomStorage description

    Handel::Manual::Cookbook::WritingCustomStorage is a step by step example of writing a custom storage class.

    Handel::Manual::Cookbook::WritingCustomStorage is a step by step example of writing a custom storage class.

    This document will cover the basic steps needed to write a custom storage class for Handel 1.0. For this exercise, we will write an XML storage class that will store a cart and its items in a single xml file with the ability to do wildcard searches just like our DBIC storage class. The new storage class could be used for order and order items as well.

    Writing a custom storage class is just a matter of subclassing Handel::Storage and Handel::Storage::Result and implementing the methods necessary to create/delete/search carts and items as well as begin/commit/rollback transactions and update calls.

    The example code below demonstrates how to write a custom storage class in Handel. While it covers the basic steps, it is by no means a complete implementation of all possible features, including things like column default values, parameter validation, etc. Those are left as an exercise for the reader to implement based on their particular situation and application needs.

    GETTING STARTED

    Create A Blank XML File

    First, let's create the xml file we'll use to store shopping carts in:

    < ?xml version="1.0"? >
    < carts/ >

    Save this as carts.xml in a location of your choosing. As we add to this file later, it will take on the following format:

    < ?xml version="1.0"? >
    < carts >
    < cart id="1" shopper="1" name="My Cart" >
    < item id="1" sku="ABC-123" quantity="1" price="1.23"/ >
    < /cart >
    < /cart >

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    write custom storage | handel manual | Perl module | storage | cookbook | manual

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM