Desperately Seeking a lightweight Perl web framework Peter
Desperately Seeking… a lightweight Perl web framework Peter Edwards Desperately seeking. . . a lightweight Perl web framework 1 3/4/2021
Introduction l Peter Edwards ~ background Subject l Explain about the processes and decision making involved in assessing, selecting and using a Perl web framework Desperately seeking. . . a lightweight Perl web framework 2 3/4/2021
Aims Learn what frameworks are out there l Technical considerations l Business tools for decision-making l Ø Audience: What is your background and interest? Desperately seeking. . . a lightweight Perl web framework 3 3/4/2021
Topics l l l l l Define the problem Example requirements Attributes of frameworks Business decision making tools Architecture Application components Perl application frameworks Roll your own Summary Desperately seeking. . . a lightweight Perl web framework 4 3/4/2021
Define the Problem Why do you need a web app? l What functionality / how complex? l no. screens, other features, e. g. search engine, integration to other apps/components/company infrastructure, server platform l Business setting Project length, size; Developer expertise, skill sets; Integration to network, database type, existing frameworks e. g. ADS authentication; Capacity plan - no. of users and required performance Desperately seeking. . . a lightweight Perl web framework 5 3/4/2021
Example http: //merlinfootball. com l Components Flash front end, sending XML transactions to Perl back end Perl XHTML admin system l Elements Huge volume of users and transactions Streaming video Picture upload and approval to gallery FAQ submission, approval and editing into FAQ list Desperately seeking. . . a lightweight Perl web framework 6 3/4/2021
Attributes of Frameworks Size -> complexity l Learning curve l Vertical vs. horizontal l Functionality, flexibility l Monotheistic/"One True Way" vs. agnostic l Increased power, reduced performance l Cost of testing new code = 50% of time l By extension DRY KISS l Desperately seeking. . . a lightweight Perl web framework 7 3/4/2021
Business Decision Making Tools The point of business Increased shareholder value - cash William of Occam, 14 th century logician and Franciscan friar entia non sunt multiplicanda praeter necessitatem entities should not be multiplied beyond necessity "All things being equal, the simplest solution tends to be the best one. “ It often happens that the best explanation is much more complicated than the simplest possible explanation because it requires fewer assumptions. Pareto Principle, by Joseph M. Juran named after Vilfredo Pareto, Italian economist "for many phenomena, 80% of the consequences stem from 20% of the causes“ -- en. wikipedia. org Cost Benefit Analysis Estimate days for development Estimate hidden costs and benefits e. g. of more stable framework Cost comparison -> decision Perfection vs. pragmatism Desperately seeking. . . a lightweight Perl web framework 8 3/4/2021
Architecture I l Web Protocol l Web Server l Controller Processing HTTP request/response URI, REST, URL parameters http: //server. com/client/view/FRED? view=xml& tabs=all Web 2. 0, AJAX Apache, IIS, lighttpd CGI/mod_perl, Fast. CGI Apache registry style stacked phase handlers MVC Model View Controller Single entry point vs. separate CGI Desperately seeking. . . a lightweight Perl web framework 9 3/4/2021
Architecture II l Session l Security l Database layer CGI: : Session Apache: : Session Catalyst: : Plugin: : Session -> Cache: : Fast. MMap Authentication Group permission roles HTML field and SQL field encoding Direct DBI Simple Class: : DBI ORM Object Relational Mapper DBIx: : Class Rose: : DB Performance considerations - DBI 10 -100 x faster Data object attributes - data dictionary - screen dictionary Desperately seeking. . . a lightweight Perl web framework 10 3/4/2021
Architecture III l Templates l Testing Template: : Toolkit (TT 2) variable merge, not too complex, encourages using Perl in app modules HTML: : Mason – inline code Personal preference; understandable by Web designers XHTML, accessibility, internationalisation Locale: : Maketext Form handling, CRUD from db object, validation Data: : Form. Validator Rich components http: //script. aculo. us/ http: //dojotoolkit. org/ module unit test, business data object tests, Javascript/browser compatability checks Test: : More Test: : WWW: : Mechanize Test: : WWW: : Selenium Desperately seeking. . . a lightweight Perl web framework 11 3/4/2021
Application Components l Pre-built components save time in short term on testing; may cost more long term; integration costs PHP: : Session Language Repository Template Component Perl CPAN TT 2 Bricolage PHP PEAR Smarty CMSMS Python Built-in Clearsilver Trac Desperately seeking. . . a lightweight Perl web framework 12 3/4/2021
Perl Application Frameworks l CGI: : Application + CGI: : Session lightweight, easy to use, reliable, full control, open Watch out for CGI: : Builder, based on CGI: : App but used to have Makefile. PL that downloaded and eval'd code, also bizarre "Perlish" coding style ; ; l l l use 5. 006_001 use Carp $Carp: : Internal{+__PACKAGE__}++ $Carp: : Internal{__PACKAGE__. ': : _'}++ CGI: : Framework ; use IO: : Util fixed - glue between HTML: : Template, CGI: : Session, CGI, Locale: : Maketext last release 11 -Oct-2005 Jifty one true way: database mapper, template, web services, AJAX toolkit, handlers for Fast. CGI continuations, form-based dispatch "Jifty is the only web application framework that comes with a pony“ Gantry + Bigtop Apache/mod_perl, MVC Bigtop - web application data language processor, app generator Open. Interact + SPOPS Complex, slow, powerful, CMS-oriented permissions last release 18 -Mar-2005 Catalyst agnostic, MVC, complex, magic, powerful, slow (third time in NEXT/C 3 OO extension), well tested Works well with DBIx: : Class and TT 2; can also use Class: DBI, HTML: : Mason Many plugins for auth, XML etc. Maypole (ancestor of Catalyst) similar approach Class: : DBI, TT 2 Desperately seeking. . . a lightweight Perl web framework 13 3/4/2021
Roll Your Own l l l "Not invented here" syndrome, AKA submitting a module to CPAN with "Lite" or "Plus" in the name. Can base on CGI: : Application + CGI: : Session Or write one yourself. Easier than you'd think. Here's one written in a week, not pretty but delivered a project delivered fast and on time: http: //perl. dragonstaff. co. uk/app. zip Desperately seeking. . . a lightweight Perl web framework 14 3/4/2021
Summary Processes and decision making l requirements l business context l CBA decision basis l technical considerations, architecture, constraints and features l application components l Perl application frameworks Desperately seeking. . . a lightweight Perl web framework 15 3/4/2021
Where to Get More Information l CPAN http: //search. cpan. org l Books Ø Any Questions l These slides are at http: //perl. dragonstaff. co. uk/ Desperately seeking. . . a lightweight Perl web framework 16 3/4/2021
- Slides: 16