SlideShare uma empresa Scribd logo
1 de 164
Modern Web
Technologies (and why
   you should care)
  Reuven M. Lerner • reuven@lerner.co.il
       Jerusalem Web Professionals
            January 18th, 2011
Who am I?
• Web developer since 1993
• Software architect, lecturer, consultant,
  technical advisor
• Linux Journal columnist since 1996
• Mostly Ruby on Rails + PostgreSQL, but
  also Python, jQuery, MySQL, and lots
  more...
How does the Internet
  (TCP/IP) work?

                 “Socket”
 Client                            Server
          Port              Port
How does the Internet
   (TCP/IP) work?

                   “Socket”
   Client                            Server
            Port              Port
Client opens
connection
How does the Internet
   (TCP/IP) work?

                   “Socket”
   Client                            Server
            Port              Port
Client opens                     Server accepts
connection                         connection
Protocols

• Communication standards built on top of
  TCP/IP, typically text-based
 • SMTP (e-mail)
 • FTP (file transfer)
 • NNTP (transfer of “news” articles)
WWW:
 Three technologies
• Markup format:
  HTML
• URL: protocol +
  server + port + doc
• Protocol: HTTP
How the Web works


Browser      Server
How the Web works
          HTTP Request

Browser                  Server
How the Web works
          HTTP Request

Browser                   Server



          HTTP Response
How the Web works
          HTTP Request

Browser                          Server



          HTTP Response

 Stateless — after the response is sent,
the connection is broken and forgotten
Simple request


Browser          Server
Simple request
          GET /

Browser           Server
Simple request
          GET /

Browser                  Server



              200 OK
              <html>
              <head>...</head>
              <body>...</body>
              </html>
Not found?


Browser                Server
Not found?
           GET /blahblah

Browser                    Server
Not found?
           GET /blahblah

Browser                       Server



                   404 Not found
Three things are certain:
Death, taxes, and lost data.
Guess which has occurred.


 — David Dixon, Salon magazine contest
Submitting forms


Browser         Server
Submitting forms
          POST /login
          name=reuven&password=secret

Browser                      Server
Submitting forms
          POST /login
          name=reuven&password=secret

Browser                      Server


                  200 OK
                  <html>...
                  <p>Thank you!</p>
                  ...</html>
Document = request

• If an HTML page contains images, then each
  is retrieved in a separate HTTP request
 • Page with 30 images = 31 HTTP requests
 • Page with 20 images, 10 JavaScript files,
    and 5 CSS files = 36 HTTP requests
Idea: Lie to the browser

• Don’t return a document to the user
• Rather, run a program when the user makes
  a request, and send the program’s output
• If the output is in HTML, then the browser
  will show it no differently than a static doc
Just in time production
• Wait as long as
  possible to create
  pages for the user
• Ideally, create them
  when the user
  requests them
• “Mass customization”
Dynamic document


Browser      Server
Dynamic document
          GET /

Browser           Server
Dynamic document
          GET /

Browser                  Server



              200 OK
              <html>
              <head>...</head>
              <body>...</body>
              </html>
Dynamic document
                 GET /

Browser                         Server



                     200 OK
                     <html>
                     <head>...</head>
Program output
                     <body>...</body>
                     </html>
What we return
• Usually HTML
• Image (e.g., stock graphs, Google Analytics)
• Word/Excel doc (e.g., from Google docs)
• PDF (e.g., PDF reports)
• XML, JSON (for computers, not people)
• Basically, any defined MIME type
APIs and mobile apps

Computer A     Computer B
 (browser)      (server)
APIs and mobile apps
             GET /

Computer A           Computer B
 (browser)            (server)
APIs and mobile apps
             GET /

Computer A                Computer B
 (browser)                 (server)



                 200 OK
                 <some-xml>
                 <talk>JWP</talk>
                 </some-xml>
APIs and mobile apps
       GET /

                    Computer B
                     (server)



           200 OK
           <some-xml>
           <talk>JWP</talk>
           </some-xml>
APIs and mobile apps
       GET /

                    Computer B
                     (server)



           200 OK
           <some-xml>
           <talk>JWP</talk>
           </some-xml>
APIs and mobile apps
       GET /

                    Computer B
                     (server)



           200 OK
           <some-xml>
           <talk>JWP</talk>
           </some-xml>
APIs and mobile apps
       GET /

                    Computer B
                     (server)



           200 OK
           <some-xml>
           <talk>JWP</talk>
           </some-xml>
What is a Web app?

• Receives its inputs via HTTP
• Sends its output via HTTP
• That’s it! A Web application can do
  anything you want, within these limits
That’s it!

• Now you understand how the Web works.
• Really, that’s it.
• Go home.
OK, perhaps not...

• How do we write these programs?
• Where (and how) do we store user data?
• How have the underlying technologies
  (URLs, HTTP, and HTML) advanced?
Early Web applications

• First server-side programs were in C
• They were compiled into binaries
 • So you had the CGI source (cgi-src)
    directory...
 • ... and the CGI binary (cgi-bin) directory
“Scripting” languages
• No explicit compilation
• Cross platform
• Built-in, powerful text functions
• Do a lot in a little bit of code
• Perl, Python, PHP, Ruby
• Typically open source
Frameworks

• DRY (Don’t repeat yourself)
• Get rid of the drudgery
• Concentrate on your business, rather than
  worrying about common Web issues
MVC paradigm
• Most modern frameworks use MVC
• From Smalltalk in the 1980s!
 • Model — communicates with database
 • View — HTML/JavaScript/CSS for user
 • Controller — handles requests
• Clear division of labor
Web frameworks in
  dynamic languages
• Programmer speed trumps execution
  speed
• Community support
• Plugins for commonly requested features
• Create a domain-specific language (DSL)
  for your specific needs
Ruby on Rails
• Ruby language
• Rails Web app framework (MVC)
• Designed for writing Web DSLs
• “Convention over configuration”
• Thousands of little improvements
• ActiveRecord — ORM
Person model


class Person < ActiveRecord::Base
end
Where’s the definition?
• The computer takes care of it automatically
• ActiveRecord knows what columns you
  have defined, and what their types are
  • (More on columns later)
• Only write things that cannot be
  understood automatically
Not only Rails
• Python (Django)
• PHP (Symfony)
• Perl (Catalyst)
• Groovy (Grails)
• Even if you don’t use Ruby on Rails, you
  have benefitted from its “opinions”
Plugins
• Rails (and other systems) have open-source
  plugins to handle common issues
  • Authentication
  • E-commerce
  • Social networking
• Don’t write these yourself! Customize
  existing code that has proved itself
Storage
• Applications are great!
• But what if we want to store information
  about our users?
 • Name, e-mail address, account balance
• We could use text files, but most people
  will use a database
What is a database?

 Store data
 confidently

                   Database


Retrieve data
   flexibly
Relational databases

   Define tables,
store data in them

                     Database


Retrieve data from
  related tables
Relational database

CREATE TABLE
   INSERT      SQL goes here
                               Database
  UPDATE
  DELETE
Relational databases

• Everything is stored in 2-dimensional tables
• Data should appear only once (normalized)
• “Join” tables to connect tables
• Technology is extremely robust, fail-safe
• Not all data is a good fit for this paradigm
id   first_name   last_name      phone

1     Reuven      Lerner     054-496-8405

2     Charlie     Kalech     02-671-9918
id       first_name     last_name         email

     1        Reuven        Lerner     reuven@lerner.co.il

     2        Charlie       Kalech     charlie@j-town.com

person_id   phone_number
   1        054-496-8405
   1        847-230-9795
   2         02-671-9918
   2        054-803-3356

   2        501-629-8620
id          first_name          last_name           email

    1             Reuven            Lerner       reuven@lerner.co.il

    2             Charlie           Kalech       charlie@j-town.com

person_id   phone_number_type_id       phone_number            id       type
   1                 2                 054-496-8405
   1                 1                 847-230-9795            1       work
   2                 1                  02-671-9918
                                                               2       mobile
   2                 2                 054-803-3356

   2                 3                 501-629-8620            3        fax

                                                               4       home
id          first_name          last_name           email

      1             Reuven            Lerner       reuven@lerner.co.il

      2             Charlie           Kalech       charlie@j-town.com

  person_id   phone_number_type_id       phone_number            id       type
     1                 2                 054-496-8405
     1                 1                 847-230-9795            1       work
     2                 1                  02-671-9918
                                                                 2       mobile
     2                 2                 054-803-3356

     2                 3                 501-629-8620            3        fax

                                                                 4       home

SELECT P.first_name, P.last_name, P.email,
       PN.phone_number, PNT.type
FROM People P, Phone_Numbers PN,
     Phone_Number_Types PNT
WHERE PN.person_id = P.id
  AND PNT.id = PN.phone_number_type_id
Another language!
• SQL is the language of relational databases
• So a Web app will use a language (e.g.,
  Ruby, Python, or PHP) + SQL
• Or use an ORM, which automatically
  translates your language into SQL
 Person.first.phone_number
Extending our diagram
  Browser
Extending our diagram
            HTTP Request
  Browser
Extending our diagram
            HTTP Request
  Browser                  Server
Extending our diagram
            HTTP Request
  Browser                  Server
Extending our diagram
            HTTP Request
  Browser                  Server




                           Database
Extending our diagram
            HTTP Request
  Browser                  Server




                           Database
Extending our diagram
            HTTP Request
  Browser                   Server



            HTTP Response




                            Database
Popular databases

• PostgreSQL (my favorite)
• MySQL
• Microsoft SQL Server
• Oracle
• Most popular: SQLite!
Scaling problems
• Lots of requests?
 • Optimize
Scaling problems
• Lots of requests?
 • Optimize
• Even more requests?
 • Buy a bigger server
Scaling problems
• Lots of requests?
 • Optimize
• Even more requests?
 • Buy a bigger server
• What next?
 • Panic! (Or spend lots of money)
Sharding
• Split your data across multiple databases
• This works, but...
 • Requires rewriting a lot of code
 • Maintenance is a big issue
 • Re-sharding as each server gets
    overwhelmed can be expensive, time-
    consuming
Cloud
• Don’t manage your own server!
• Rent a server by the hour, day, or month
• Lots of requests? Add more servers!
• You can even use a cloud database server
 • No more scaling issues — let someone
    else handle the headaches
Non-relational
        databases
• Don’t store things in tables!
• Don’t pre-define a schema
• No SQL!
 • Indeed, known as “NoSQL” databases
 • Only common factor: No SQL, non-
    relational
Examples
• Key-value stores
 • e.g., Memcached, Redis, Tokyo Cabinet
• Columnar databases
 • e.g., Cassandra
• Document databases
 • e.g., MongoDB, CouchDB
MapReduce / Hadoop
• Google and Yahoo do it like this:
 • Split data across many servers
 • Run a function on all of those servers
 • Collect the results
 • Display to the user!
 • (Too slow? Add more servers!)
NoSQL: Good news
• Often easier to administer, configure
 • Scaling to multiple servers is a no-brainer
• No new programming language (SQL)!
• Better fit for certain kinds of data
• Better performance than a relational DB
• Lots of options to choose from!
NoSQL: Bad news
• Speed is in the eye of the beholder
• Is “eventually consistent” good enough?
• Non-normalized data — ugh!
• Reporting can be harder
• Less tested than relational databases
 • Can you trust your data to them?
Meanwhile...

• Our browsers are displaying HTML
• HTML had several problems:
 • Standardized set of tags
 • Making it easy for programs to parse
 • Semantic, display content were mixed
HTML standards
• HTML — several versions, several
  standards, none universally accepted
• XML — lets us create HTML-like
  languages, for computer conversations
• XHTML — HTML for pedantic people
• It was a big mess!
HTML5
• Relaxes much of the formality of XHTML,
  while remaining easy for computers to read
• Backward compatible to a large degree
• Adds a number of tags for better semantics
• Best of all: Lots of new JavaScript goodies
 • More on this in a moment
HTML5 declaration
HTML5 declaration

<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/
xhtml1-transitional.dtd">
HTML5 declaration

<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/
xhtml1-transitional.dtd">
<!DOCTYPE html>
New “email” tag


<input type=”text” name=”email” />
<input type=”email” name=”email” />
New “url” tag


<input type=”text” name=”url” />
<input type=”url” name=”url” />
New “date” tag


<input type=”date” name=”date” />
Color picker!


<input type=”color” name=”color” />
And more
• Validation — built-in validation of form
  element inputs, via regular expressions
  • No more JavaScript plugins!
• Sliders — more natural numeric inputs
• Canvas — draw any picture you might like,
  and detect/change it with software
• Hints in text fields (e.g., “search”)
My favorite

• Private data in attributes!
• Any attribute starting with “data-” is
  considered valid
• A great way to stash information inside of
  HTML elements without violating standards
Oh, yeah
• These don’t all work.
• Many of them don’t work on any browser
• Most work on only some browsers.
• What to do? Wait. Or use Modernizr,
  which uses JavaScript to detect features.
• If a feature isn’t there, you can fall back
CSS

• Cascading Style Sheets
• Split semantic markup from presentation
• One CSS file can apply to an entire site
• No more “style” tags in your text!
• Easy to move place things, create effects
Ids are unique

<p id=”important”>Agenda</p>


p#important {
    font-size: 13p;
    font-weight: bold;
}
Classes can repeat
<p class=”important”>Agenda</p>
<p class=”important”>Lunch</p>


