SlideShare a Scribd company logo
1 of 22
Download to read offline
Catalyst - refactor & have fun


            – refactor large apps
            with tE@M (of individuals)
                   and have fun!

       Adam Bartosik, krakow.pm
What we had?




                                  24
    Existing datawarehouse with CGI web interface





     365
    working (mostly) 24h*365



    build by many people



    Perl supports individuality



    Large projects HATE this

What we had?

    Codebase: different styles of programming /


    how perl was growing
        in-line script / eval { main() } / procedural
    


        split into packages
    



    3 approaches to html templates



    3 database wrappers



    own date-time counting libs



    hacks, hacks, hacks.../ bugs, bugs, bugs...

What we had / we want

    perl is not too formal a language. Great for


    things you need to change,
    develop the way you've never thought before
    /what we mostly do/.
    The bigger a perl project is,


    the more rules you need to obey.
    warnings, strict, perl-critic are just about code


    quality, not about design practices
    XP, test-approach, test-suits - hard to start but


    make work easier, safer and faster (changes
    are welcome!)
What we want?

    make it the best possible way



    make it easier



    maintainable



    learn something new, have fun :)

Choosing new platform

    hours of talking, advocating



    use CPAN instead of self-made libs (opposit to


    company politic?)
        they have better doc
    


        better tested
    


        are still being developed
    


        eg. DateTime is slower than simple $date, but
    

        checks ranges
        SQL::Abstract can quote everything
    


        TT can move view-logic to templates
    
web framework needed!

    we don't like to deal with sessions, url handling,


    redirecting (handling simple redirect in cgi is
    NOT simple)
    CGI::App is like glue, but we need fundaments



    it should be popular enough to have some


    support level /work must be done/
    so the winner is...

Catalyst ++

    Catalyst – similar to Rails



    MVC – code / layout / data source


    MUST (/should) be split :)
    directory layout



    can start web app in a minute



    most of web tasks (sessions, url mapping,


    redirects) are one-liners
    self server to test changes (quick start for


    developers)
Catalyst --

    hard to find good doc (but going better)



    too flexible, TIMTOWTDI



        what to use for O/R mapping?
    


        which templates?
    


        type of config file?
    


        session storage?
    


        view type?
    



    Rails, Django are easier to start with, have


    better doc, marketing, hype, ”proper way to do
    it”
Learning curve




                    ?
    start-up: first 2-3 weeks are the worst



    tutos, docs, advent calendars, Handel, different


    approaches, different results
    logical or a crap we wasting time on?

Learning curve
    Template Toolkit make life easier:



         pass complex data [ {name=>bar}, {name=>baz} ]
     

         to templates, iterations are done in tpl
         <ul> [% FOREACH row IN rows %]
     

          <li>[% row.name %]
         [% END %] </ul>
         easy Ajax integration
     


         can switch totally different layouts (we needed it 3
     

         months later – nice to be possible do this without big
         hacks)
    Don't forget Mason => no another lang in tpl

Learning curve

    DBIx::Class – rapid ORM interface



        use when it is worth to use
    


        it is not trivial to rewrite complex SQL queries to
    

        dbix, does not simplify complicated joins (we have
        datawarehouse, a little more than blog – SQL can be simpler)
        dbix is powerfull for data updating
    


        $post = $c->model('app::comment')->create({
    

         nick => $c->req->{'nick'},
         value => $c->req->{'value'} });
        $post->update;
Learning curve

    Easy ”hard CGI things”



        dynamic redirect (after save, redirect user to eg.
    

        main page)

        sub save : Local {
          my ($self, $c) = @_;
          # save
          # redirect
          $c->res->redirect($c->uri_for('/'));
        }
Learning curve

    Global ”catch-flag”, eg:



        change language
    


        choose output format
    

        app/Controller/Root.pm

        sub pdf : Regex('.?pdf$') {
          my ($self, $c) = @_;
          my $redir = $c->req->path;
          $redir =~ s/.pdf$//;
          $c->stash->{output_pdf} = 1;
          $redirect =~ s{/$}{/index};
          $c->forward($redirect);
        }
Learning curve

    Preserve link layout (when SEO matters)





    URL: /news/what-about-perl6.html

    sub news : LocalRegex('^/(.+).html$') {
      my ($self, $c) = @_;
      my $title = $c->req->captures->[0];
      # find this article by $title...
    }
