Perl Development Manual

Contents:

  1. Introduction
    1. Helper
    2. Accessor
    3. CGI Script
    4. Database Methods
  2. Model
    1. Genelet::Model
    2. Add Class Method
    3. Project
    4. Component
    5. Pagination
    6. JOIN Tables
    7. Triggers
  3. Filter
    1. Accessors and ACL
    2. File Uploading
    3. RLS
    4. Get Action
    5. Preset
    6. Before
    7. After
    8. Sending Email

 

Download

The Perl Framework can be downloaded from GitHub:
git clone git@github.com:genelet/perl.git YOUR_DIRECTORY

 

Best Practice

Here is the list of few guidelines you should follow in design of classes.

  • Class attributes are always expressed in upper-cases.
  • In class methods, always return nothing from a successful run, otherwise, return an error code or error string.
  • Use setup_accessors to build Getter, Setter for attributes and to initialize them.

 

For Experienced Developers

The Perl version of Genelet is nothing more than a collection of well-thought CGI/FCGI packages to develop large-scale web project in a convenience, fast and organized way. While you are still be able to do everything in your own style, the packages are aimed nevertheless to be the most efficient and elegant solutions.

Genelet will force you, and guarantee you, to have a clean set-up and development foundation that would grow linearly, not exponentially with the size of project. Instead of digging into legacy code and debugging, you could gain more time in designing business logic, data model, or planning future growth.

Genelet has little dependence on 3rd party packages. The list is very short. They are: JSON (for JSON), XML::LibXML (for XML), DBI (for database), LWP::UserAgent (for OAuth etc.), URI and URI::Escape (for URL manipulation), Digest::HMAC_SHA1 and MIME::Base64 (for security), Net::SMTP (for email), Template (for HTML5 templates), and Test::More (for unit testing). The minimal Perl version it works with is 8.10.

Future more, Genelet is a protocol. You can easily switch from Perl to GO or Java, or vice versa, with only a minimal effort. In particular, your database and public APIs will be kept the same.

 

For Novice Users

Genelet is in Object-Oriented Perl. It follows strict MVC pattern and provides full RESTful API access. Popular services like OAuth login, SMS and mobile push notifications etc. are built-in and ready to use. It has also a debugging tool to find problems. As an add-on, there is a bridge Javascript file for you to develop one-page website using Angular 1.3 web framework.

While Genelet is as powerful as, if not more powerful than, other frameworks, it is definitely a lot easier to learn and takes much shorter development circle to finish web project.

The only major idea that has not been incorporated into Genelet is ORM, Objected Relational Mapping. Alternatively, Genelet has its own packages to operate on database, include a complete set of CRUD/REST subroutines to run raw SQLs and stored procedures. However, you can always bring in your favored ORM. Genelet works with every CPAN module in the same way as a normal Perl program.

 

Virtual Hosting

For those working under a virtual hosting environment, Genelet is always able to run in the CGI mode. It would be very likely to run in the Fast CGI mode too, as far as the virtual hosting provider runs PHP under Apache’s mod_fcgid.  You can develop in CGI, and switch to Fast CGI anytime to gain the PHP speed.