Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    CatalystX::CRUD::Tutorial 0.17

    Download button

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

    License / Price:

    Last Updated:

    Category:
    Peter Karman | More programs
    Perl Artistic License / FREE
    December 21st, 2007, 01:49 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    CatalystX::CRUD::Tutorial description

    CatalystX::CRUD::Tutorial is a step-by-step through CatalystX::CRUD example app.

    CatalystX::CRUD::Tutorial is a step-by-step through CatalystX::CRUD example app.

    OVERVIEW

    The goal of the CatalystX::CRUD project is to provide a thin glue between your existing data model code and your existing form processing code. The ideal CatalystX::CRUD application actually uses very little Catalyst-specific code. Instead, code independent of Catalyst does most of the heavy lifting. This design is intended to (a) make it easier to re-use your non-Catalyst code and (b) make your applications easier to test.

    This tutorial is intended for users of CatalystX::CRUD. Developers should also look at the CatalystX::CRUD API documentation. We will look at two of the CatalystX::CRUD implementations: the Rose::HTML::Objects controller (CatalystX::CRUD::Controller::RHTMLO) and the Rose::DB::Object model (CatalystX::CRUD::Model::RDBO). Note that these two modules are available on CPAN separately from the core CatalystX::CRUD package.

    Create a new Catalyst application

    % catalyst.pl MyApp
    ...
    % cd MyApp
    Make a directory structure to accomodate the classes we'll be creating:
    % mkdir lib/MyCRUD
    % mkdir lib/MyCRUD/Album
    % mkdir lib/MyCRUD/Song

    Create a database

    This tutorial will assume SQLite as the database, but any RDBO-supported database should work. You might need to tweek the SQL below to work with your particular database.

    /* example SQL file to init db */

    create table albums
    (
    id INTEGER primary key,
    title varchar(128),
    artist varchar(128)
    );

    create table songs
    (
    id INTEGER primary key,
    title varchar(128),
    artist varchar(128),
    length varchar(16)
    );

    create table album_songs
    (
    album_id int not null references albums(id),
    song_id int not null references songs(id)
    );

    insert into albums (title, artist) values ('Blonde on Blonde', 'Bob Dylan');
    insert into songs (title, length) values ('Visions of Johanna', '8:00');

    Save the above into a file called mycrud.sql and then create the SQLite database:

    % sqlite3 mycrud.db < mycrud.sql

    Test your database by connecting and verifying the data:

    % sqlite3 mycrud.db
    SQLite version 3.1.3

    Enter ".help" for instructions
    sqlite> select * from songs;
    1|Visions of Johanna||8:00
    sqlite> .quit

    Now you are ready to write some Perl.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    CatalystX::CRUD tutorial | CatalystX::CRUD example | Perl module | CatalystX::CRUD | tutorial | example

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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