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

    Jifty::Manual::ObjectModel 0.71129

    Download button

    No screenshots available
    Downloads: 308  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.2/5)
    4 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Shawn M Moore | More programs
    Perl Artistic License / FREE
    January 29th, 2008, 14:17 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Jifty::Manual::ObjectModel description

    Jifty::Manual::ObjectModel is an overview of the Jifty object model.

    Jifty::Manual::ObjectModel is an overview of the Jifty object model.

    Jifty applications are generally built in a similar way. There's no reason you need to use the model we've built, but we find it a reasonably ok way to do things.

    This document should serve as a roadmap to the Jifty class library, as well as an introduction to the way Jifty applications are put together.
    We start with the classes in your application and move on to the bits of Jifty itself.

    If you create a brand new application, let's call it MyWeblog, and create one model class called MyWeblog::Post, you'll end up with the following files and directories:

    MyWeblog/
    etc/
    config.yml
    lib/
    MyWeblog/
    Model/
    Post.pm
    Action/
    bin/
    jifty

    web/
    templates/
    static/

    t/
    #some test files.

    At least that's the scaffolding Jifty creates for you. Behind the scenes, Jifty is actually doing a lot more. Rather than create a bunch of little "stub" classes and libraries for you, Jifty generates them on the fly. It's always possible to actually create these libraries when you need to customize the default behavior, but we work really hard to make sure you don't need to.
    Right now, Jifty is autocreating libraries, static web pages and web templates.

    We're not 100% satisfied with how Jifty autocreates web templates and static pages and are working to redesign that.

    The library you see when creating a Jifty app is:

    MyWeblog::Model::Post

    MyWeblog::Model::Post describes the schema and business logic of your post class. It uses two namespaces, MyWeblog::Model::Post::Schema that has actual column definitions and MyWeblog::Model::Post that contains the (optional) business logic, access control and so on.

    That's it. But if you look carefully at MyWeblog::Model::Post, you'll see the line:

    use base qw/MyWeblog::Record/;

    How can that possibly work? There is no MyWeblog::Record class in your application. And Jifty, while it tries to be a comprehensive framework, draws the line somewhat short of including application-specific base classes for every application you might possibly contrive.

    The answer lies in Jifty::ClassLoader, a utility module Jifty uses to create the boring stuff for you when you need it.

    It'd certainly be possible for Jifty to create every class you might need as a file on disk when you first create your application (and indeed we may decide to do so if enough people yell at us), but when the stub classes we'd provide are just little shims that inherit from or call to the Jifty core, it doesn't make much sense to create them before you need them. You could build a Jifty application without these shims by having your model classes inherit directly from Jifty::Record, but then you'll run into trouble the second you want to add application-specific code and have to go back and retrofit each and every one of your classes to use your new base class. It's a little thing, but one that can save you a bunch of pain and suffering later on.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Jifty manual | object model | Perl module | Jifty | manual | object

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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