SlideShare a Scribd company logo
1 of 12
Developing Rich Internet
Applications with Perl and JavaScript
           San Diego.pm talk
             Apr 19 2012
Web application evolution
• Once upon a time, there was a static
  page
• Then came CGI scripts
• Then came client side scripting
• Then came AJAX and asynchronous calls
• What next?
Introducing RIA
•   One possible answer: RIAs
•   Stands for: Rich Internet Applications
•   Many ways to develop, many frameworks
•   I have been exploring Ext JS framework
    for JavaScript
How does it work?
• No (or minimal) HTML/JavaScript
  generation on server side
• All client interaction is done in JavaScript
• All middleware/database stuff is done on
  the server side (platform agnostic)
• Communication is done AJAX style, using
  Ext.Direct RPC protocol
Ext JS Advantages
• Cross browser compatibility (even IE6)
• Really good code and issue separation
• Very low overhead on server side
• Very low traffic (only data goes on wire)
• Clean MVC architecture – easier to
  develop
• But wait, where’s Perl?
Perl shines through
•   Perl can be used to develop server side
•   Does things it does best
•   Works anywhere
•   Really easy to plug in existing code
•   Uses RPC::ExtDirect as the glue
Introducing RPC::ExtDirect
• Abstract module that implements
  Ext.Direct protocol
• Has gateways for CGI, Plack (maybe
  mod_perl in future)
• Compatible down to 5.6.0
• Only one non-core dependency:
  JSON.pm (can be pure Perl)
Using RPC::ExtDirect
1. Declare Action (Class, Namespace):
package Foo::Bar;

use RPC::ExtDirect Action => 'Fubar';

sub foo : ExtDirect(2) {
  my ($class, $arg1, $arg2) = @_;

    # do something, store results in scalar
    my $result = ...;

    return $result;
}
Using RPC::ExtDirect, cont.
2. CGI example part 1, API publisher (api.cgi):

use CGI::ExtDirect;

use My::ExtDirect::Published::Module::Foo;
use My::ExtDirect::Published::Module::Bar;

my $direct = CGI::ExtDirect−>new();

print $direct−>api();   # Prints full HTTP response
Using RPC::ExtDirect, cont.
1. CGI example part 2: request router
use CGI::ExtDirect;

use RPC::ExtDirect::API api_path    => '/extdirect_api',
                        router_path => '/extdirect_router’;

use My::ExtDirect::Published::Module::Foo;
use My::ExtDirect::Published::Module::Bar;

my $direct = CGI::ExtDirect−>new({ debug => 1 });
print $direct−>route(); # Prints full HTTP response
Possible applications
• New stuff from scratch, easy and fast
• Retrofit old applications with shiny Web
  interface
• Convert terminal apps to Web apps (screen
  scraping?)
• Easily hack together Web admin apps using
  proven command line tools
• Gluing together heterogeneous applications
  (Web interface for ancient COBOL app?)
• More and more…
Conclusion
• CMS Webdash live demo (if any)
• Questions? Drop me an email:
Alex Tokarev <tokarev@cpan.org>

More Related Content

What's hot

Python to go
Python to goPython to go
Python to go
Weng Wei
 

What's hot (20)

Functional Programming in PHP
Functional Programming in PHPFunctional Programming in PHP
Functional Programming in PHP
 
About Clack
About ClackAbout Clack
About Clack
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
Crystal
CrystalCrystal
Crystal
 
Migrating .NET Application to .NET Core
Migrating .NET Application to .NET CoreMigrating .NET Application to .NET Core
Migrating .NET Application to .NET Core
 
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
 
Python to go
Python to goPython to go
Python to go
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
 
Getting Started with ASP.net Core 1.0
Getting Started with ASP.net Core 1.0Getting Started with ASP.net Core 1.0
Getting Started with ASP.net Core 1.0
 
meet.php #11 - Huston, we have an airbrake
meet.php #11 - Huston, we have an airbrakemeet.php #11 - Huston, we have an airbrake
meet.php #11 - Huston, we have an airbrake
 
The New Frontend Toolchain
The New Frontend ToolchainThe New Frontend Toolchain
The New Frontend Toolchain
 
Scaling up development of a modular code base
Scaling up development of a modular code baseScaling up development of a modular code base
Scaling up development of a modular code base
 
PHP and node.js Together
PHP and node.js TogetherPHP and node.js Together
PHP and node.js Together
 
Rust kafka-5-2019-unskip
Rust kafka-5-2019-unskipRust kafka-5-2019-unskip
Rust kafka-5-2019-unskip
 
Next generation frontend tooling
Next generation frontend toolingNext generation frontend tooling
Next generation frontend tooling
 
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
Que hay de nuevo en Visual Studio 2013 y ASP.NET 5.1
 
Riak at Posterous
Riak at PosterousRiak at Posterous
Riak at Posterous
 
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruit
 