Learning curve

    Still no best answer to all


    form/multiform/validation tasks.
        HTML::Widget
    


        Form::Builder
    


        everything is possible, but typically breaks mvc
    



    MVC: Forms design should be in templates


    (view, css, layout), not in controllers,
    validation rules for input data should be placed
    in models (see Rails approach)
Learning curve
    Web-services – SOAP, XML-RPC, REST – to


    share data with other systems/projects
        just output xml/yaml/anything
    

        sub xml : Local {
          $c->res->body(XMLout($data)); # kiss/works
        }
        build simple controller with pure TT and xml
    

        template (fast when you must pass defined output,
        DTD/Schema)
        many plugins/controllers in CPAN, eg.
    

        C::P::Flavour, see also Catalyst Cookbook / simply
        ask what kind of abstraction for WS you need
Catalyst is social!

    easy to work together – code is split /by design/


    into many parts
    no global switches/routing rules => less


    conflicts in code repository
    the team can scale: start with 2, growth to 5 or


    more
Catalyst is social!

     We must obey some rules & conventions – what,
 

     where, how – work in team need some rules
     => they make life easier
     why develop own libs when there are so many
 

     good on CPAN? We can fix bugs, extend them,
     contribute to open source
         less own codebase => lower costs
     


         more developers => better approaches
     


         other features => can need them in 2 or 3 months
     
Benefits after time

    Months of active developemt but codebase is


    still fresh (and it is perl, true!)
        Clear design
    


        Only ”business application” code
    


        Less to type
    



    We can make deep changes:



        multi-level caches for balanced nodes
    

        with pre-caching
        change layout as often as is needed by marketing :)
    
Benefits after time


    Catalyst works like a web-processing


    meta-language
    It is not that (dirty) perl, it is a Catalyst

see in Krakow!

      Thanks - krakow perl mongers

More Related Content

What's hot

WP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperWP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperChandra Patel
 
Bring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle CloudBring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle CloudDimitri Gielis
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9Derek Jacoby
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsMatthew Beale
 
Debugging Drupal - How to Debug your Drupal Application
Debugging Drupal - How to Debug your Drupal ApplicationDebugging Drupal - How to Debug your Drupal Application
Debugging Drupal - How to Debug your Drupal ApplicationZyxware Technologies
 
[drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance![drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance!DrupalDay
 
EG Reports - Delicious Data
EG Reports - Delicious DataEG Reports - Delicious Data
EG Reports - Delicious DataBenjamin Shum
 
Sparkling Water, ASK CRAIG
Sparkling Water, ASK CRAIGSparkling Water, ASK CRAIG
Sparkling Water, ASK CRAIGSri Ambati
 
Developing OpenResty Framework
Developing OpenResty FrameworkDeveloping OpenResty Framework
Developing OpenResty FrameworkOpenRestyCon
 
Building Recoverable (and optionally async) Pipelines with Apache Spark (+ s...
Building Recoverable (and optionally async) Pipelines with Apache Spark  (+ s...Building Recoverable (and optionally async) Pipelines with Apache Spark  (+ s...
Building Recoverable (and optionally async) Pipelines with Apache Spark (+ s...Holden Karau
 
JavaScript - No Longer A Toy Language
JavaScript - No Longer A Toy LanguageJavaScript - No Longer A Toy Language
JavaScript - No Longer A Toy LanguageKMS Technology
 
How we maintain 200+ Drupal sites in Georgetown University
How we maintain 200+ Drupal sites in Georgetown UniversityHow we maintain 200+ Drupal sites in Georgetown University
How we maintain 200+ Drupal sites in Georgetown UniversityOvadiah Myrgorod
 
Internationalizing The New York Times
Internationalizing The New York TimesInternationalizing The New York Times
Internationalizing The New York TimesScott Taylor
 
WP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperWP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperChandra Patel
 

What's hot (20)

WP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperWP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of Developer
 
Dev streams2
Dev streams2Dev streams2
Dev streams2
 
Bring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle CloudBring the light in your Always FREE Oracle Cloud
Bring the light in your Always FREE Oracle Cloud
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
Debugging Drupal - How to Debug your Drupal Application
Debugging Drupal - How to Debug your Drupal ApplicationDebugging Drupal - How to Debug your Drupal Application
Debugging Drupal - How to Debug your Drupal Application
 
[drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance![drupalday2017] - Speed-up your Drupal instance!
[drupalday2017] - Speed-up your Drupal instance!
 
Designing net-aws-glacier
Designing net-aws-glacierDesigning net-aws-glacier
Designing net-aws-glacier
 
EG Reports - Delicious Data
EG Reports - Delicious DataEG Reports - Delicious Data
EG Reports - Delicious Data
 
Sparkling Water, ASK CRAIG
Sparkling Water, ASK CRAIGSparkling Water, ASK CRAIG
Sparkling Water, ASK CRAIG
 
Developing OpenResty Framework
Developing OpenResty FrameworkDeveloping OpenResty Framework
Developing OpenResty Framework
 
Laravel level 0 (introduction)
Laravel level 0 (introduction)Laravel level 0 (introduction)
Laravel level 0 (introduction)
 
NetflixOss Stack
NetflixOss StackNetflixOss Stack
NetflixOss Stack
 
Laravel level 2 (Let's Practical)
Laravel level 2 (Let's Practical)Laravel level 2 (Let's Practical)
Laravel level 2 (Let's Practical)
 
Building Recoverable (and optionally async) Pipelines with Apache Spark (+ s...
Building Recoverable (and optionally async) Pipelines with Apache Spark  (+ s...Building Recoverable (and optionally async) Pipelines with Apache Spark  (+ s...
Building Recoverable (and optionally async) Pipelines with Apache Spark (+ s...
 
Laravel Level 1 (The Basic)
Laravel Level 1 (The Basic)Laravel Level 1 (The Basic)
Laravel Level 1 (The Basic)
 
JavaScript - No Longer A Toy Language
JavaScript - No Longer A Toy LanguageJavaScript - No Longer A Toy Language
JavaScript - No Longer A Toy Language
 
How we maintain 200+ Drupal sites in Georgetown University
How we maintain 200+ Drupal sites in Georgetown UniversityHow we maintain 200+ Drupal sites in Georgetown University
How we maintain 200+ Drupal sites in Georgetown University
 
Internationalizing The New York Times
Internationalizing The New York TimesInternationalizing The New York Times
Internationalizing The New York Times
 
WP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperWP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of Developer
 

Similar to Catalyst - refactor large apps with it and have fun!

Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Mir Nazim
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracketjnewmanux
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsErik Osterman
 
Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023Bernd Alter
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesUdita Plaha
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010singingfish
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteDr Nic Williams
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBUniFabric
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbMongoDB APAC
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Codemotion
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress DevelopmentAdam Tomat
 

Similar to Catalyst - refactor large apps with it and have fun! (20)

Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracket
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/Ops
 
Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023Don't you (forget about me) - PHP Meetup Lisboa 2023
Don't you (forget about me) - PHP Meetup Lisboa 2023
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails Slides
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
 
Ad505 dev blast
Ad505 dev blastAd505 dev blast
Ad505 dev blast
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Api Design
Api DesignApi Design
Api Design
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
JavaScripts & jQuery
JavaScripts & jQueryJavaScripts & jQuery
JavaScripts & jQuery
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
Buildingsocialanalyticstoolwithmongodb
BuildingsocialanalyticstoolwithmongodbBuildingsocialanalyticstoolwithmongodb
Buildingsocialanalyticstoolwithmongodb
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
 

Recently uploaded

Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfAdmir Softic
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...Paul Menig
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Roland Driesen
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityEric T. Tung
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...lizamodels9
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Centuryrwgiffor
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 

Recently uploaded (20)

Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
 
Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...Boost the utilization of your HCL environment by reevaluating use cases and f...
Boost the utilization of your HCL environment by reevaluating use cases and f...
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 

Catalyst - refactor large apps with it and have fun!

  • 1. Catalyst - refactor & have fun – refactor large apps with tE@M (of individuals) and have fun! Adam Bartosik, krakow.pm
  • 2. What we had? 24 Existing datawarehouse with CGI web interface  365 working (mostly) 24h*365  build by many people  Perl supports individuality  Large projects HATE this 
  • 3. What we had? Codebase: different styles of programming /  how perl was growing in-line script / eval { main() } / procedural  split into packages  3 approaches to html templates  3 database wrappers  own date-time counting libs  hacks, hacks, hacks.../ bugs, bugs, bugs... 
  • 4. What we had / we want perl is not too formal a language. Great for  things you need to change, develop the way you've never thought before /what we mostly do/. The bigger a perl project is,  the more rules you need to obey. warnings, strict, perl-critic are just about code  quality, not about design practices XP, test-approach, test-suits - hard to start but  make work easier, safer and faster (changes are welcome!)
  • 5. What we want? make it the best possible way  make it easier  maintainable  learn something new, have fun :) 
  • 6. Choosing new platform hours of talking, advocating  use CPAN instead of self-made libs (opposit to  company politic?) they have better doc  better tested  are still being developed  eg. DateTime is slower than simple $date, but  checks ranges SQL::Abstract can quote everything  TT can move view-logic to templates 
  • 7. web framework needed! we don't like to deal with sessions, url handling,  redirecting (handling simple redirect in cgi is NOT simple) CGI::App is like glue, but we need fundaments  it should be popular enough to have some  support level /work must be done/ so the winner is... 
  • 8. Catalyst ++ Catalyst – similar to Rails  MVC – code / layout / data source  MUST (/should) be split :) directory layout  can start web app in a minute  most of web tasks (sessions, url mapping,  redirects) are one-liners self server to test changes (quick start for  developers)
  • 9. Catalyst -- hard to find good doc (but going better)  too flexible, TIMTOWTDI  what to use for O/R mapping?  which templates?  type of config file?  session storage?  view type?  Rails, Django are easier to start with, have  better doc, marketing, hype, ”proper way to do it”
  • 10. Learning curve ? start-up: first 2-3 weeks are the worst  tutos, docs, advent calendars, Handel, different  approaches, different results logical or a crap we wasting time on? 
  • 11. Learning curve Template Toolkit make life easier:  pass complex data [ {name=>bar}, {name=>baz} ]  to templates, iterations are done in tpl <ul> [% FOREACH row IN rows %]  <li>[% row.name %] [% END %] </ul> easy Ajax integration  can switch totally different layouts (we needed it 3  months later – nice to be possible do this without big hacks) Don't forget Mason => no another lang in tpl 
  • 12. Learning curve DBIx::Class – rapid ORM interface  use when it is worth to use  it is not trivial to rewrite complex SQL queries to  dbix, does not simplify complicated joins (we have datawarehouse, a little more than blog – SQL can be simpler) dbix is powerfull for data updating  $post = $c->model('app::comment')->create({  nick => $c->req->{'nick'}, value => $c->req->{'value'} }); $post->update;
  • 13. Learning curve Easy ”hard CGI things”  dynamic redirect (after save, redirect user to eg.  main page) sub save : Local { my ($self, $c) = @_; # save # redirect $c->res->redirect($c->uri_for('/')); }
  • 14. Learning curve Global ”catch-flag”, eg:  change language  choose output format  app/Controller/Root.pm sub pdf : Regex('.?pdf$') { my ($self, $c) = @_; my $redir = $c->req->path; $redir =~ s/.pdf$//; $c->stash->{output_pdf} = 1; $redirect =~ s{/$}{/index}; $c->forward($redirect); }
  • 15. Learning curve Preserve link layout (when SEO matters)  URL: /news/what-about-perl6.html sub news : LocalRegex('^/(.+).html$') { my ($self, $c) = @_; my $title = $c->req->captures->[0]; # find this article by $title... }
  • 16. Learning curve Still no best answer to all  form/multiform/validation tasks. HTML::Widget  Form::Builder  everything is possible, but typically breaks mvc  MVC: Forms design should be in templates  (view, css, layout), not in controllers, validation rules for input data should be placed in models (see Rails approach)
  • 17. Learning curve Web-services – SOAP, XML-RPC, REST – to  share data with other systems/projects just output xml/yaml/anything  sub xml : Local { $c->res->body(XMLout($data)); # kiss/works } build simple controller with pure TT and xml  template (fast when you must pass defined output, DTD/Schema) many plugins/controllers in CPAN, eg.  C::P::Flavour, see also Catalyst Cookbook / simply ask what kind of abstraction for WS you need
  • 18. Catalyst is social! easy to work together – code is split /by design/  into many parts no global switches/routing rules => less  conflicts in code repository the team can scale: start with 2, growth to 5 or  more
  • 19. Catalyst is social! We must obey some rules & conventions – what,  where, how – work in team need some rules => they make life easier why develop own libs when there are so many  good on CPAN? We can fix bugs, extend them, contribute to open source less own codebase => lower costs  more developers => better approaches  other features => can need them in 2 or 3 months 
  • 20. Benefits after time Months of active developemt but codebase is  still fresh (and it is perl, true!) Clear design  Only ”business application” code  Less to type  We can make deep changes:  multi-level caches for balanced nodes  with pre-caching change layout as often as is needed by marketing :) 
  • 21. Benefits after time Catalyst works like a web-processing  meta-language It is not that (dirty) perl, it is a Catalyst 
  • 22. see in Krakow! Thanks - krakow perl mongers