SlideShare a Scribd company logo
1 of 44
Download to read offline
Modern PerlCommerce
             Past and Future
                         API
   Development & Deployment




       Modern PerlCommerce

           Stefan Hornburg (Racke)
            racke@linuxia.de


Pittsburgh Perl Workshop, 8th October 2011




                       racke   Modern PerlCommerce
Modern PerlCommerce
                                     Perl Buzzwords
                   Past and Future
                                     Modern Perl
                               API
                                     PerlCommerce Choices
         Development & Deployment



Nitesi




                             racke   Modern PerlCommerce
Modern PerlCommerce
                                             Perl Buzzwords
                           Past and Future
                                             Modern Perl
                                       API
                                             PerlCommerce Choices
                 Development & Deployment



Perl Buzzwords




      Marketing Perl
      Modern Perl
      Postmodern Perl




                                     racke   Modern PerlCommerce
Modern PerlCommerce
                                               Perl Buzzwords
                             Past and Future
                                               Modern Perl
                                         API
                                               PerlCommerce Choices
                   Development & Deployment



Modern Perl




      CPAN
      Best Practices
      Tests
      Separation (Modules, Plugins, Hooks, Templates)
      PSGI/Plack




                                       racke   Modern PerlCommerce
Modern PerlCommerce
                                             Perl Buzzwords
                           Past and Future
                                             Modern Perl
                                       API
                                             PerlCommerce Choices
                 Development & Deployment



PerlCommerce Choices




      Interchange
      Handel
      Agora
      Business::Cart::Generic




                                     racke   Modern PerlCommerce
Modern PerlCommerce
                            Past and Future   Past
                                        API   Future
                  Development & Deployment



Past




       1995 CGI
       1995 MiniVend
       1998 http://www.materialboerse.de/
       2001 Interchange




                                      racke   Modern PerlCommerce
Modern PerlCommerce
                            Past and Future   Past
                                        API   Future
                  Development & Deployment



Interchange Development




      Lot of things
      Small community
      Same codebase




                                      racke   Modern PerlCommerce
Modern PerlCommerce
                       Past and Future   Past
                                   API   Future
             Development & Deployment



Status quo




                                 racke   Modern PerlCommerce
Modern PerlCommerce
                        Past and Future   Past
                                    API   Future
              Development & Deployment



References




      Backcountry http://www.backcountry.com/
      FragnanceNet http://www.fragrancenet.com/




                                  racke   Modern PerlCommerce
Modern PerlCommerce
                   Past and Future   Past
                               API   Future
         Development & Deployment



Future




                             racke   Modern PerlCommerce
Modern PerlCommerce
                              Past and Future   Past
                                          API   Future
                    Development & Deployment



Principles




       KISS
       Components
       Agnostic
       Expressive




                                        racke   Modern PerlCommerce
Modern PerlCommerce
                              Past and Future   Past
                                          API   Future
                    Development & Deployment



Agnostic




   Cart
          Session
          DBI
          Webservice *




                                        racke   Modern PerlCommerce
Modern PerlCommerce
                            Past and Future   Past
                                        API   Future
                  Development & Deployment



Agnostic




   Account Manager
       DBI
       LDAP *
       OpenID *




                                      racke   Modern PerlCommerce
Modern PerlCommerce
                             Past and Future   Past
                                         API   Future
                   Development & Deployment



Agnostic




   Templating Engine
       Template::Toolkit
       Template::Flute




                                       racke   Modern PerlCommerce
Modern PerlCommerce
                             Past and Future   Past
                                         API   Future
                   Development & Deployment



Agnostic




   Web framework
       Catalyst
       Mojo
       Dancer




                                       racke   Modern PerlCommerce
Modern PerlCommerce
                           Past and Future   Past
                                       API   Future
                 Development & Deployment



Preferences




      Dancer
      Template::Flute
      DBI




                                     racke   Modern PerlCommerce
Modern PerlCommerce
                          Past and Future   Past
                                      API   Future
                Development & Deployment



Framework




     Dispatching requests
     Parameter parsing
     Session handling
     Template engine
     I18N




                                    racke   Modern PerlCommerce
Modern PerlCommerce
                          Past and Future   Past
                                      API   Future
                Development & Deployment



Extensions




      Bundles
      Plugins
      Hooks




                                    racke   Modern PerlCommerce
Modern PerlCommerce
                             Past and Future   Past
                                         API   Future
                   Development & Deployment



