Web 2.0

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    Put ajax loading image, find a good background

    1 Favorite

    Web 2.0 - Presentation Transcript

    1. Web 2.0, The way to go
        • Ajax loading image.
        • Muhammad Hassan
        • BadrIT logo
    2. Agenda
      • Building a Web application
      • Separation of Concerns
      • Web 2.0 tour
      • Ajax
      • Conclusion
    3. What is the Web
      • Large network of computers (non-similar)
      • Clients and servers
      • Client send request for www.google.com
      • Server send response back
    4.  
    5. Request & Response
      • Request: text sent to server contains request URL and some other data
      • Response: simply text or HTML
      • Can be a zip, flash, pdf, ...
    6. HTML
      • Hyper text markup language
      • Consists of tags
      • <b>Bold Text </b>
      • Lets see a HTML example
      • HTML is easy to learn
    7. Adding Style
      • Current HTML looks ugly
      • Lets add some colors and style to it.
      • We need CSS.
    8. CSS (Cascaded Style Sheets)
      • A formatting language
      • Used to customize web pages
      • You can edit
        • Colors
        • Backgrounds
        • borders, margins, alignment
        • fonts, sizes and lots of other things
      • Simple to learn
    9. CSS example
      • <p style='color:red;'> Red text </p>
      • <p style='font-weight:bold;'> Bold text </p>
      • <style type=&quot;text/css&quot;> a {color: red;}
      • a:hover {color: blue;}
      • </style>
    10. CSS Box Model
    11. Lets apply CSS!
    12. Dynamic HTML
      • Current HTML page is static
      • To make it we need to use a programming language (not just markup language)
      • What else can the browser interpret
      • Javascript
    13. Java script
      • Client side
      • Interpreted
      • Dynamic
      • Object oriented
      • Scripting language.
      • Easy to learn
    14. Simple example
      • <script type=&quot;text/javascript&quot;> window.alert('Welcome to Web 2.0!'); </script>
      • <script type=&quot;text/javascript&quot;> document.write(“<p>Hello world!</p>”); </script>
    15. Functions
      • function displayMessage(name){ var message = ”Welcome” + name;
      • alert( message );
      • return message; }
      • Note: we do not declare variables and parameter types
    16. Control statements
      • if (x>y)
      • {your code here}
      • else
      • {other code here};
      • while (x>y)
      • {your code here};
      • do
      • {your code here}
      • while (x>y);
    17. Control statements cont.
      • for (i=0; i<10; i++)
      • {
      • your code here
      • }
      • for (image in images)
      • {
      • image.border = 2;
      • }
    18. Interacting with HTML
      • DOM, document object model
      • document is a predefined object
      • document contains all document elements tree
      • You can access and edit any element
    19. DOM tree
      • this example from www.w3schools.com
    20. Accessing DOM tree
      • getElementById(), getElementsByTagName() methods
      • parentNode, firstChild, lastChild, ... properties of an element node
    21. DOM example 1
      • var searchBox = document.getElementById(&quot;search_box&quot;); alert(&quot;now searching for:&quot;+searchBox.value);
    22. DOM examples 2
      • var images = document.images; for (i=0;i<images.length;++i) {
      • images[i].border=2;
      • images[i].style.borderColor=&quot;red&quot;;
      • }
    23. DOM examples 3
      • var userArea = document.getElementById(&quot;user_area&quot;);
      • userArea.innerHTML =&quot;<img src='surprise.png'>&quot;;
    24. Event handling
      • <input type=&quot;text&quot; id=&quot;email&quot; onChange=&quot;checkEmail()&quot;>
      • onClick
      • onMouseOver
      • onMouseOut
    25. Lets see live example
    26. Client vs Server side
      • All what we done now – html, css, javascript
      • Interpreted by the client side
      • Note: not all browsers render html, css, js the same
    27.  
    28. Server Side
      • We need a Server side programming language
      • Choices available:
        • ASP.Net with C# or VisualBasic.Net
        • JSP with Java
        • PHP
        • Ruby on Rails
        • ...
      • Lets see what server side can do
    29. Simple JSP example
      • <HTML>
      • <BODY>
      • <H1>Welcom to JSP</H1> Today is:
      • <%
      • String time=new java.util.Date().toString() ;
      • out.println(time);
      • %>
      • </BODY>
      • </HTML>
      • Lets see live
    30. A more complex JSP
      • Gets data from database
      • Note that server runs code
      • Response is sent to the browser to display
      • Lets see it live
    31. 5 languages
      • Looks complex, isn't it?
      • The page talks 5 languages
        • Java
        • SQL
        • HTML
        • CSS
        • Javascript
    32. Separation of Concerns
      • If we can separate the business logic from presentation logic it would be great
      • Business logic = loading courses from db
      • Presentation logic = viewing course in the browser
    33. Separation of Concerns, cont.
      • Separation of Concerns, is a general computer science concept
        • OOP: object oriented programming (very common)
        • MVC: Model View Controller
        • AOP: aspect oriented programming
    34. Model View Controller - MVC
      • We want to separate the business logic from the presentation logic
      • We call business logic the “Model”
      • We call presentation logic the “View”
      • We need to add a new layer between them&quot;
      • Which is called the “Controller”
      • M odel V iew C ontroller MVC
    35. Model View Controller - MVC
      • The goal is to separate data (model) and user interface (view) 1979
      • Model: domain-specific representation of the information (which is persisted some where)
      • View: UI which renders the model
      • Controller:
        • Processes events,
        • Send data (2 way) between Model and View
    36. An MVC Cycle
      • The user interacts with the user interface (e.g., user presses a button)
      • Controller handles the event
      • Controller accesses the model, possibly update/retrieve data
      • Controller notify the view with the new data from the model and the view render it.
      • User interface waits for further events, a new cycle begin
    37. s
    38. MVC example
      • Lets see our jsp example converted to Ruby On Rails
      • But why Ruby on Rails not Java/JSP
        • A very clean MVC framework
        • It is Web 2.0 ready!
      • Ok, lets see What Ruby on Rails code will look like
      • Put first lets take a look at Ruby language
    39. Ruby
      • A Programmer's best friend!
      • Interpreted
      • Dynamically typed
      • Pure object-oriented
      • Simple, straightforward, extensible,(from Japan)
      • Classes, functions, for, while,.. like any language but with more power
    40. Ruby on Rails
      • Lets see our code rewritten in Rails!
    41. Other MVC frameworks
      • If I cannot use Rails what can I do?
      • You can write your own MVC framework, or ...
      • Use ready made frame works
    42. Other MVC Frameworks
      • Java
        • Trails (rails clone)
        • Grails (rails clone)
        • Spring+JSF+Hibernate (technology stack)
      • .Net
        • Castle project (mono rail & NHibernate)
      • PHP
        • Cakephp
        • Symfony
    43. Can we separate more?
      • Lets compare MVC to the none-MVC JSP example
      • The view still have HTML, CSS and Javascript
      • We need to apply Separation to the View
    44. Separating View content
      • View consist of
        • Content (html)
        • Layout (css)
        • Behavior (javascript)
    45. Separate Content and Style
      • Very simple
      • Define css in a separate css file
      • Do not write inline css, just use class=”mystyle”
      • Do not use html formatting tags <b>, <font>
      • Lets see apply it to our example
      • For more power see www.csszengarden.com
      • We can add style for printer, mobile
    46. Separate Content and behavior
      • We still have inline javascript
        • onclick=&quot;new Effect.toggle($('course1'),'blind',{duration:1})...&quot;
      • We can put it in a function like this
        • onclick=”doEffect(this);”
      • But still we have inline javascript
    47. Separate Content and behavior
      • Solution is to add the event handlers externally
      • It is called unobtrusive Java Script
      • Simply instead of onclick, we will use a css class
      • class=&quot;effect&quot;
      • Then we use Java Script to search for links with class effect and append the event handler to it
      • Lets see how.
    48. Are we Web 2.0
      • Actually not yet.
      • We have to know What Web 2.0 is, to be Web 2.0
    49. What is Web 2.0
      • Is there a definition?
      • Key features
        • Web-as-participation-platform vs Web-as-information-source
        • Wiki, blogs, tags, rss feeds, mashup (APIs)
        • Rich Internet applications replace desktop ones
    50. Web 2.0 mind map
    51. Web 2.0 examples
      • Live examples
        • mail.google.com
        • netvibes.com, del.icio.us, digg.com
        • RememberTheMilk.com
        • desktoptwo.com, eyeos.org
        • meebo.com
        • zoho.com, writely.com
        • RSS www.cnn.com/
        • http://weblogs.asp.net/wkriebel/
        • ww.wikipedia.com
    52. How to be Web 2.0
      • Add collaboration, engage the user, use blogs, wikis, rss, tags, ...
      • Make the UI rich,use
        • CSS,
        • Java script
        • DHTML
        • AJAX
    53. What is AJAX
      • AJAX: Asynchronous Java Script and XML
      • What difference do AJAX add?
      • Lets compare it to normal(synchronous) request
      • More complex use cases can be done
      • You put the limit on what you can do...
      • Lets see delete example
    54. What is next?
      • Learn CSS, Javascript, DHTML
      • Learn XML, AJAX
      • Study MVC, learn RubyonRails (with Ruby)
      • Work Agile
        • Deliver early, deliver often
        • Engage end-users
      • Look for Web 3.0 (semantic web)
    55. References & Articles
      • www.wikipedia.com
      • www.3schools.com
      • Google.com (google for what you need)
      • More references will be sent
    56. Thanks
      • For you attendance
      • ACM chapter Stuff
      • Muhammad Ali (eSpace)
    57. Questions & Feed Back
    SlideShare Zeitgeist 2009

    + Muhammad  Hassan NasrMuhammad Hassan Nasr Nominate

    custom

    340 views, 1 favs, 0 embeds more stats

    A gentle introduction to Web 2.0.
    This presentatio more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 340
      • 340 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 25
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories