SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Web Frameworks

    By: Rahul Malik
What are they?

• In my opinion - “A software framework
  that is meant to remove the everyday pain
  and redundancy of web development.”
Awesome, what are my
     options??
Ruby on Rails (RoR)
• Made at 37 Signals by
  DHH
• Paved the way for
  framework development
  in many other languages
• Written in Ruby
• Credited with people
                            !quot;#$%&'&$ ())*   +,




  finding out about ruby
Django
• Written in Python          -$./0#12

• Similar philosophies as
  Rails except they
  stress modularity
• Made in Kansas at The                      345&645#$12
  World Company             !quot;#$%&'&$ ())*             +,
Why do we need them?
• Web Programming was a black art
 • Bad Practices were formed
 • High coupling of components
• Mind numbing processes had to be done
  repeatedly. (i.e. CRUD pages)
• Infrastructure specific (switching to Oracle
  = pain)
How do they fix these
    problems?
Model View Controller
       Design

Model   Controller   View
Model
Database Management
• Object Relational Mapping (ORM)
• Switching to another database type is just
  changing a flag
• Transaction support as well as database
  migrations
Database Management
class Entry(models.Model):
   pub_date = models.DateTimeField()
   slug = models.SlugField(unique_for_date='pub_date')
   headline = models.CharField(maxlength=200)
   summary = models.TextField(help_text=quot;Use raw HTML.quot;)
   body = models.TextField(help_text=quot;Use raw HTML.quot;)
   author = models.CharField(maxlength=100)

  Entry.objects.get(headline=’framework talk’)
 Entry.objects.filter(pub_date=datetime.now())
View
Template Systems!

• Simple systems that can be used to
  generate HTML, CSS, RSS, or any other
  text based formats
• Controller provides context and separation
  from model
• Good for designers
Template Systems
{% extends quot;creator/base.htmlquot; %}
{% block content %}
<h1>User Settings</h1>
<h2>{{ user.username }}</h2>
<form action=quot;.quot; method=quot;postquot;>
{{ form.as_p }}
<input type=quot;submitquot; value=quot;Save Changesquot; />
</form>
{% endblock %}
Controller
Sexy URL’s

• blog.php?month=11&day=19&year=2008
• blog/11/19/2008/
Request Routing
• All HTTP Requests get mapped to a
  controller or 404 by naming conventions
  (rails) or regex matching (django)
 • domain.com/blog/view/getvar1/getvar2/...
 • '^(?P<year>d{4})/(?P<month>[a-z]{3})/(?
    P<day>w{1,2})/(?P<slug>[w-]+)/$'
Request Routing

• Naming Conventions vs. Regex Matching
• What else to you get?
 • GET, POST variables, as much HTTP
    Header information that you could want
URL Matching (Regex)

from feeds.views import publish_templatized_feed_item, publish_feed_item, refresh_feed

urlpatterns = patterns('',

    (r'^publish/$', publish_feed_item),

    (r'^publish/template/$', publish_templatized_feed_item),

    (r'^refresh/$', refresh_feed)
)
URL Matching (regex)
urlpatterns = patterns('django.views.generic.date_based',

  (r'^(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/(?P<slug>[w-]+)/$',
'object_detail', dict(info_dict, slug_field='slug')),

    (r'^(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/$', 'archive_day', info_dict),

    (r'^(?P<year>d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict),

    (r'^(?P<year>d{4})/$', 'archive_year', info_dict),

    (r'^/?$', 'archive_index', info_dict),
)
Freebies
Automation

• CRUD or Admin interfaces
• Schema Upgrades and Downgrades
  (Migrations)
• Generating Frequent Components (new
  controller, model, etc.)
Security

• Authorization and Authentication of users
  built-in!
• Permissions Models
• Basic Web Security at it’s core (SQL
  Injection, CSRF, etc.)
Caching


• Simple hooks and/or helpers baked in
• Flat-File, Database, or Distributed
  (memcached) database management
But does it scale?
Yes
Any Other Questions?

Contenu connexe

En vedette (7)

NYDHA
NYDHANYDHA
NYDHA
 
Michael P Keating
Michael P KeatingMichael P Keating
Michael P Keating
 
Shah hewlett emotion detection from speech
Shah hewlett   emotion detection from speechShah hewlett   emotion detection from speech
Shah hewlett emotion detection from speech
 
Douglas Bellamy Resume 2013 April
Douglas Bellamy Resume 2013 AprilDouglas Bellamy Resume 2013 April
Douglas Bellamy Resume 2013 April
 
Roger G Thompson
Roger G  ThompsonRoger G  Thompson
Roger G Thompson
 
Audio based Bird Species Recognition
Audio based Bird Species RecognitionAudio based Bird Species Recognition
Audio based Bird Species Recognition
 
Douglas Bellamy Resume June 2012
Douglas Bellamy Resume June 2012 Douglas Bellamy Resume June 2012
Douglas Bellamy Resume June 2012
 

Similaire à Framework Presentation

DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
Oleg Zinchenko
 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter
nicdev
 

Similaire à Framework Presentation (20)

Streamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web FrameworksStreamlining Your Applications with Web Frameworks
Streamlining Your Applications with Web Frameworks
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Introduction to Web Development with Ruby on Rails
Introduction to Web Development with Ruby on RailsIntroduction to Web Development with Ruby on Rails
Introduction to Web Development with Ruby on Rails
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
 
Static Code Analysis For Ruby
Static Code Analysis For RubyStatic Code Analysis For Ruby
Static Code Analysis For Ruby
 
DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)DDD on example of Symfony (SfCampUA14)
DDD on example of Symfony (SfCampUA14)
 