p.important {
    font-size: 13p;
    font-weight: bold;
}
It gets better
• You can set styles for when the user’s
  mouse hovers over or clicks on an element
• In other words: Cheap animation!
• Many uses of JavaScript (e.g., some menus)
  can now be done with simple CSS
• You can make beautiful sites with CSS
CSS3: Cool effects

• Rounded corners
• Transparency
• Text shadows and drop shadows
• Gradients
CSS3: Cool selectors
• If you love regular expressions, then these
  selectors will be second nature to you:
 p[id=”foo”] { background: green}
 p[id^=”foo”] { background: green}
 p[id$=”foo”] { background: green}
 p[id*=”foo”] { background: green}
CSS3: Cool selectors
• If you love regular expressions, then these
  selectors will be second nature to you:
 p[id=”foo”] { background: green}
                    Equals
 p[id^=”foo”] { background: green}
 p[id$=”foo”] { background: green}
 p[id*=”foo”] { background: green}
CSS3: Cool selectors
• If you love regular expressions, then these
  selectors will be second nature to you:
 p[id=”foo”] { background: green}

                  Starts with
 p[id^=”foo”] { background: green}
 p[id$=”foo”] { background: green}
 p[id*=”foo”] { background: green}
CSS3: Cool selectors
• If you love regular expressions, then these
  selectors will be second nature to you:
 p[id=”foo”] { background: green}
 p[id^=”foo”] { background: green}
                  Ends with
 p[id$=”foo”] { background: green}
 p[id*=”foo”] { background: green}
CSS3: Cool selectors
• If you love regular expressions, then these
  selectors will be second nature to you:
 p[id=”foo”] { background: green}
 p[id^=”foo”] { background: green}
 p[id$=”foo”] { background: green}
                   Contains
 p[id*=”foo”] { background: green}
OK, that’s nice.
• But really, the big news with HTML5
  doesn’t have to do with HTML at all.
• Instead, it has to do with JavaScript.
• Remember JavaScript?
• It’s the programming language that we love
  to hate. (At least, I used to.)
JavaScript
• Originally “LiveScript,” a language that
  executes programs in the browser
• Renamed “JavaScript” when an unrelated
  language (“Java”) stole the thunder
• Renamed (officially) ECMAScript for
  standardization purposes
  • No one actually calls it this
HTML5 turns the
browser into a smart,
powerful, networked
application platform.
 JavaScript makes it
      possible.
Powerful? Huh?

• Didn’t I just say that I love to hate
  JavaScript?
• And then I said that it was powerful?
• What gives?
JavaScript is
      the new hotness
• Browsers are competing for fastest, best
 • Google’s V8
 • Mozilla’s TraceMonkey (and JägerMonkey)
 • Safari’s Nitro
 • IE’s Chakra
• JavaScript is faster, more stable than ever!
Also: frameworks
• Remove the drudgery of JavaScript
• Handle differences between browsers
• Make it easy to perform common tasks
• Lots of plugins available
• For me, it’s the difference between pain and
  pleasure when working with JavaScript
JavaScript frameworks

• Dojo
• YUI
• MooTools
• Prototype
• jQuery (more on this in a bit)
Ajax
• One reason for JavaScript libraries: Ajax!
• Make HTTP requests from within the page
• No refresh! Just get results from the
  server, and modify the page accordingly
• This has revolutionized our view of Web
  pages
Ajax


Browser          Server
Ajax
          POST /login
          name=reuven&password=secret

Browser                      Server
Ajax
          POST /login
          name=reuven&password=secret

Browser                      Server


                  200 OK
                  <html>...
                  <p>Thank you!</p>
                  ...</html>
Ajax
          POST /login
          name=reuven&password=secret

Browser                      Server


                  200 OK
                  <html>...
                  <p>Thank you!</p>
                  ...</html>
Ajax
          POST /login
          name=reuven&password=secret

Browser                      Server


                  200 OK
                  <html>...
                  <p>Thank you!</p>
                  ...</html>
Ajax
          POST /login
          name=reuven&password=secret

Browser                      Server


                  200 OK
                  <html>...
                  <p>Thank you!</p>
                  ...</html>
Ajax
          POST /login
          name=reuven&password=secret

Browser                      Server


                  200 OK
                  <html>...
                  <p>Thank you!</p>
                  ...</html>
Ajax isn’t everything
• What if I want a chat application, or
  something else that stays open?
• What if I want to execute more than one
  JavaScript function at a time?
• What if I want to store things locally?
• HTML5 provides all this — and more!
Canvas
• A complete drawing area, in your browser!
• Use JavaScript to:
 • Draw arbitrary shapes
 • Detect the mouse
 • Detect the drawing
• The end of Flash? Maybe...
Geolocation

• Your browser can know where you are!
• It can send this info to the server
• It’s not perfect, but still pretty good
• To avoid privacy issues, users are always
  asked if their location should be shared
Inter-page
      communication
• Modern Web apps can span multiple pages
• HTML5 makes it easy for two pages (from
  the same server) to communicate
• The receiver knows which server sent the
  data — so it can filter incoming messages,
  as well as screen them for security
Web sockets
• This is potentially the biggest deal of all
• Ajax allows for server connections. But:
 • High overhead
 • Stateless
• Web sockets have low overhead, and they
  stay open as long as you need!
Using Web sockets
Using Web sockets
var weatherSocket = new
WebSocket("ws://localhost:8080");
Using Web sockets
var weatherSocket = new
WebSocket("ws://localhost:8080");
weatherSocket.onopen = function(e)
{ alert("Opened weather socket");};
Using Web sockets
var weatherSocket = new
WebSocket("ws://localhost:8080");
weatherSocket.onopen = function(e)
{ alert("Opened weather socket");};
weatherSocket.onmessage =
function(e) { alert("Got message: "
+ e.data);};
Using Web sockets
var weatherSocket = new
WebSocket("ws://localhost:8080");
weatherSocket.onopen = function(e)
{ alert("Opened weather socket");};
weatherSocket.onmessage =
function(e) { alert("Got message: "
+ e.data);};
weatherSocket.onclose = function(e)
{ alert("Closing socket..."); };
What can sockets do?
• Chat servers
• Stock feeds
• Teleconferencing
• Who knows?
 • Remember, HTTP was only invented after
    sockets had been around for 15 years
Web workers
• Execute more than one thing at a time
• In other words:You can run JavaScript
  functions in the background
 • Process text
 • Open Web sockets
 • Perform calculations
Local storage
• Now Web apps can store data
• A little database of name-value pairs
  var foo = localStorage.getItem("bar");
  localStorage.setItem("bar", foo);
Local storage
• Now Web apps can store data
• A little database of name-value pairs
  var foo = localStorage.getItem("bar");
  localStorage.setItem("bar", foo);


  var foo = localStorage["bar"];
Local storage
• Now Web apps can store data
• A little database of name-value pairs
  var foo = localStorage.getItem("bar");
  localStorage.setItem("bar", foo);


  var foo = localStorage["bar"];
  localStorage["bar"] = foo;
Media

• Standard (well, sort of) ways to play audio
  and video
  • No more Flash!
• Problem: No one format is supported by all
  browsers
jQuery
• jQuery has taken the world by storm
 • Super-easy to use
 • Extremely fast
 • Open source (of course!)
 • Easy to write plugins
 • Lots of plugins are available
Basic jQuery
• $(CSS_SELECTOR) returns one or more
  objects
• Now what?
 • Execute something on those objects
 • Hang a function on those objects, to
    execute when a condition is met
Remember our CSS?

<p id=”important”>Agenda</p>


p#important {
    font-size: 13p;
    font-weight: bold;
}
Fire on events
$('p#important').click(function() {
      alert("You clicked on me!");
});
Fire on events
$('p#important').click(function() {
      alert("You clicked on me!");
});


$('p.important').hover(function() {
Fire on events
$('p#important').click(function() {
      alert("You clicked on me!");
});


$('p.important').hover(function() {
      alert("Whew, they’re gone");
Fire on events
$('p#important').click(function() {
      alert("You clicked on me!");
});


$('p.important').hover(function() {
      alert("Whew, they’re gone");
});
Plugins in jQuery
• jQuery’s syntax makes it trivial to do
  complex operations
• Between powerful selectors and many
  built-in functions, you can manipulate text,
  HTML, and styles easily
• But even better — there are plugins that
  do lots of things for you
Unobtrusive

• The jQuery is not in the HTML file
• This is called “unobtrusive JavaScript”
• Good HTML has no CSS, and no JavaScript
$.fn.ubbi = function(options) {
function ubbify(text) {
    return text.replace(/([aeiou])/gi, 'ub$1');
}
return this.each(function() {
     $(this).bind('mouseover', function() {
       var original_text = $(this).html();
       $(this).attr({originalText: original_text});
       $(this).html(ubbify(original_text));
      });
    $(this).bind('mouseout', function() {
      $(this).html($(this).attr("originalText"));
      $(this).attr({originalText: ""});
     });
    });
};
$.fn.ubbi = function(options) {
function ubbify(text) {
    return text.replace(/([aeiou])/gi, 'ub$1');
}
return this.each(function() {
     $(this).bind('mouseover', function() {
       var original_text = $(this).html();
       $(this).attr({originalText: original_text});
       $(this).html(ubbify(original_text));
      });
    $(this).bind('mouseout', function() {
      $(this).html($(this).attr("originalText"));
      $(this).attr({originalText: ""});
     });
    });
};
$.fn.ubbi = function(options) {
function ubbify(text) {
    return text.replace(/([aeiou])/gi, 'ub$1');
}
return this.each(function() {
     $(this).bind('mouseover', function() {
       var original_text = $(this).html();
       $(this).attr({originalText: original_text});
       $(this).html(ubbify(original_text));
      });
    $(this).bind('mouseout', function() {
      $(this).html($(this).attr("originalText"));
      $(this).attr({originalText: ""});
     });
    });
};
Now activate it!

$(document).ready(function() {
  $(".ubbi").ubbi();
});
jQuery issues
• Lots of plugins — which ones are good?
 • Welcome to the world of open source!
• You’re still defining functions
 • Yes — and functions as data takes a while
    to get used to
• Remember: JavaScript is programming, and
  a different sort than most languages
Want a Web app?


• It used to be:
 • “What operating system, language, and
    database will I use?”
But today, it’s...
• What server language and framework?
  JavaScript framework? Hosted or cloud?
• What type of database (relational, NoSQL)?
  Which one? Hosted or cloud?
• Do we offer an API? A mobile app? Both?
• Which HTML5 features do we want to
  use, and how do we gracefully degrade?
My brain is too small!
• Yes, there’s a lot to learn
• Most of it can wait a little bit
• There are oodles of tutorials
  and books that can help you
• Besides a lot of this is still
  highly transitional
Whew!

• There’s a lot to the modern Web
• It’s fun and exciting, and continues to move
  forward at breakneck speed
• Understanding as many of these parts as
  possible will help you make better
  decisions, and better applications!
Any questions?

• Call me: 054-496-8405
• E-mail me: reuven@lerner.co.il
• Interrupt me: reuvenlerner (Skype/AIM)

Mais conteúdo relacionado

Mais procurados

Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersMark Myers
 
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”panagenda
 
PHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM iPHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM iAlan Seiden
 
Jmp107 Web Services
Jmp107 Web ServicesJmp107 Web Services
Jmp107 Web Servicesdominion
 

Mais procurados (6)

109 sem 1_-_kasdorf
109 sem 1_-_kasdorf109 sem 1_-_kasdorf
109 sem 1_-_kasdorf
 
Email
Email Email
Email
 
Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino Developers
 
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
 
PHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM iPHP Toolkit from Zend and IBM: Open Source on IBM i
PHP Toolkit from Zend and IBM: Open Source on IBM i
 
Jmp107 Web Services
Jmp107 Web ServicesJmp107 Web Services
Jmp107 Web Services
 

Semelhante a Modern Web Technologies — Jerusalem Web Professionals, January 2011

Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xmlsrp24
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
Grown-up javascript with AngularJS
Grown-up javascript with AngularJSGrown-up javascript with AngularJS
Grown-up javascript with AngularJSMykhailo Kotsur
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & FeaturesDave Ross
 
How does the Internet Work?
How does the Internet Work?How does the Internet Work?
How does the Internet Work?Dina Goldshtein
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_phpJeanho Chu
 
DevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as CodeDevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as CodeMichael Ducy
 
Best Practices for Design Hardware APIs
Best Practices for Design Hardware APIsBest Practices for Design Hardware APIs
Best Practices for Design Hardware APIsMatt Haines
 
Basic computers for DIU laptop project students
Basic computers for DIU laptop project studentsBasic computers for DIU laptop project students
Basic computers for DIU laptop project studentsAlauddin Azad
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP TutorialLorna Mitchell
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsCameron Dutro
 
Embracing HTTP in the era of API’s
Embracing HTTP in the era of API’sEmbracing HTTP in the era of API’s
Embracing HTTP in the era of API’sVisug
 
NotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersNotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersRob Fuller
 
Basic of computers
Basic of computers Basic of computers
Basic of computers Harsh Porwal
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without InterferenceTony Tam
 
Uklug 2014 connections dev faq
Uklug 2014  connections dev faqUklug 2014  connections dev faq
Uklug 2014 connections dev faqMark Myers
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_phpJeanho Chu
 

Semelhante a Modern Web Technologies — Jerusalem Web Professionals, January 2011 (20)

Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Grown-up javascript with AngularJS
Grown-up javascript with AngularJSGrown-up javascript with AngularJS
Grown-up javascript with AngularJS
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & Features
 
How does the Internet Work?
How does the Internet Work?How does the Internet Work?
How does the Internet Work?
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
 
DevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as CodeDevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as Code
 
Best Practices for Design Hardware APIs
Best Practices for Design Hardware APIsBest Practices for Design Hardware APIs
Best Practices for Design Hardware APIs
 
Basic computers for DIU laptop project students
Basic computers for DIU laptop project studentsBasic computers for DIU laptop project students
Basic computers for DIU laptop project students
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
Kuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails AppsKuby, ActiveDeployment for Rails Apps
Kuby, ActiveDeployment for Rails Apps
 
Embracing HTTP in the era of API’s
Embracing HTTP in the era of API’sEmbracing HTTP in the era of API’s
Embracing HTTP in the era of API’s
 
NotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersNotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for Pentesters
 
Basic of computers
Basic of computers Basic of computers
Basic of computers
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
Uklug 2014 connections dev faq
Uklug 2014  connections dev faqUklug 2014  connections dev faq
Uklug 2014 connections dev faq
 
Code is art
Code is artCode is art
Code is art
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
 

Mais de Reuven Lerner

Technical training business talk.key
Technical training business talk.keyTechnical training business talk.key
Technical training business talk.keyReuven Lerner
 
Big Data — Your new best friend
Big Data — Your new best friendBig Data — Your new best friend
Big Data — Your new best friendReuven Lerner
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databasePostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databaseReuven Lerner
 
Python's magic methods
Python's magic methodsPython's magic methods
Python's magic methodsReuven Lerner
 
What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?Reuven Lerner
 
Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Reuven Lerner
 
Web APIs: The future of software
Web APIs: The future of softwareWeb APIs: The future of software
Web APIs: The future of softwareReuven Lerner
 
Intro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, JerusalemIntro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, JerusalemReuven Lerner
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talkReuven Lerner
 
Git talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in IsraelGit talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in IsraelReuven Lerner
 
Dynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship groupDynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship groupReuven Lerner
 
PostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conferencePostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conferenceReuven Lerner
 

Mais de Reuven Lerner (20)

Technical training business talk.key
Technical training business talk.keyTechnical training business talk.key
Technical training business talk.key
 
Big Data — Your new best friend
Big Data — Your new best friendBig Data — Your new best friend
Big Data — Your new best friend
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databasePostgreSQL, your NoSQL database
PostgreSQL, your NoSQL database
 
Python's magic methods
Python's magic methodsPython's magic methods
Python's magic methods
 
What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?What can Ruby learn from Python (and vice versa)?
What can Ruby learn from Python (and vice versa)?
 
Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014Functional Python Webinar from October 22nd, 2014
Functional Python Webinar from October 22nd, 2014
 
Web APIs: The future of software
Web APIs: The future of softwareWeb APIs: The future of software
Web APIs: The future of software
 
Rails israel 2013
Rails israel 2013Rails israel 2013
Rails israel 2013
 
Intro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, JerusalemIntro to cloud computing — MegaCOMM 2013, Jerusalem
Intro to cloud computing — MegaCOMM 2013, Jerusalem
 
PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
Rails traps
Rails trapsRails traps
Rails traps
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
Git talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in IsraelGit talk from Open 2011 conference in Israel
Git talk from Open 2011 conference in Israel
 
Dynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship groupDynamic languages, for software craftmanship group
Dynamic languages, for software craftmanship group
 
PostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conferencePostgreSQL talk, Database 2011 conference
PostgreSQL talk, Database 2011 conference
 
ActiveRecord 2.3
ActiveRecord 2.3ActiveRecord 2.3
ActiveRecord 2.3
 
Ruby objects
Ruby objectsRuby objects
Ruby objects
 
Rails console
Rails consoleRails console
Rails console
 
Rails tools
Rails toolsRails tools
Rails tools
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 

Último

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Último (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
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!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Modern Web Technologies — Jerusalem Web Professionals, January 2011

  • 1. Modern Web Technologies (and why you should care) Reuven M. Lerner • reuven@lerner.co.il Jerusalem Web Professionals January 18th, 2011
  • 2. Who am I? • Web developer since 1993 • Software architect, lecturer, consultant, technical advisor • Linux Journal columnist since 1996 • Mostly Ruby on Rails + PostgreSQL, but also Python, jQuery, MySQL, and lots more...
  • 3. How does the Internet (TCP/IP) work? “Socket” Client Server Port Port
  • 4. How does the Internet (TCP/IP) work? “Socket” Client Server Port Port Client opens connection
  • 5. How does the Internet (TCP/IP) work? “Socket” Client Server Port Port Client opens Server accepts connection connection
  • 6. Protocols • Communication standards built on top of TCP/IP, typically text-based • SMTP (e-mail) • FTP (file transfer) • NNTP (transfer of “news” articles)
  • 7. WWW: Three technologies • Markup format: HTML • URL: protocol + server + port + doc • Protocol: HTTP
  • 8. How the Web works Browser Server
  • 9. How the Web works HTTP Request Browser Server
  • 10. How the Web works HTTP Request Browser Server HTTP Response
  • 11. How the Web works HTTP Request Browser Server HTTP Response Stateless — after the response is sent, the connection is broken and forgotten
  • 13. Simple request GET / Browser Server
  • 14. Simple request GET / Browser Server 200 OK <html> <head>...</head> <body>...</body> </html>
  • 16. Not found? GET /blahblah Browser Server
  • 17. Not found? GET /blahblah Browser Server 404 Not found
  • 18. Three things are certain: Death, taxes, and lost data. Guess which has occurred. — David Dixon, Salon magazine contest
  • 20. Submitting forms POST /login name=reuven&password=secret Browser Server
  • 21. Submitting forms POST /login name=reuven&password=secret Browser Server 200 OK <html>... <p>Thank you!</p> ...</html>
  • 22. Document = request • If an HTML page contains images, then each is retrieved in a separate HTTP request • Page with 30 images = 31 HTTP requests • Page with 20 images, 10 JavaScript files, and 5 CSS files = 36 HTTP requests
  • 23.
  • 24. Idea: Lie to the browser • Don’t return a document to the user • Rather, run a program when the user makes a request, and send the program’s output • If the output is in HTML, then the browser will show it no differently than a static doc
  • 25. Just in time production • Wait as long as possible to create pages for the user • Ideally, create them when the user requests them • “Mass customization”
  • 27. Dynamic document GET / Browser Server
  • 28. Dynamic document GET / Browser Server 200 OK <html> <head>...</head> <body>...</body> </html>
  • 29. Dynamic document GET / Browser Server 200 OK <html> <head>...</head> Program output <body>...</body> </html>
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. What we return • Usually HTML • Image (e.g., stock graphs, Google Analytics) • Word/Excel doc (e.g., from Google docs) • PDF (e.g., PDF reports) • XML, JSON (for computers, not people) • Basically, any defined MIME type
  • 35. APIs and mobile apps Computer A Computer B (browser) (server)
  • 36. APIs and mobile apps GET / Computer A Computer B (browser) (server)
  • 37. APIs and mobile apps GET / Computer A Computer B (browser) (server) 200 OK <some-xml> <talk>JWP</talk> </some-xml>
  • 38. APIs and mobile apps GET / Computer B (server) 200 OK <some-xml> <talk>JWP</talk> </some-xml>
  • 39. APIs and mobile apps GET / Computer B (server) 200 OK <some-xml> <talk>JWP</talk> </some-xml>
  • 40. APIs and mobile apps GET / Computer B (server) 200 OK <some-xml> <talk>JWP</talk> </some-xml>
  • 41. APIs and mobile apps GET / Computer B (server) 200 OK <some-xml> <talk>JWP</talk> </some-xml>
  • 42. What is a Web app? • Receives its inputs via HTTP • Sends its output via HTTP • That’s it! A Web application can do anything you want, within these limits
  • 43. That’s it! • Now you understand how the Web works. • Really, that’s it. • Go home.
  • 44.
  • 45. OK, perhaps not... • How do we write these programs? • Where (and how) do we store user data? • How have the underlying technologies (URLs, HTTP, and HTML) advanced?
  • 46. Early Web applications • First server-side programs were in C • They were compiled into binaries • So you had the CGI source (cgi-src) directory... • ... and the CGI binary (cgi-bin) directory
  • 47. “Scripting” languages • No explicit compilation • Cross platform • Built-in, powerful text functions • Do a lot in a little bit of code • Perl, Python, PHP, Ruby • Typically open source
  • 48. Frameworks • DRY (Don’t repeat yourself) • Get rid of the drudgery • Concentrate on your business, rather than worrying about common Web issues
  • 49. MVC paradigm • Most modern frameworks use MVC • From Smalltalk in the 1980s! • Model — communicates with database • View — HTML/JavaScript/CSS for user • Controller — handles requests • Clear division of labor
  • 50. Web frameworks in dynamic languages • Programmer speed trumps execution speed • Community support • Plugins for commonly requested features • Create a domain-specific language (DSL) for your specific needs
  • 51. Ruby on Rails • Ruby language • Rails Web app framework (MVC) • Designed for writing Web DSLs • “Convention over configuration” • Thousands of little improvements • ActiveRecord — ORM
  • 52. Person model class Person < ActiveRecord::Base end
  • 53. Where’s the definition? • The computer takes care of it automatically • ActiveRecord knows what columns you have defined, and what their types are • (More on columns later) • Only write things that cannot be understood automatically
  • 54. Not only Rails • Python (Django) • PHP (Symfony) • Perl (Catalyst) • Groovy (Grails) • Even if you don’t use Ruby on Rails, you have benefitted from its “opinions”
  • 55. Plugins • Rails (and other systems) have open-source plugins to handle common issues • Authentication • E-commerce • Social networking • Don’t write these yourself! Customize existing code that has proved itself
  • 56. Storage • Applications are great! • But what if we want to store information about our users? • Name, e-mail address, account balance • We could use text files, but most people will use a database
  • 57. What is a database? Store data confidently Database Retrieve data flexibly
  • 58. Relational databases Define tables, store data in them Database Retrieve data from related tables
  • 59. Relational database CREATE TABLE INSERT SQL goes here Database UPDATE DELETE
  • 60. Relational databases • Everything is stored in 2-dimensional tables • Data should appear only once (normalized) • “Join” tables to connect tables • Technology is extremely robust, fail-safe • Not all data is a good fit for this paradigm
  • 61. id first_name last_name phone 1 Reuven Lerner 054-496-8405 2 Charlie Kalech 02-671-9918
  • 62. id first_name last_name email 1 Reuven Lerner reuven@lerner.co.il 2 Charlie Kalech charlie@j-town.com person_id phone_number 1 054-496-8405 1 847-230-9795 2 02-671-9918 2 054-803-3356 2 501-629-8620
  • 63. id first_name last_name email 1 Reuven Lerner reuven@lerner.co.il 2 Charlie Kalech charlie@j-town.com person_id phone_number_type_id phone_number id type 1 2 054-496-8405 1 1 847-230-9795 1 work 2 1 02-671-9918 2 mobile 2 2 054-803-3356 2 3 501-629-8620 3 fax 4 home
  • 64. id first_name last_name email 1 Reuven Lerner reuven@lerner.co.il 2 Charlie Kalech charlie@j-town.com person_id phone_number_type_id phone_number id type 1 2 054-496-8405 1 1 847-230-9795 1 work 2 1 02-671-9918 2 mobile 2 2 054-803-3356 2 3 501-629-8620 3 fax 4 home SELECT P.first_name, P.last_name, P.email, PN.phone_number, PNT.type FROM People P, Phone_Numbers PN, Phone_Number_Types PNT WHERE PN.person_id = P.id AND PNT.id = PN.phone_number_type_id
  • 65. Another language! • SQL is the language of relational databases • So a Web app will use a language (e.g., Ruby, Python, or PHP) + SQL • Or use an ORM, which automatically translates your language into SQL Person.first.phone_number
  • 67. Extending our diagram HTTP Request Browser
  • 68. Extending our diagram HTTP Request Browser Server
  • 69. Extending our diagram HTTP Request Browser Server
  • 70. Extending our diagram HTTP Request Browser Server Database
  • 71. Extending our diagram HTTP Request Browser Server Database
  • 72. Extending our diagram HTTP Request Browser Server HTTP Response Database
  • 73. Popular databases • PostgreSQL (my favorite) • MySQL • Microsoft SQL Server • Oracle • Most popular: SQLite!
  • 74. Scaling problems • Lots of requests? • Optimize
  • 75. Scaling problems • Lots of requests? • Optimize • Even more requests? • Buy a bigger server
  • 76. Scaling problems • Lots of requests? • Optimize • Even more requests? • Buy a bigger server • What next? • Panic! (Or spend lots of money)
  • 77. Sharding • Split your data across multiple databases • This works, but... • Requires rewriting a lot of code • Maintenance is a big issue • Re-sharding as each server gets overwhelmed can be expensive, time- consuming
  • 78. Cloud • Don’t manage your own server! • Rent a server by the hour, day, or month • Lots of requests? Add more servers! • You can even use a cloud database server • No more scaling issues — let someone else handle the headaches
  • 79. Non-relational databases • Don’t store things in tables! • Don’t pre-define a schema • No SQL! • Indeed, known as “NoSQL” databases • Only common factor: No SQL, non- relational
  • 80. Examples • Key-value stores • e.g., Memcached, Redis, Tokyo Cabinet • Columnar databases • e.g., Cassandra • Document databases • e.g., MongoDB, CouchDB
  • 81. MapReduce / Hadoop • Google and Yahoo do it like this: • Split data across many servers • Run a function on all of those servers • Collect the results • Display to the user! • (Too slow? Add more servers!)
  • 82. NoSQL: Good news • Often easier to administer, configure • Scaling to multiple servers is a no-brainer • No new programming language (SQL)! • Better fit for certain kinds of data • Better performance than a relational DB • Lots of options to choose from!
  • 83. NoSQL: Bad news • Speed is in the eye of the beholder • Is “eventually consistent” good enough? • Non-normalized data — ugh! • Reporting can be harder • Less tested than relational databases • Can you trust your data to them?
  • 84. Meanwhile... • Our browsers are displaying HTML • HTML had several problems: • Standardized set of tags • Making it easy for programs to parse • Semantic, display content were mixed
  • 85. HTML standards • HTML — several versions, several standards, none universally accepted • XML — lets us create HTML-like languages, for computer conversations • XHTML — HTML for pedantic people • It was a big mess!
  • 86. HTML5 • Relaxes much of the formality of XHTML, while remaining easy for computers to read • Backward compatible to a large degree • Adds a number of tags for better semantics • Best of all: Lots of new JavaScript goodies • More on this in a moment
  • 88. HTML5 declaration <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd">
  • 89. HTML5 declaration <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd"> <!DOCTYPE html>
  • 90.
  • 91.
  • 92.
  • 93.
  • 94. New “email” tag <input type=”text” name=”email” /> <input type=”email” name=”email” />
  • 95. New “url” tag <input type=”text” name=”url” /> <input type=”url” name=”url” />
  • 96. New “date” tag <input type=”date” name=”date” />
  • 98. And more • Validation — built-in validation of form element inputs, via regular expressions • No more JavaScript plugins! • Sliders — more natural numeric inputs • Canvas — draw any picture you might like, and detect/change it with software • Hints in text fields (e.g., “search”)
  • 99. My favorite • Private data in attributes! • Any attribute starting with “data-” is considered valid • A great way to stash information inside of HTML elements without violating standards
  • 100. Oh, yeah • These don’t all work. • Many of them don’t work on any browser • Most work on only some browsers. • What to do? Wait. Or use Modernizr, which uses JavaScript to detect features. • If a feature isn’t there, you can fall back
  • 101. CSS • Cascading Style Sheets • Split semantic markup from presentation • One CSS file can apply to an entire site • No more “style” tags in your text! • Easy to move place things, create effects
  • 102. Ids are unique <p id=”important”>Agenda</p> p#important { font-size: 13p; font-weight: bold; }
  • 103. Classes can repeat <p class=”important”>Agenda</p> <p class=”important”>Lunch</p> p.important { font-size: 13p; font-weight: bold; }
  • 104. It gets better • You can set styles for when the user’s mouse hovers over or clicks on an element • In other words: Cheap animation! • Many uses of JavaScript (e.g., some menus) can now be done with simple CSS • You can make beautiful sites with CSS
  • 105. CSS3: Cool effects • Rounded corners • Transparency • Text shadows and drop shadows • Gradients
  • 106. CSS3: Cool selectors • If you love regular expressions, then these selectors will be second nature to you: p[id=”foo”] { background: green} p[id^=”foo”] { background: green} p[id$=”foo”] { background: green} p[id*=”foo”] { background: green}
  • 107. CSS3: Cool selectors • If you love regular expressions, then these selectors will be second nature to you: p[id=”foo”] { background: green} Equals p[id^=”foo”] { background: green} p[id$=”foo”] { background: green} p[id*=”foo”] { background: green}
  • 108. CSS3: Cool selectors • If you love regular expressions, then these selectors will be second nature to you: p[id=”foo”] { background: green} Starts with p[id^=”foo”] { background: green} p[id$=”foo”] { background: green} p[id*=”foo”] { background: green}
  • 109. CSS3: Cool selectors • If you love regular expressions, then these selectors will be second nature to you: p[id=”foo”] { background: green} p[id^=”foo”] { background: green} Ends with p[id$=”foo”] { background: green} p[id*=”foo”] { background: green}
  • 110. CSS3: Cool selectors • If you love regular expressions, then these selectors will be second nature to you: p[id=”foo”] { background: green} p[id^=”foo”] { background: green} p[id$=”foo”] { background: green} Contains p[id*=”foo”] { background: green}
  • 111. OK, that’s nice. • But really, the big news with HTML5 doesn’t have to do with HTML at all. • Instead, it has to do with JavaScript. • Remember JavaScript? • It’s the programming language that we love to hate. (At least, I used to.)
  • 112. JavaScript • Originally “LiveScript,” a language that executes programs in the browser • Renamed “JavaScript” when an unrelated language (“Java”) stole the thunder • Renamed (officially) ECMAScript for standardization purposes • No one actually calls it this
  • 113. HTML5 turns the browser into a smart, powerful, networked application platform. JavaScript makes it possible.
  • 114. Powerful? Huh? • Didn’t I just say that I love to hate JavaScript? • And then I said that it was powerful? • What gives?
  • 115. JavaScript is the new hotness • Browsers are competing for fastest, best • Google’s V8 • Mozilla’s TraceMonkey (and JägerMonkey) • Safari’s Nitro • IE’s Chakra • JavaScript is faster, more stable than ever!
  • 116. Also: frameworks • Remove the drudgery of JavaScript • Handle differences between browsers • Make it easy to perform common tasks • Lots of plugins available • For me, it’s the difference between pain and pleasure when working with JavaScript
  • 117. JavaScript frameworks • Dojo • YUI • MooTools • Prototype • jQuery (more on this in a bit)
  • 118. Ajax • One reason for JavaScript libraries: Ajax! • Make HTTP requests from within the page • No refresh! Just get results from the server, and modify the page accordingly • This has revolutionized our view of Web pages
  • 119. Ajax Browser Server
  • 120. Ajax POST /login name=reuven&password=secret Browser Server
  • 121. Ajax POST /login name=reuven&password=secret Browser Server 200 OK <html>... <p>Thank you!</p> ...</html>
  • 122. Ajax POST /login name=reuven&password=secret Browser Server 200 OK <html>... <p>Thank you!</p> ...</html>
  • 123. Ajax POST /login name=reuven&password=secret Browser Server 200 OK <html>... <p>Thank you!</p> ...</html>
  • 124. Ajax POST /login name=reuven&password=secret Browser Server 200 OK <html>... <p>Thank you!</p> ...</html>
  • 125. Ajax POST /login name=reuven&password=secret Browser Server 200 OK <html>... <p>Thank you!</p> ...</html>
  • 126. Ajax isn’t everything • What if I want a chat application, or something else that stays open? • What if I want to execute more than one JavaScript function at a time? • What if I want to store things locally? • HTML5 provides all this — and more!
  • 127. Canvas • A complete drawing area, in your browser! • Use JavaScript to: • Draw arbitrary shapes • Detect the mouse • Detect the drawing • The end of Flash? Maybe...
  • 128. Geolocation • Your browser can know where you are! • It can send this info to the server • It’s not perfect, but still pretty good • To avoid privacy issues, users are always asked if their location should be shared
  • 129. Inter-page communication • Modern Web apps can span multiple pages • HTML5 makes it easy for two pages (from the same server) to communicate • The receiver knows which server sent the data — so it can filter incoming messages, as well as screen them for security
  • 130. Web sockets • This is potentially the biggest deal of all • Ajax allows for server connections. But: • High overhead • Stateless • Web sockets have low overhead, and they stay open as long as you need!
  • 132. Using Web sockets var weatherSocket = new WebSocket("ws://localhost:8080");
  • 133. Using Web sockets var weatherSocket = new WebSocket("ws://localhost:8080"); weatherSocket.onopen = function(e) { alert("Opened weather socket");};
  • 134. Using Web sockets var weatherSocket = new WebSocket("ws://localhost:8080"); weatherSocket.onopen = function(e) { alert("Opened weather socket");}; weatherSocket.onmessage = function(e) { alert("Got message: " + e.data);};
  • 135. Using Web sockets var weatherSocket = new WebSocket("ws://localhost:8080"); weatherSocket.onopen = function(e) { alert("Opened weather socket");}; weatherSocket.onmessage = function(e) { alert("Got message: " + e.data);}; weatherSocket.onclose = function(e) { alert("Closing socket..."); };
  • 136. What can sockets do? • Chat servers • Stock feeds • Teleconferencing • Who knows? • Remember, HTTP was only invented after sockets had been around for 15 years
  • 137. Web workers • Execute more than one thing at a time • In other words:You can run JavaScript functions in the background • Process text • Open Web sockets • Perform calculations
  • 138. Local storage • Now Web apps can store data • A little database of name-value pairs var foo = localStorage.getItem("bar"); localStorage.setItem("bar", foo);
  • 139. Local storage • Now Web apps can store data • A little database of name-value pairs var foo = localStorage.getItem("bar"); localStorage.setItem("bar", foo); var foo = localStorage["bar"];
  • 140. Local storage • Now Web apps can store data • A little database of name-value pairs var foo = localStorage.getItem("bar"); localStorage.setItem("bar", foo); var foo = localStorage["bar"]; localStorage["bar"] = foo;
  • 141. Media • Standard (well, sort of) ways to play audio and video • No more Flash! • Problem: No one format is supported by all browsers
  • 142. jQuery • jQuery has taken the world by storm • Super-easy to use • Extremely fast • Open source (of course!) • Easy to write plugins • Lots of plugins are available
  • 143.
  • 144. Basic jQuery • $(CSS_SELECTOR) returns one or more objects • Now what? • Execute something on those objects • Hang a function on those objects, to execute when a condition is met
  • 145. Remember our CSS? <p id=”important”>Agenda</p> p#important { font-size: 13p; font-weight: bold; }
  • 146. Fire on events $('p#important').click(function() { alert("You clicked on me!"); });
  • 147. Fire on events $('p#important').click(function() { alert("You clicked on me!"); }); $('p.important').hover(function() {
  • 148. Fire on events $('p#important').click(function() { alert("You clicked on me!"); }); $('p.important').hover(function() { alert("Whew, they’re gone");
  • 149. Fire on events $('p#important').click(function() { alert("You clicked on me!"); }); $('p.important').hover(function() { alert("Whew, they’re gone"); });
  • 150. Plugins in jQuery • jQuery’s syntax makes it trivial to do complex operations • Between powerful selectors and many built-in functions, you can manipulate text, HTML, and styles easily • But even better — there are plugins that do lots of things for you
  • 151. Unobtrusive • The jQuery is not in the HTML file • This is called “unobtrusive JavaScript” • Good HTML has no CSS, and no JavaScript
  • 152.
  • 153. $.fn.ubbi = function(options) { function ubbify(text) { return text.replace(/([aeiou])/gi, 'ub$1'); } return this.each(function() { $(this).bind('mouseover', function() { var original_text = $(this).html(); $(this).attr({originalText: original_text}); $(this).html(ubbify(original_text)); }); $(this).bind('mouseout', function() { $(this).html($(this).attr("originalText")); $(this).attr({originalText: ""}); }); }); };
  • 154. $.fn.ubbi = function(options) { function ubbify(text) { return text.replace(/([aeiou])/gi, 'ub$1'); } return this.each(function() { $(this).bind('mouseover', function() { var original_text = $(this).html(); $(this).attr({originalText: original_text}); $(this).html(ubbify(original_text)); }); $(this).bind('mouseout', function() { $(this).html($(this).attr("originalText")); $(this).attr({originalText: ""}); }); }); };
  • 155. $.fn.ubbi = function(options) { function ubbify(text) { return text.replace(/([aeiou])/gi, 'ub$1'); } return this.each(function() { $(this).bind('mouseover', function() { var original_text = $(this).html(); $(this).attr({originalText: original_text}); $(this).html(ubbify(original_text)); }); $(this).bind('mouseout', function() { $(this).html($(this).attr("originalText")); $(this).attr({originalText: ""}); }); }); };
  • 157.
  • 158.
  • 159. jQuery issues • Lots of plugins — which ones are good? • Welcome to the world of open source! • You’re still defining functions • Yes — and functions as data takes a while to get used to • Remember: JavaScript is programming, and a different sort than most languages
  • 160. Want a Web app? • It used to be: • “What operating system, language, and database will I use?”
  • 161. But today, it’s... • What server language and framework? JavaScript framework? Hosted or cloud? • What type of database (relational, NoSQL)? Which one? Hosted or cloud? • Do we offer an API? A mobile app? Both? • Which HTML5 features do we want to use, and how do we gracefully degrade?
  • 162. My brain is too small! • Yes, there’s a lot to learn • Most of it can wait a little bit • There are oodles of tutorials and books that can help you • Besides a lot of this is still highly transitional
  • 163. Whew! • There’s a lot to the modern Web • It’s fun and exciting, and continues to move forward at breakneck speed • Understanding as many of these parts as possible will help you make better decisions, and better applications!
  • 164. Any questions? • Call me: 054-496-8405 • E-mail me: reuven@lerner.co.il • Interrupt me: reuvenlerner (Skype/AIM)

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n