Node.js
Node.jsNode.js
Node.js
 
Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
 

Similar to Developing Rich Internet Applications with Perl and JavaScript

Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Gabriel Villa
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
Oleg Podsechin
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
RX-M Enterprises LLC
 

Similar to Developing Rich Internet Applications with Perl and JavaScript (20)

apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
Griffon for the Enterprise
Griffon for the EnterpriseGriffon for the Enterprise
Griffon for the Enterprise
 
Staying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with KafkaStaying on Topic - Invoke OpenFaaS functions with Kafka
Staying on Topic - Invoke OpenFaaS functions with Kafka
 
Intro to CakePHP
Intro to CakePHPIntro to CakePHP
Intro to CakePHP
 
Building production-quality apps with Node.js
Building production-quality apps with Node.jsBuilding production-quality apps with Node.js
Building production-quality apps with Node.js
 
Node.js to the rescue
Node.js to the rescueNode.js to the rescue
Node.js to the rescue
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPC
 
Apigility-powered API's on IBM i
Apigility-powered API's on IBM iApigility-powered API's on IBM i
Apigility-powered API's on IBM i
 
.NET Core Today and Tomorrow
.NET Core Today and Tomorrow.NET Core Today and Tomorrow
.NET Core Today and Tomorrow
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
Apache Cordova 4.x
Apache Cordova 4.xApache Cordova 4.x
Apache Cordova 4.x
 
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
 
The Next Leap in JavaScript Performance
The Next Leap in JavaScript PerformanceThe Next Leap in JavaScript Performance
The Next Leap in JavaScript Performance
 
Creating a Responsive Website From Scratch
Creating a Responsive Website From ScratchCreating a Responsive Website From Scratch
Creating a Responsive Website From Scratch
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
 
Nodejs
NodejsNodejs
Nodejs
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Developing Rich Internet Applications with Perl and JavaScript

  • 1. Developing Rich Internet Applications with Perl and JavaScript San Diego.pm talk Apr 19 2012
  • 2. Web application evolution • Once upon a time, there was a static page • Then came CGI scripts • Then came client side scripting • Then came AJAX and asynchronous calls • What next?
  • 3. Introducing RIA • One possible answer: RIAs • Stands for: Rich Internet Applications • Many ways to develop, many frameworks • I have been exploring Ext JS framework for JavaScript
  • 4. How does it work? • No (or minimal) HTML/JavaScript generation on server side • All client interaction is done in JavaScript • All middleware/database stuff is done on the server side (platform agnostic) • Communication is done AJAX style, using Ext.Direct RPC protocol
  • 5. Ext JS Advantages • Cross browser compatibility (even IE6) • Really good code and issue separation • Very low overhead on server side • Very low traffic (only data goes on wire) • Clean MVC architecture – easier to develop • But wait, where’s Perl?
  • 6. Perl shines through • Perl can be used to develop server side • Does things it does best • Works anywhere • Really easy to plug in existing code • Uses RPC::ExtDirect as the glue
  • 7. Introducing RPC::ExtDirect • Abstract module that implements Ext.Direct protocol • Has gateways for CGI, Plack (maybe mod_perl in future) • Compatible down to 5.6.0 • Only one non-core dependency: JSON.pm (can be pure Perl)
  • 8. Using RPC::ExtDirect 1. Declare Action (Class, Namespace): package Foo::Bar; use RPC::ExtDirect Action => 'Fubar'; sub foo : ExtDirect(2) { my ($class, $arg1, $arg2) = @_; # do something, store results in scalar my $result = ...; return $result; }
  • 9. Using RPC::ExtDirect, cont. 2. CGI example part 1, API publisher (api.cgi): use CGI::ExtDirect; use My::ExtDirect::Published::Module::Foo; use My::ExtDirect::Published::Module::Bar; my $direct = CGI::ExtDirect−>new(); print $direct−>api(); # Prints full HTTP response
  • 10. Using RPC::ExtDirect, cont. 1. CGI example part 2: request router use CGI::ExtDirect; use RPC::ExtDirect::API api_path => '/extdirect_api', router_path => '/extdirect_router’; use My::ExtDirect::Published::Module::Foo; use My::ExtDirect::Published::Module::Bar; my $direct = CGI::ExtDirect−>new({ debug => 1 }); print $direct−>route(); # Prints full HTTP response
  • 11. Possible applications • New stuff from scratch, easy and fast • Retrofit old applications with shiny Web interface • Convert terminal apps to Web apps (screen scraping?) • Easily hack together Web admin apps using proven command line tools • Gluing together heterogeneous applications (Web interface for ancient COBOL app?) • More and more…
  • 12. Conclusion • CMS Webdash live demo (if any) • Questions? Drop me an email: Alex Tokarev <tokarev@cpan.org>