Web application intro

601 views

Published on

A little introduction to web applications and Ruby for the December RailsGirls Berlin workshop.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
601
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Web application intro

  1. 1. Introduction to Web Applications Tobias Pfeiffer @PragTob pragtob.wordpress.com
  2. 2. Today
  3. 3. What is a web application?
  4. 4. Not rocket science
  5. 5. I am Rails(and So Can You!)
  6. 6. Programming is fun!
  7. 7. What you are going to build today
  8. 8. So what is a web application?
  9. 9. Presented in a web browser
  10. 10. Runs on a server...
  11. 11. ...or the cloud
  12. 12. is dynamic
  13. 13. A high level overview
  14. 14. High level overview
  15. 15. High level overview
  16. 16. High level overview Request
  17. 17. High level overview
  18. 18. High level overview Answer
  19. 19. High level overview Answer
  20. 20. High level overview
  21. 21. What parts does a webapplication consist of?
  22. 22. Web Application
  23. 23. Front End Back End
  24. 24. Front End Back End
  25. 25. CSS JavaScriptHTML
  26. 26. Structure and content
  27. 27. CSS JavaScriptHTML
  28. 28. Styling to transform...
  29. 29. ...this...
  30. 30. ...into this.
  31. 31. CSS JavaScriptHTML
  32. 32. CSS JavaScript Back EndHTML
  33. 33. CSS JavaScript Back EndHTML
  34. 34. LogicInfrastructure
  35. 35. LogicInfrastructure
  36. 36. Logic● Behaviour● Implements the business logic● Ties all the parts together● Generates content
  37. 37. Ruby on Rails
  38. 38. LogicInfrastructure
  39. 39. Web Server
  40. 40. LogicInfrastructure
  41. 41. Storing all your data...
  42. 42. ...in giant tables
  43. 43. Recap
  44. 44. Web Application Landscape CSS St or JavaScript ag Logic e HTML Infrastructure
  45. 45. Web Application Landscape Ruby on Rails Bootstrap Mo CSS Django St oDB ng or JavaScript ag Logic e jQuery Ruby Sq Python PHP lite HTML XML DOM WEBrick Infrastructure Apache Thin
  46. 46. But what is Ruby on Rails?
  47. 47. A web applicationframework written in Ruby
  48. 48. ● A general purpose programming language● Principle of least surprise● Invented by Yukihiro Matsumoto
  49. 49. "I hope to see Ruby helpevery programmer in theworld to be productive, and toenjoy programming, and to behappy. That is the primarypurpose of Ruby language."Yukihiro Matsumoto
  50. 50. Ruby on Rails● Framework written in Ruby● set of functionality to help write web applications – Connecting to the database (ActiveRecord) – Generating HTML (ERB) – Pays attention to security – … and so much more!● Model View Controller● You write in Ruby
  51. 51. Lets get into some Ruby
  52. 52. But before that...
  53. 53. Cookies & Questions
  54. 54. Open a terminal/console
  55. 55. irb
  56. 56. tobi@speedy:~$ irb1.9.3p194 :001 >
  57. 57. irb – interactive ruby● talking to ruby● You tell ruby something● Ruby responds with what it understood● Coaches are going to help you!
  58. 58. 1.9.3p194 :001 > 5 => 5
  59. 59. 1.9.3p194 :002 > 5 + 3 => 8
  60. 60. 1.9.3p194 :003 > 8 * 7 => 56
  61. 61. 1.9.3p194 :004 > "Tobias Pfeiffer" => "Tobias Pfeiffer"
  62. 62. 1.9.3p194 :005 > name = "Tobi" => "Tobi"
  63. 63. 1.9.3p194 :006 > name => "Tobi"
  64. 64. 1.9.3p194 :007 > result = 8 * 7 => 56
  65. 65. 1.9.3p194 :008 > result * 10 => 560
  66. 66. 1.9.3p194 :009 > name + " likes Sweden" => "Tobi likes Sweden"
  67. 67. 1.9.3p194 :010 > puts "Hello World!"Hello World! => nil
  68. 68. 1.9.3p194 :011 > fruits = ["apple", "keewee","orange"] => ["apple", "keewee", "orange"]
  69. 69. 1.9.3p194 :013 > fruits.each do |fruit| putsfruit endapplekeeweeorange => ["apple", "keewee", "orange"]
  70. 70. 1.9.3p194 :014 > fruits[0] => "apple"
  71. 71. 1.9.3p194 :015 > symbol = :wuh => :wuh1.9.3p194 :016 > symbol => :wuh
  72. 72. 1.9.3p194 :017 > dictionary = {:hi =>"Hej", :good => "bra", :cookie => "kaka"} => {:hi=>"Hej", :good=>"bra",:cookie=>"kaka"}1.9.3p194 :018 > dictionary[:hi] => "Hej"1.9.3p194 :019 > dictionary[:cookie] => "kaka"
  73. 73. 1.9.3p194 :020 > def hello1.9.3p194 :021?> puts "Hello there!"1.9.3p194 :022?> end => nil
  74. 74. 1.9.3p194 :026 > helloHello there! => nil
  75. 75. 1.9.3p194 :023 > def greeter(person)1.9.3p194 :024?> puts "Hello " + person1.9.3p194 :025?> end => nil
  76. 76. 1.9.3p194 :027 > greeter("Fanny")Hello Fanny => nil
  77. 77. 1.9.3p194 :028 > greeterArgumentError: wrong number of arguments (0for 1) from (irb):23:in `greeter from (irb):28 from /home/tobi/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>
  78. 78. 1.9.3p194 :029 > class Person1.9.3p194 :030?> attr_accessor :name, :age1.9.3p194 :031?> end => nil1.9.3p194 :032 > tobi = Person.new => #<Person:0x0000000205f080>
  79. 79. 1.9.3p194 :033 > tobi.name => nil1.9.3p194 :034 > tobi.name = "Tobi" => "Tobi"1.9.3p194 :035 > tobi.age = 23 => 231.9.3p194 :036 > tobi.name => "Tobi"1.9.3p194 :037 > tobi.age => 23
  80. 80. 1.9.3p194 :038 > tobi.age * 365 => 83951.9.3p194 :039 > puts "This was a talk by " +tobi.name + " - thank you!"This was a talk by Tobi - thank you! => nil
  81. 81. Thank you and enjoy coding! Tobias Pfeiffer @PragTob pragtob.wordpress.comlisten to me talking about learning Ruby (German)
  82. 82. Photo credit● http://www.flickr.com/photos/captainkimo/5918836159/● http://www.flickr.com/photos/weppos/7486411688/● http://www.flickr.com/photos/railsgirlsberlin/7882839698/in/photostream● http://www.flickr.com/photos/nirak/644336486/

×