SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Creating & Maintain Web Applications
Avi Kedar, 8-2013
 New web approach
 Programmers sucks
 ails on b (Dynamic, KISS)
 Development booster
Deploy booster
Rails on
Ruby
Rails
Server
Data Layer
Presentation
Logic
Server
Data Layer
Presentation
Logic
Front End
SPA
MV*
Responsive
OpenId
Routing
Duplex
Front End
Presentation
Logic
Data
Server
Logic +
Data
Server
Logic +
Data
• Queue
• Distributed
Cache
• CDN
• Storage
• Processing
Cloud
Services
JSON
REST
JSON
REST
JSON
REST
Front End
Server
Logic + Data
Cloud
Services
• Stateless
• Data oriented
• Small functioning parts
• Less scale-up
• Easy to integrate
• Fast implementation
(80/20)
Technology helps creating good projects, it doesn’t lead.
Test your code, use patterns, avoid stickiness, use third-parties
• Launched in 2005
• Combination of Perl, Smalltalk and Lisp
• Created byYukihiro Matsumoto
• Open Source
Often people, especially computer engineers, focus on the
machines. They think, "By doing this, the machine will run
faster. By doing this, the machine will run more effectively.
By doing this, the machine will something something
something." They are focusing on machines. But in fact we
need to focus on humans, on how humans care about doing
programming or operating the application of the machines.
We are the masters. They are the slaves.
“
Yukihiro Matsumoto
• Executes on runtime
• “Free hand”, no type restrictions
• Strong reflection abilities
• Metaprogramming
Dynamic
No pre-compile, no build, truly open for extensions
• Executes on runtime
• “Free hand”, no type restrictions
• Strong reflection abilities
• Metaprogramming
Dynamic
a = [1, 'hi', 3.14, 1, 2, [4, 5]]
hash = { water:'wet', fire:'hot' }
l = lambda { "Do or do not" }
class Time
def yesterday
self - 86400
end
end
module Debug
def whoAmI?
return "#{self.type.name} (##{self.id}): #{self.to_s}"
end
end
class Toolbar
include Debug
# ...
end
• Executes on runtime
• “Free hand”, no type restrictions
• Strong reflection abilities
• Metaprogramming
Dynamic
1.methods
[:to_s, :-@, :+, :-, :*, :/, :div, :%, :modulo, ...]
obj.respond_to?(:each)
obj.is_a?(FixNum)
obj.instance_of?(i)
obj.nil?
"hello".class
"hello".variables
• Executes on runtime
• “Free hand”, no type restrictions
• Strong reflection abilities
• Metaprogramming
Dynamic obj.send :say_hello, 'Matz'
define_method :hello do |my_arg|
…
end
obj.instance_variable_set(:@x,10)
• Executes on runtime
• “Free hand”, no type restrictions
• Strong reflection abilities
• Metaprogramming
Dynamic
COLORS =
{ black: "000", green: "0f0", blue: "00f“, white: "fff" }
class String
COLORS.each do |color,code|
define_method "in_#{color}" do
"<span style="color: ##{code}">#{self}</span>"
end
end
end
"Hello, World!".in_blue
=> "<span style="color: #00f">Hello, World!</span>"
• Convention, convention, convention
• Write less
• ?, !, @, @@, ||=
• Read it
KISS
You don’t write code in Ruby
You’re using Ruby style and practices
to write better code
… loops, blocks, dependencies, conditions, etc. …
• Convention, convention, convention
• Write less
• ?, !, @, @@, ||=
• Read it
KISS
forget_about { } ( )
Always returns value
Always receive block
Person.new "Bob", 33
class Time
def yesterday
self - 86400
end
end
if number > 0
"#{number} is positive"
else
"#{number} is negative"
end
def demonstrate_block number
yield number
end
puts demonstrate_block(1) do |number|
number + 1
end
• Convention, convention, convention
• Write less
• ?, !, @, @@, ||=
• Read it
KISS person1.empty?
person1.save!
@first_name = “John”
@@employees_count = 55
DEFAULT_LOCATION = “Israel”
id ||= Guid.new
• Convention, convention, convention
• Write less
• ?, !, @, @@, ||=
• Read it
KISS
(1..10).collect {|x| x*x}
menu.delete_if {|key,value| value=='hot'}
credit_card.pay! unless products.empty?
5.times { send_sms_to "xxx" }
• Launched in 2005
• Created by David Hansson
• Open Source
• Stack framework
Test
MVC
Web Server
Action
Mailer
Rake
RESTfull ActiveRecord
• Convention, convention, convention
• Reuse, collaboration
• Test. Period.
• Generators
Dev Booster • IDE (simply
console)
• magic
• wizards
• config
• attributes
• dll’s
• threads
• IOC
• unused files, code
• MVC
• REST
• data layer
• Easy to integrate
• it looks stupid
NO YES
• Convention, convention, convention
• Reuse, collaboration
• Test. Period.
• Generators
Dev Booster • IDE (simply
console)
• magic
• wizards
• config
• attributes
• dll’s
• threads
• IOC
• unused files, code
• MVC
• REST
• data layer
• it looks stupid
NO YES
index.html.haml
show.js.coffee
• Convention, convention, convention
• Reuse, collaboration
• Test. Period.
• Generators
Dev Booster
Gem file
You need an enormous reason
to code something yourself.
Easy to integrate
Easy to use
Fully documented
Active community
• Convention, convention, convention
• Reuse, collaboration
• Test. Period.
• Generators
Dev Booster
• Rspec for unit tests
• Factory-girl for data
generator
• Capybara for integration test
• Built in mocking system
• Integrated with Rails, generators
and build machines, huge amount of artifacts
When “I sign in” do
within "#login-form" do
fill_in 'Login', with: 'user@example.com'
fill_in 'Password', with: 'password'
end
click_link 'Sign in'
end
Capybara
Rspec
Team-
city
Factory-
girl
Fantom
Browser
RailsMocking&
Generators
JS, CSS, HTML, Ruby…
• Convention, convention, convention
• Reuse, collaboration
• Test. Period.
• Generators
Dev Booster • rails g controller Tweets
• rails g controller Tags report_tag like_tag
• rails g model Presentations title:string slides_count:integer
• rails g rspec:controller Products
• rails g scaffold OnlineGames game:string score:integer
g
• Full responsibility
o DB
o Gems
o Assets
o Vendors
• Multi-environment
• Fast deploy
Deploy Booster
Rails Application
• Full responsibility
o DB
o Gems
o Assets
o Vendors
• Multi-environment
• Fast Setup
• Fast deploy
Deploy Booster
• built in relational ORM
• Part of the MVC (Model)
• No SQL syntax, all using ActiveRecord built in functions (Ruby):
ActiveRecord
users = User.all
Manage Databases
• DB create/alter tables, indexes, etc. via ActiveRecord (Ruby):
create_table :products do |t|
t.string :name
t.string :part_number
end
• Database structure and versioning using migrations
20111226120533_create_delayed_jobs.rb
david = User.where(name:'David')
david.age = 36
david.save!
• Full responsibility
o DB
o Gems
o Assets
o Vendors
• Multi-environment
• Fast Setup
• Fast deploy
Deploy Booster
• Full versions and dependencies management
• Group of gems per environment
• Install and upgrade all using single command
Gems
bundle install
bundle update
gem 'SystemTimer', require: 'system_timer'
gem 'feedback_popup'
gem 'i18n-js'
group :production do
gem 'asset_sync'
gem 'turbo-sprockets-rails3'
gem 'coffee-rails'
gem 'closure-compiler'
gem 'yui-compressor'
end
• Full responsibility
o DB
o Gems
o Assets
o Vendors
• Multi-environment
• Fast Setup
• Fast deploy
Deploy Booster
• Single place to manage all your css, js, images and third-
parties
• Stack based manager called Assets Pipeline (easy to extend)
(uglifier, unite to a single file, validate)
• Control the order of bootstraping
Assets
Vendors
• Manage all third-parties client side plugins (js and css)
(jquery, angular-js, twitter-bootstrap, etc.)
• Fully integrated with the assets pipeline
• Full responsibility
o DB
o Gems
o Assets
o Vendors
• Multi-environment
• Fast Setup
• Fast deploy
Deploy Booster
• Support multiple environment separation using yaml config
• Built-in test, development and production environment
• Full separation: DB, dependencies, testing, data-seed
Multi -environment
• Full responsibility
o DB
o Gems
o Assets
o Vendors
• Multi-environment
• Fast Setup
• Fast deploy
Deploy Booster
• As fast as 3 steps to create a full active machine
Fast Setup
git pull <branch>
bundle
rake db:migrate
• Single Responsibilty:
o DB using SQLite
o Server built in
o UT support built in
• Can illustrate production using multi-env
rails s –e production
• Full responsibility
o DB
o Gems
o Assets
o Vendors
• Multi-environment
• Fast Setup
• Fast deploy
Deploy Booster
• Using git as source control and deploy tool
• Using artifacts for measure and investigate your code (UT, code
coverage, memory lakes, etc.)
• Fully integrated with Saas hosting platforms:
o deploy in one click
o Deploy software not infrastructure
Add-ons: db-backups, logs, ssl, etc.
• Scale-out in not a forbidden word:
o Build for the cloud, so easy to integrate:
Queue, CDN, storage, etc.
o Scale your project in a single click
Fast Deploy
Build. Deploy. Scale.
git push production 2.4
 Client side manage the flow and contains all presentation logic and view
 Web servers should be data-oriented focusing on easy of scaling out and delivery speed
 Ruby designed for programmers not machine: helps creating beautiful code, self-explained
and dynamic
 Rails enable to quickly create web servers:
 Convention
 Reuse
 Single responsibility
 Quick setup and deploy
 Built-in scale out
Avi Kedar, 8-2013

Weitere ähnliche Inhalte

Was ist angesagt?

Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 yearsjduff
 
A web app in pure Clojure
A web app in pure ClojureA web app in pure Clojure
A web app in pure ClojureDane Schneider
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Fwdays
 
Put Your Thinking CAP On
Put Your Thinking CAP OnPut Your Thinking CAP On
Put Your Thinking CAP OnTomer Gabel
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeRadosław Scheibinger
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swaggerTony Tam
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on RailsJohn McCaffrey
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friendFilip Bruun Bech-Larsen
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Write Once, Run Everywhere - Ember.js Munich
Write Once, Run Everywhere - Ember.js MunichWrite Once, Run Everywhere - Ember.js Munich
Write Once, Run Everywhere - Ember.js MunichMike North
 
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless DreamsRainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless DreamsJosh Carlisle
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
Reactive All the Way Down the Stack
Reactive All the Way Down the StackReactive All the Way Down the Stack
Reactive All the Way Down the StackSteve Pember
 
A tale of 3 databases
A tale of 3 databasesA tale of 3 databases
A tale of 3 databasesChris Skardon
 
Building your own slack bot on the AWS stack
Building your own slack bot on the AWS stackBuilding your own slack bot on the AWS stack
Building your own slack bot on the AWS stackTorontoNodeJS
 
Managing Distributed Systems with Chef
Managing Distributed Systems with ChefManaging Distributed Systems with Chef
Managing Distributed Systems with ChefMandi Walls
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the CloudRyan Cuprak
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web FrameworksJoe Kutner
 

Was ist angesagt? (20)

Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
 
A web app in pure Clojure
A web app in pure ClojureA web app in pure Clojure
A web app in pure Clojure
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
 
Put Your Thinking CAP On
Put Your Thinking CAP OnPut Your Thinking CAP On
Put Your Thinking CAP On
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
Freelancing and side-projects on Rails
Freelancing and side-projects on RailsFreelancing and side-projects on Rails
Freelancing and side-projects on Rails
 
Frameworks and webcomponents
Frameworks and webcomponentsFrameworks and webcomponents
Frameworks and webcomponents
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Write Once, Run Everywhere - Ember.js Munich
Write Once, Run Everywhere - Ember.js MunichWrite Once, Run Everywhere - Ember.js Munich
Write Once, Run Everywhere - Ember.js Munich
 
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless DreamsRainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
Rainbows, Unicorns, and other Fairy Tales in the Land of Serverless Dreams
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
Reactive All the Way Down the Stack
Reactive All the Way Down the StackReactive All the Way Down the Stack
Reactive All the Way Down the Stack
 
A tale of 3 databases
A tale of 3 databasesA tale of 3 databases
A tale of 3 databases
 
Building your own slack bot on the AWS stack
Building your own slack bot on the AWS stackBuilding your own slack bot on the AWS stack
Building your own slack bot on the AWS stack
 
Managing Distributed Systems with Chef
Managing Distributed Systems with ChefManaging Distributed Systems with Chef
Managing Distributed Systems with Chef
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
 

Andere mochten auch

Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projectsVincent Massol
 
Wed Development on Rails
Wed Development on RailsWed Development on Rails
Wed Development on RailsJames Gray
 
Simple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on RailsSimple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on Railsjhenry
 
Rapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsRapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsSimobo
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with RailsYi-Ting Cheng
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.netSanket Jagare
 
Web Design Project Report
Web Design Project ReportWeb Design Project Report
Web Design Project ReportMJ Ferdous
 
47533870 final-project-report
47533870 final-project-report47533870 final-project-report
47533870 final-project-reportMohammed Meraj
 

Andere mochten auch (11)

Implementing quality in Java projects
Implementing quality in Java projectsImplementing quality in Java projects
Implementing quality in Java projects
 
Wed Development on Rails
Wed Development on RailsWed Development on Rails
Wed Development on Rails
 
Simple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on RailsSimple Social Networking with Ruby on Rails
Simple Social Networking with Ruby on Rails
 
Rapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on RailsRapid Application Development using Ruby on Rails
Rapid Application Development using Ruby on Rails
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.net
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Web Design Project Report
Web Design Project ReportWeb Design Project Report
Web Design Project Report
 
47533870 final-project-report
47533870 final-project-report47533870 final-project-report
47533870 final-project-report
 
Atm System
Atm SystemAtm System
Atm System
 
SlideShare 101
SlideShare 101SlideShare 101
SlideShare 101
 

Ähnlich wie Web Development using Ruby on Rails

Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Ethan Ram
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Emerson Eduardo Rodrigues Von Staffen
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...Amazon Web Services
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache UsergridDavid M. Johnson
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
Python - A Comprehensive Programming Language
Python - A Comprehensive Programming LanguagePython - A Comprehensive Programming Language
Python - A Comprehensive Programming LanguageTsungWei Hu
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildwebLeo Zhou
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Pierre Joye
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1Mohammad Qureshi
 
OWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript ApplicationsOWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript ApplicationsLewis Ardern
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Vadym Kazulkin
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 

Ähnlich wie Web Development using Ruby on Rails (20)

Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
The MEAN Stack
The MEAN StackThe MEAN Stack
The MEAN Stack
 
Node.js
Node.jsNode.js
Node.js
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Python - A Comprehensive Programming Language
Python - A Comprehensive Programming LanguagePython - A Comprehensive Programming Language
Python - A Comprehensive Programming Language
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
Venkata
VenkataVenkata
Venkata
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
OWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript ApplicationsOWASP SF - Reviewing Modern JavaScript Applications
OWASP SF - Reviewing Modern JavaScript Applications
 
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
Measure and Increase Developer Productivity with Help of Serverless at JCON 2...
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 

Kürzlich hochgeladen

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Kürzlich hochgeladen (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Web Development using Ruby on Rails

  • 1. Creating & Maintain Web Applications Avi Kedar, 8-2013
  • 2.  New web approach  Programmers sucks  ails on b (Dynamic, KISS)  Development booster Deploy booster Rails on Ruby Rails
  • 6. Front End Presentation Logic Data Server Logic + Data Server Logic + Data • Queue • Distributed Cache • CDN • Storage • Processing Cloud Services JSON REST JSON REST JSON REST
  • 7. Front End Server Logic + Data Cloud Services • Stateless • Data oriented • Small functioning parts • Less scale-up • Easy to integrate • Fast implementation (80/20)
  • 8. Technology helps creating good projects, it doesn’t lead. Test your code, use patterns, avoid stickiness, use third-parties
  • 9. • Launched in 2005 • Combination of Perl, Smalltalk and Lisp • Created byYukihiro Matsumoto • Open Source Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves. “ Yukihiro Matsumoto
  • 10. • Executes on runtime • “Free hand”, no type restrictions • Strong reflection abilities • Metaprogramming Dynamic No pre-compile, no build, truly open for extensions
  • 11. • Executes on runtime • “Free hand”, no type restrictions • Strong reflection abilities • Metaprogramming Dynamic a = [1, 'hi', 3.14, 1, 2, [4, 5]] hash = { water:'wet', fire:'hot' } l = lambda { "Do or do not" } class Time def yesterday self - 86400 end end module Debug def whoAmI? return "#{self.type.name} (##{self.id}): #{self.to_s}" end end class Toolbar include Debug # ... end
  • 12. • Executes on runtime • “Free hand”, no type restrictions • Strong reflection abilities • Metaprogramming Dynamic 1.methods [:to_s, :-@, :+, :-, :*, :/, :div, :%, :modulo, ...] obj.respond_to?(:each) obj.is_a?(FixNum) obj.instance_of?(i) obj.nil? "hello".class "hello".variables
  • 13. • Executes on runtime • “Free hand”, no type restrictions • Strong reflection abilities • Metaprogramming Dynamic obj.send :say_hello, 'Matz' define_method :hello do |my_arg| … end obj.instance_variable_set(:@x,10)
  • 14. • Executes on runtime • “Free hand”, no type restrictions • Strong reflection abilities • Metaprogramming Dynamic COLORS = { black: "000", green: "0f0", blue: "00f“, white: "fff" } class String COLORS.each do |color,code| define_method "in_#{color}" do "<span style="color: ##{code}">#{self}</span>" end end end "Hello, World!".in_blue => "<span style="color: #00f">Hello, World!</span>"
  • 15. • Convention, convention, convention • Write less • ?, !, @, @@, ||= • Read it KISS You don’t write code in Ruby You’re using Ruby style and practices to write better code … loops, blocks, dependencies, conditions, etc. …
  • 16. • Convention, convention, convention • Write less • ?, !, @, @@, ||= • Read it KISS forget_about { } ( ) Always returns value Always receive block Person.new "Bob", 33 class Time def yesterday self - 86400 end end if number > 0 "#{number} is positive" else "#{number} is negative" end def demonstrate_block number yield number end puts demonstrate_block(1) do |number| number + 1 end
  • 17. • Convention, convention, convention • Write less • ?, !, @, @@, ||= • Read it KISS person1.empty? person1.save! @first_name = “John” @@employees_count = 55 DEFAULT_LOCATION = “Israel” id ||= Guid.new
  • 18. • Convention, convention, convention • Write less • ?, !, @, @@, ||= • Read it KISS (1..10).collect {|x| x*x} menu.delete_if {|key,value| value=='hot'} credit_card.pay! unless products.empty? 5.times { send_sms_to "xxx" }
  • 19. • Launched in 2005 • Created by David Hansson • Open Source • Stack framework Test MVC Web Server Action Mailer Rake RESTfull ActiveRecord
  • 20. • Convention, convention, convention • Reuse, collaboration • Test. Period. • Generators Dev Booster • IDE (simply console) • magic • wizards • config • attributes • dll’s • threads • IOC • unused files, code • MVC • REST • data layer • Easy to integrate • it looks stupid NO YES
  • 21. • Convention, convention, convention • Reuse, collaboration • Test. Period. • Generators Dev Booster • IDE (simply console) • magic • wizards • config • attributes • dll’s • threads • IOC • unused files, code • MVC • REST • data layer • it looks stupid NO YES index.html.haml show.js.coffee
  • 22. • Convention, convention, convention • Reuse, collaboration • Test. Period. • Generators Dev Booster Gem file You need an enormous reason to code something yourself. Easy to integrate Easy to use Fully documented Active community
  • 23. • Convention, convention, convention • Reuse, collaboration • Test. Period. • Generators Dev Booster • Rspec for unit tests • Factory-girl for data generator • Capybara for integration test • Built in mocking system • Integrated with Rails, generators and build machines, huge amount of artifacts When “I sign in” do within "#login-form" do fill_in 'Login', with: 'user@example.com' fill_in 'Password', with: 'password' end click_link 'Sign in' end Capybara Rspec Team- city Factory- girl Fantom Browser RailsMocking& Generators JS, CSS, HTML, Ruby…
  • 24. • Convention, convention, convention • Reuse, collaboration • Test. Period. • Generators Dev Booster • rails g controller Tweets • rails g controller Tags report_tag like_tag • rails g model Presentations title:string slides_count:integer • rails g rspec:controller Products • rails g scaffold OnlineGames game:string score:integer g
  • 25. • Full responsibility o DB o Gems o Assets o Vendors • Multi-environment • Fast deploy Deploy Booster Rails Application
  • 26. • Full responsibility o DB o Gems o Assets o Vendors • Multi-environment • Fast Setup • Fast deploy Deploy Booster • built in relational ORM • Part of the MVC (Model) • No SQL syntax, all using ActiveRecord built in functions (Ruby): ActiveRecord users = User.all Manage Databases • DB create/alter tables, indexes, etc. via ActiveRecord (Ruby): create_table :products do |t| t.string :name t.string :part_number end • Database structure and versioning using migrations 20111226120533_create_delayed_jobs.rb david = User.where(name:'David') david.age = 36 david.save!
  • 27. • Full responsibility o DB o Gems o Assets o Vendors • Multi-environment • Fast Setup • Fast deploy Deploy Booster • Full versions and dependencies management • Group of gems per environment • Install and upgrade all using single command Gems bundle install bundle update gem 'SystemTimer', require: 'system_timer' gem 'feedback_popup' gem 'i18n-js' group :production do gem 'asset_sync' gem 'turbo-sprockets-rails3' gem 'coffee-rails' gem 'closure-compiler' gem 'yui-compressor' end
  • 28. • Full responsibility o DB o Gems o Assets o Vendors • Multi-environment • Fast Setup • Fast deploy Deploy Booster • Single place to manage all your css, js, images and third- parties • Stack based manager called Assets Pipeline (easy to extend) (uglifier, unite to a single file, validate) • Control the order of bootstraping Assets Vendors • Manage all third-parties client side plugins (js and css) (jquery, angular-js, twitter-bootstrap, etc.) • Fully integrated with the assets pipeline
  • 29. • Full responsibility o DB o Gems o Assets o Vendors • Multi-environment • Fast Setup • Fast deploy Deploy Booster • Support multiple environment separation using yaml config • Built-in test, development and production environment • Full separation: DB, dependencies, testing, data-seed Multi -environment
  • 30. • Full responsibility o DB o Gems o Assets o Vendors • Multi-environment • Fast Setup • Fast deploy Deploy Booster • As fast as 3 steps to create a full active machine Fast Setup git pull <branch> bundle rake db:migrate • Single Responsibilty: o DB using SQLite o Server built in o UT support built in • Can illustrate production using multi-env rails s –e production
  • 31. • Full responsibility o DB o Gems o Assets o Vendors • Multi-environment • Fast Setup • Fast deploy Deploy Booster • Using git as source control and deploy tool • Using artifacts for measure and investigate your code (UT, code coverage, memory lakes, etc.) • Fully integrated with Saas hosting platforms: o deploy in one click o Deploy software not infrastructure Add-ons: db-backups, logs, ssl, etc. • Scale-out in not a forbidden word: o Build for the cloud, so easy to integrate: Queue, CDN, storage, etc. o Scale your project in a single click Fast Deploy Build. Deploy. Scale. git push production 2.4
  • 32.  Client side manage the flow and contains all presentation logic and view  Web servers should be data-oriented focusing on easy of scaling out and delivery speed  Ruby designed for programmers not machine: helps creating beautiful code, self-explained and dynamic  Rails enable to quickly create web servers:  Convention  Reuse  Single responsibility  Quick setup and deploy  Built-in scale out