Features




      Navigation
      Cart
      Checkout
      Accounts




                                       racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                             Past and Future   Checkout
                                         API   Accounts and Access Control
                   Development & Deployment    Forms



Cart



       SKU, Name, Quantity, Price
       Price > 0
       Combines automatically
       Multiple carts
       Storage everywhere
       Price caching




                                       racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                                          Past and Future   Checkout
                                                      API   Accounts and Access Control
                                Development & Deployment    Forms



Nitesi::Cart Methods

   use Dancer : : P l u g i n : : N i t e s i ;

   c a r t βˆ’>add ( sku => ’POM253 ’ , name => ’ Pomelo ’ ,
           p r i c e => 3 . 0 0 , q u a n t i t y => 1 0 ) ;

   c a r t βˆ’>remove ( sku => ’POM253 ’ ) ;

   c a r t βˆ’>count ( ) ;

   c a r t βˆ’>c l e a r ( ) ;

   c a r t βˆ’> t o t a l ( ) ;

   c a r t βˆ’>s u b t o t a l ( ) ;



                                                    racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                               Past and Future   Checkout
                                           API   Accounts and Access Control
                     Development & Deployment    Forms



Everything is a Cart




       Saved Carts
       Wishlists
       Collections




                                         racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                                 Past and Future   Checkout
                                             API   Accounts and Access Control
                       Development & Deployment    Forms



Multiple Carts




   c a r t ( ’ w i s h l i s t ’ )βˆ’>add ( sku => ’ORA322 ’ , name => ’ Orange ’ ,
             p r i c e => 2 . 0 0 , q u a n t i t y => 5 ) ;




                                           racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                          Past and Future   Checkout
                                      API   Accounts and Access Control
                Development & Deployment    Forms



Cart Backends




      Session
      DBI




                                    racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                                Past and Future   Checkout
                                            API   Accounts and Access Control
                      Development & Deployment    Forms



Inventory Check




   MinQuantityField min_quantity
   MaxQuantityField inventory : q u a n t i t y




                                          racke   Modern PerlCommerce
Modern PerlCommerce       Cart
                                    Past and Future     Checkout
                                                API     Accounts and Access Control
                          Development & Deployment      Forms



Inventory Check Hook


   hook ’ b e f o r e _ c a r t _ a d d ’ => sub {
       my ( $ c a r t , $item ) = @_;
       my ( $ i n v e n t o r y ) ;

         $ i n v e n t o r y = query βˆ’> s e l e c t _ f i e l d ( t a b l e => ’ p r o d u c t s ’ ,
                                                                  f i e l d => ’ i n v e n t o r y ’ ,
                                                                  where => { sku => $item βˆ’>{sku } } ) ;

         i f ( $item βˆ’>{ q u a n t i t y } > $ i n v e n t o r y ) {
               $item βˆ’>{ e r r o r } = ’ Out o f s t o c k ’ ;
         }
   };




                                              racke     Modern PerlCommerce
Modern PerlCommerce     Cart
                           Past and Future   Checkout
                                       API   Accounts and Access Control
                 Development & Deployment    Forms



Cart Hooks




      before_cart_add
      after_cart_add




                                     racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                          Past and Future   Checkout
                                      API   Accounts and Access Control
                Development & Deployment    Forms



Cart Hooks




      before_cart_remove
      after_cart_remove




                                    racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                           Past and Future   Checkout
                                       API   Accounts and Access Control
                 Development & Deployment    Forms



Checkout




      Taxes
      Shipping
      Payment
      Invoice




                                     racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                         Past and Future   Checkout
                                     API   Accounts and Access Control
               Development & Deployment    Forms



Payment




     Business::OnlinePayment




                                   racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                           Past and Future   Checkout
                                       API   Accounts and Access Control
                 Development & Deployment    Forms



Tax Modules on CPAN




      Business::Tax::Canada
      Business::CA::GST
      Business::Tax::VAT
      Business::Tax::VAT::Validation




                                     racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                          Past and Future   Checkout
                                      API   Accounts and Access Control
                Development & Deployment    Forms



Shipping




      Simple Shipping
      Crazy Shipping
      Shipping API




                                    racke   Modern PerlCommerce
Modern PerlCommerce      Cart
                                     Past and Future    Checkout
                                                 API    Accounts and Access Control
                           Development & Deployment     Forms



Costs




   $ c a r t βˆ’>a p p l y _ c o s t ( amount => 5 ) ;

   $ c a r t βˆ’>a p p l y _ c o s t ( amount => 0 . 1 9 , r e l a t i v e => 1 ) ;




                                               racke    Modern PerlCommerce