Object Relational Mapping in PHP
Object Relational Mapping in PHPObject Relational Mapping in PHP
Object Relational Mapping in PHP
 
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
Perchè potresti aver bisogno di un database NoSQL anche se non sei Google o F...
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter
 
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег ЗинченкоWebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
WebCamp: Developer Day: DDD in PHP on example of Symfony - Олег Зинченко
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Road to Rails
Road to RailsRoad to Rails
Road to Rails
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Introduction To Ruby On Rails
Introduction To Ruby On RailsIntroduction To Ruby On Rails
Introduction To Ruby On Rails
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 

Dernier

+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

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
 
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
 
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
 
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...
 
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...
 
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?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
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?
 
+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...
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Framework Presentation

  • 1. Web Frameworks By: Rahul Malik
  • 2. What are they? • In my opinion - “A software framework that is meant to remove the everyday pain and redundancy of web development.”
  • 3. Awesome, what are my options??
  • 4. Ruby on Rails (RoR) • Made at 37 Signals by DHH • Paved the way for framework development in many other languages • Written in Ruby • Credited with people !quot;#$%&'&$ ())* +, finding out about ruby
  • 5. Django • Written in Python -$./0#12 • Similar philosophies as Rails except they stress modularity • Made in Kansas at The 345&645#$12 World Company !quot;#$%&'&$ ())* +,
  • 6. Why do we need them? • Web Programming was a black art • Bad Practices were formed • High coupling of components • Mind numbing processes had to be done repeatedly. (i.e. CRUD pages) • Infrastructure specific (switching to Oracle = pain)
  • 7. How do they fix these problems?
  • 8. Model View Controller Design Model Controller View
  • 10. Database Management • Object Relational Mapping (ORM) • Switching to another database type is just changing a flag • Transaction support as well as database migrations
  • 11. Database Management class Entry(models.Model): pub_date = models.DateTimeField() slug = models.SlugField(unique_for_date='pub_date') headline = models.CharField(maxlength=200) summary = models.TextField(help_text=quot;Use raw HTML.quot;) body = models.TextField(help_text=quot;Use raw HTML.quot;) author = models.CharField(maxlength=100) Entry.objects.get(headline=’framework talk’) Entry.objects.filter(pub_date=datetime.now())
  • 12. View
  • 13. Template Systems! • Simple systems that can be used to generate HTML, CSS, RSS, or any other text based formats • Controller provides context and separation from model • Good for designers
  • 14. Template Systems {% extends quot;creator/base.htmlquot; %} {% block content %} <h1>User Settings</h1> <h2>{{ user.username }}</h2> <form action=quot;.quot; method=quot;postquot;> {{ form.as_p }} <input type=quot;submitquot; value=quot;Save Changesquot; /> </form> {% endblock %}
  • 17. Request Routing • All HTTP Requests get mapped to a controller or 404 by naming conventions (rails) or regex matching (django) • domain.com/blog/view/getvar1/getvar2/... • '^(?P<year>d{4})/(?P<month>[a-z]{3})/(? P<day>w{1,2})/(?P<slug>[w-]+)/$'
  • 18. Request Routing • Naming Conventions vs. Regex Matching • What else to you get? • GET, POST variables, as much HTTP Header information that you could want
  • 19. URL Matching (Regex) from feeds.views import publish_templatized_feed_item, publish_feed_item, refresh_feed urlpatterns = patterns('', (r'^publish/$', publish_feed_item), (r'^publish/template/$', publish_templatized_feed_item), (r'^refresh/$', refresh_feed) )
  • 20. URL Matching (regex) urlpatterns = patterns('django.views.generic.date_based', (r'^(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/(?P<slug>[w-]+)/$', 'object_detail', dict(info_dict, slug_field='slug')), (r'^(?P<year>d{4})/(?P<month>[a-z]{3})/(?P<day>w{1,2})/$', 'archive_day', info_dict), (r'^(?P<year>d{4})/(?P<month>[a-z]{3})/$', 'archive_month', info_dict), (r'^(?P<year>d{4})/$', 'archive_year', info_dict), (r'^/?$', 'archive_index', info_dict), )
  • 22. Automation • CRUD or Admin interfaces • Schema Upgrades and Downgrades (Migrations) • Generating Frequent Components (new controller, model, etc.)
  • 23. Security • Authorization and Authentication of users built-in! • Permissions Models • Basic Web Security at it’s core (SQL Injection, CSRF, etc.)
  • 24. Caching • Simple hooks and/or helpers baked in • Flat-File, Database, or Distributed (memcached) database management
  • 25. But does it scale?
  • 26. Yes