Modern PerlCommerce     Cart
                           Past and Future   Checkout
                                       API   Accounts and Access Control
                 Development & Deployment    Forms



PDF Invoices




      HTML template
      Template::Flute::PDF




                                     racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                                 Past and Future   Checkout
                                             API   Accounts and Access Control
                       Development & Deployment    Forms



Accounts



   p o s t ’ / l o g i n ’ => sub {
          i f ( account βˆ’>l o g i n ( username => params ( ’ body ’ ) βˆ’ >{username } ,
                                         password => params ( ’ body ’ ) βˆ’ >{password } ) ) {
                 r e d i r e c t ’ / customerservice ’ ;
          }
          else {
                 redirect ’ / login ’ ;
          }
   };




                                           racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                                   Past and Future   Checkout
                                               API   Accounts and Access Control
                         Development & Deployment    Forms



Accounts




   g e t ’ / checkout ’ => sub {
         i f ( account βˆ’>a c l ( check => ’ s u b m i t _ o r d e r s ’ ) ) {
               r e t u r n t e m p l a t e ’ checkout ’ ;
         }

         redirect      ’ / access_denied ’ ;
   };




                                             racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                           Past and Future   Checkout
                                       API   Accounts and Access Control
                 Development & Deployment    Forms



Account manager



      Account Providers
      Login/Logout
      Account Information
      Login status
      Forgot password
      Registration




                                     racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                             Past and Future   Checkout
                                         API   Accounts and Access Control
                   Development & Deployment    Forms



Account Provider




      DBI
      LDAP *
      Htpasswd *
      OpenID *
      OAuth *




                                       racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                           Past and Future   Checkout
                                       API   Accounts and Access Control
                 Development & Deployment    Forms



Access Control




      User
      Roles
      Permissions




                                     racke   Modern PerlCommerce
Modern PerlCommerce     Cart
                               Past and Future   Checkout
                                           API   Accounts and Access Control
                     Development & Deployment    Forms



Forms




        Display
        Validation
        Storage




                                         racke   Modern PerlCommerce
Modern PerlCommerce
                                                  Dancer
                                Past and Future
                                                  Contribution
                                            API
                                                  The End
                      Development & Deployment



Routes




         Categories
         Products
         Cart
         Checkout
         Login/Logout
         Customer Service




                                          racke   Modern PerlCommerce
Modern PerlCommerce
                                                      Dancer
                                   Past and Future
                                                      Contribution
                                               API
                                                      The End
                         Development & Deployment



Default Route

   g e t q r { / ( . βˆ— ) } => sub {
         my ( $sku ) = s p l a t ;
         my $ p r o d u c t ;

        # check f o r e x i s t i n g p r o d u c t
        i f ( $ p r o d u c t = database βˆ’>q u i c k _ s e l e c t ( ’ p r o d u c t s ’ , { sku => $sku } ) )
              # display flypage
              template ’ flypage ’ , $product ;
        }
        else {
              # d i s p l a y n o t found page
              s t a t u s ’ not_found ’ ;
              f o r w a r d ’ 404 ’ ;
        }
   };


                                             racke    Modern PerlCommerce
Modern PerlCommerce
                                          Dancer
                        Past and Future
                                          Contribution
                                    API
                                          The End
              Development & Deployment



CPAN/GitHub


     http://search.cpan.org/dist/Nitesi/
     http://search.cpan.org/dist/Nitesi-DBI/
     http://search.cpan.org/dist/
     Dancer-Plugin-Nitesi/

     https://github.com/racke/Nitesi
     https://github.com/racke/Nitesi-DBI
     https:
     //github.com/racke/Dancer-Plugin-Nitesi



                                  racke   Modern PerlCommerce
Modern PerlCommerce
                                          Dancer
                        Past and Future
                                          Contribution
                                    API
                                          The End
              Development & Deployment



The End




  Slides: http://www.linuxia.de/talks/perlcommerce/
  perlcommerce-beamer.pdf
  Project: https://vsc.state.gov/




                                  racke   Modern PerlCommerce

More Related Content

Similar to Modern PerlCommerce

Ruby on rails
Ruby on railsRuby on rails
Ruby on railsAmol Pujari
Β 
Practical Semantic Web
Practical Semantic WebPractical Semantic Web
Practical Semantic WebCarsonified Team
Β 
Ruby on rails | iteron
Ruby on rails | iteronRuby on rails | iteron
Ruby on rails | iteronIteron Group
Β 
API Best Practices
API Best PracticesAPI Best Practices
API Best PracticesAndreas Krohn
Β 
Ruby on rails api Development case study
Ruby on rails api Development case studyRuby on rails api Development case study
Ruby on rails api Development case studyInfigic Digital Solutions
Β 
[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.comMitch Okamoto
Β 
Mobile and API identity – The New Challenges
Mobile and API identity – The New ChallengesMobile and API identity – The New Challenges
Mobile and API identity – The New ChallengesCA API Management
Β 
Trends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop LondonTrends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop LondonCA API Management
Β 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The EnterpriseMatt Aimonetti
Β 
Laravel vs ASP.NET Framework .pdf
Laravel vs ASP.NET Framework .pdfLaravel vs ASP.NET Framework .pdf
Laravel vs ASP.NET Framework .pdfWPWeb Infotech
Β 
MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...
  MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...  MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...
MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...Spark Summit
Β 
Spark Summit East 2016 - MLeap Presentation
Spark Summit East 2016 -   MLeap PresentationSpark Summit East 2016 -   MLeap Presentation
Spark Summit East 2016 - MLeap PresentationMikhail Semeniuk
Β 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On RailsEric Berry
Β 
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)Benjamin Nowack
Β 
Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Rack Lin
Β 
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SFTechniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SFDaniel Jacobson
Β 
Top 15 Ruby on Rails (RoR) Gems by Code Garage Tech
Top 15 Ruby on Rails (RoR) Gems by Code Garage TechTop 15 Ruby on Rails (RoR) Gems by Code Garage Tech
Top 15 Ruby on Rails (RoR) Gems by Code Garage TechCode Garage Tech
Β 

Similar to Modern PerlCommerce (20)

Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
Β 
Practical Semantic Web
Practical Semantic WebPractical Semantic Web
Practical Semantic Web
Β 
Ruby on rails | iteron
Ruby on rails | iteronRuby on rails | iteron
Ruby on rails | iteron
Β 
API Best Practices
API Best PracticesAPI Best Practices
API Best Practices
Β 
Ruby on rails api Development case study
Ruby on rails api Development case studyRuby on rails api Development case study
Ruby on rails api Development case study
Β 
[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com[2011-17-C-4] Heroku & database.com
[2011-17-C-4] Heroku & database.com
Β 
Mobile and API identity – The New Challenges
Mobile and API identity – The New ChallengesMobile and API identity – The New Challenges
Mobile and API identity – The New Challenges
Β 
Trends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop LondonTrends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop London
Β 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
Β 
Laravel vs ASP.NET Framework .pdf
Laravel vs ASP.NET Framework .pdfLaravel vs ASP.NET Framework .pdf
Laravel vs ASP.NET Framework .pdf
Β 
MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...
  MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...  MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...
MLLeap, or How to Productionize Data Science Workflows Using Spark by Mikha...
Β 
Spark Summit East 2016 - MLeap Presentation
Spark Summit East 2016 -   MLeap PresentationSpark Summit East 2016 -   MLeap Presentation
Spark Summit East 2016 - MLeap Presentation
Β 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
Β 
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
Β 
SCIO : Apache Beam API
SCIO : Apache Beam APISCIO : Apache Beam API
SCIO : Apache Beam API
Β 
Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013
Β 
Techniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SFTechniques for Scaling the Netflix API - QCon SF
Techniques for Scaling the Netflix API - QCon SF
Β 
Varun-CV-J
Varun-CV-JVarun-CV-J
Varun-CV-J
Β 
MLeap: Release Spark ML Pipelines
MLeap: Release Spark ML PipelinesMLeap: Release Spark ML Pipelines
MLeap: Release Spark ML Pipelines
Β 
Top 15 Ruby on Rails (RoR) Gems by Code Garage Tech
Top 15 Ruby on Rails (RoR) Gems by Code Garage TechTop 15 Ruby on Rails (RoR) Gems by Code Garage Tech
Top 15 Ruby on Rails (RoR) Gems by Code Garage Tech
Β 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
Β 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
Β 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
Β 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
Β 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
Β 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Β 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
Β 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
Β 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
Β 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Β 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Β 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
Β 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
Β 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
Β 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Β 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
Β 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
Β 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
Β 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
Β 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Β 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Β 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Β 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
Β 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Β 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
Β 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Β 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
Β 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Β 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Β 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Β 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Β 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Β 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Β 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Β 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Β 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Β 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Β 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Β 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Β 

Modern PerlCommerce

  • 1. Modern PerlCommerce Past and Future API Development & Deployment Modern PerlCommerce Stefan Hornburg (Racke) racke@linuxia.de Pittsburgh Perl Workshop, 8th October 2011 racke Modern PerlCommerce
  • 2. Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment Nitesi racke Modern PerlCommerce
  • 3. Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment Perl Buzzwords Marketing Perl Modern Perl Postmodern Perl racke Modern PerlCommerce
  • 4. Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment Modern Perl CPAN Best Practices Tests Separation (Modules, Plugins, Hooks, Templates) PSGI/Plack racke Modern PerlCommerce
  • 5. Modern PerlCommerce Perl Buzzwords Past and Future Modern Perl API PerlCommerce Choices Development & Deployment PerlCommerce Choices Interchange Handel Agora Business::Cart::Generic racke Modern PerlCommerce
  • 6. Modern PerlCommerce Past and Future Past API Future Development & Deployment Past 1995 CGI 1995 MiniVend 1998 http://www.materialboerse.de/ 2001 Interchange racke Modern PerlCommerce
  • 7. Modern PerlCommerce Past and Future Past API Future Development & Deployment Interchange Development Lot of things Small community Same codebase racke Modern PerlCommerce
  • 8. Modern PerlCommerce Past and Future Past API Future Development & Deployment Status quo racke Modern PerlCommerce
  • 9. Modern PerlCommerce Past and Future Past API Future Development & Deployment References Backcountry http://www.backcountry.com/ FragnanceNet http://www.fragrancenet.com/ racke Modern PerlCommerce
  • 10. Modern PerlCommerce Past and Future Past API Future Development & Deployment Future racke Modern PerlCommerce
  • 11. Modern PerlCommerce Past and Future Past API Future Development & Deployment Principles KISS Components Agnostic Expressive racke Modern PerlCommerce
  • 12. Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Cart Session DBI Webservice * racke Modern PerlCommerce
  • 13. Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Account Manager DBI LDAP * OpenID * racke Modern PerlCommerce
  • 14. Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Templating Engine Template::Toolkit Template::Flute racke Modern PerlCommerce
  • 15. Modern PerlCommerce Past and Future Past API Future Development & Deployment Agnostic Web framework Catalyst Mojo Dancer racke Modern PerlCommerce
  • 16. Modern PerlCommerce Past and Future Past API Future Development & Deployment Preferences Dancer Template::Flute DBI racke Modern PerlCommerce
  • 17. Modern PerlCommerce Past and Future Past API Future Development & Deployment Framework Dispatching requests Parameter parsing Session handling Template engine I18N racke Modern PerlCommerce
  • 18. Modern PerlCommerce Past and Future Past API Future Development & Deployment Extensions Bundles Plugins Hooks racke Modern PerlCommerce
  • 19. Modern PerlCommerce Past and Future Past API Future Development & Deployment Features Navigation Cart Checkout Accounts racke Modern PerlCommerce
  • 20. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart SKU, Name, Quantity, Price Price > 0 Combines automatically Multiple carts Storage everywhere Price caching racke Modern PerlCommerce
  • 21. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Nitesi::Cart Methods use Dancer : : P l u g i n : : N i t e s i ; c a r t βˆ’>add ( sku => ’POM253 ’ , name => ’ Pomelo ’ , p r i c e => 3 . 0 0 , q u a n t i t y => 1 0 ) ; c a r t βˆ’>remove ( sku => ’POM253 ’ ) ; c a r t βˆ’>count ( ) ; c a r t βˆ’>c l e a r ( ) ; c a r t βˆ’> t o t a l ( ) ; c a r t βˆ’>s u b t o t a l ( ) ; racke Modern PerlCommerce
  • 22. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Everything is a Cart Saved Carts Wishlists Collections racke Modern PerlCommerce
  • 23. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Multiple Carts c a r t ( ’ w i s h l i s t ’ )βˆ’>add ( sku => ’ORA322 ’ , name => ’ Orange ’ , p r i c e => 2 . 0 0 , q u a n t i t y => 5 ) ; racke Modern PerlCommerce
  • 24. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart Backends Session DBI racke Modern PerlCommerce
  • 25. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Inventory Check MinQuantityField min_quantity MaxQuantityField inventory : q u a n t i t y racke Modern PerlCommerce
  • 26. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Inventory Check Hook hook ’ b e f o r e _ c a r t _ a d d ’ => sub { my ( $ c a r t , $item ) = @_; my ( $ i n v e n t o r y ) ; $ i n v e n t o r y = query βˆ’> s e l e c t _ f i e l d ( t a b l e => ’ p r o d u c t s ’ , f i e l d => ’ i n v e n t o r y ’ , where => { sku => $item βˆ’>{sku } } ) ; i f ( $item βˆ’>{ q u a n t i t y } > $ i n v e n t o r y ) { $item βˆ’>{ e r r o r } = ’ Out o f s t o c k ’ ; } }; racke Modern PerlCommerce
  • 27. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart Hooks before_cart_add after_cart_add racke Modern PerlCommerce
  • 28. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Cart Hooks before_cart_remove after_cart_remove racke Modern PerlCommerce
  • 29. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Checkout Taxes Shipping Payment Invoice racke Modern PerlCommerce
  • 30. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Payment Business::OnlinePayment racke Modern PerlCommerce
  • 31. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Tax Modules on CPAN Business::Tax::Canada Business::CA::GST Business::Tax::VAT Business::Tax::VAT::Validation racke Modern PerlCommerce
  • 32. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Shipping Simple Shipping Crazy Shipping Shipping API racke Modern PerlCommerce
  • 33. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Costs $ c a r t βˆ’>a p p l y _ c o s t ( amount => 5 ) ; $ c a r t βˆ’>a p p l y _ c o s t ( amount => 0 . 1 9 , r e l a t i v e => 1 ) ; racke Modern PerlCommerce
  • 34. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms PDF Invoices HTML template Template::Flute::PDF racke Modern PerlCommerce
  • 35. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Accounts p o s t ’ / l o g i n ’ => sub { i f ( account βˆ’>l o g i n ( username => params ( ’ body ’ ) βˆ’ >{username } , password => params ( ’ body ’ ) βˆ’ >{password } ) ) { r e d i r e c t ’ / customerservice ’ ; } else { redirect ’ / login ’ ; } }; racke Modern PerlCommerce
  • 36. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Accounts g e t ’ / checkout ’ => sub { i f ( account βˆ’>a c l ( check => ’ s u b m i t _ o r d e r s ’ ) ) { r e t u r n t e m p l a t e ’ checkout ’ ; } redirect ’ / access_denied ’ ; }; racke Modern PerlCommerce
  • 37. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Account manager Account Providers Login/Logout Account Information Login status Forgot password Registration racke Modern PerlCommerce
  • 38. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Account Provider DBI LDAP * Htpasswd * OpenID * OAuth * racke Modern PerlCommerce
  • 39. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Access Control User Roles Permissions racke Modern PerlCommerce
  • 40. Modern PerlCommerce Cart Past and Future Checkout API Accounts and Access Control Development & Deployment Forms Forms Display Validation Storage racke Modern PerlCommerce
  • 41. Modern PerlCommerce Dancer Past and Future Contribution API The End Development & Deployment Routes Categories Products Cart Checkout Login/Logout Customer Service racke Modern PerlCommerce
  • 42. Modern PerlCommerce Dancer Past and Future Contribution API The End Development & Deployment Default Route g e t q r { / ( . βˆ— ) } => sub { my ( $sku ) = s p l a t ; my $ p r o d u c t ; # check f o r e x i s t i n g p r o d u c t i f ( $ p r o d u c t = database βˆ’>q u i c k _ s e l e c t ( ’ p r o d u c t s ’ , { sku => $sku } ) ) # display flypage template ’ flypage ’ , $product ; } else { # d i s p l a y n o t found page s t a t u s ’ not_found ’ ; f o r w a r d ’ 404 ’ ; } }; racke Modern PerlCommerce
  • 43. Modern PerlCommerce Dancer Past and Future Contribution API The End Development & Deployment CPAN/GitHub http://search.cpan.org/dist/Nitesi/ http://search.cpan.org/dist/Nitesi-DBI/ http://search.cpan.org/dist/ Dancer-Plugin-Nitesi/ https://github.com/racke/Nitesi https://github.com/racke/Nitesi-DBI https: //github.com/racke/Dancer-Plugin-Nitesi racke Modern PerlCommerce
  • 44. Modern PerlCommerce Dancer Past and Future Contribution API The End Development & Deployment The End Slides: http://www.linuxia.de/talks/perlcommerce/ perlcommerce-beamer.pdf Project: https://vsc.state.gov/ racke Modern PerlCommerce