experiences on a design approach for interactive web
play

Experiences on a Design Approach for Interactive Web Applications - PowerPoint PPT Presentation

Experiences on a Design Approach for Interactive Web Applications Experiences on a Design Approach for Interactive Web Applications Janne Kuuskeri Tampere University of Technology Stratagen Systems Current Browser Server Current


  1. Experiences on a Design Approach for Interactive Web Applications

  2. Experiences on a Design Approach for Interactive Web Applications Janne Kuuskeri Tampere University of Technology Stratagen Systems

  3. Current Browser Server

  4. Current Browser GET /myapp/index.html Server

  5. Current Browser GET /myapp/userlist.html Server

  6. Current Browser POST /myapp/userdata Server

  7. Current • resume app state • execute app logic Browser • update model • find view • update session • generate page Server

  8. Current Browser

  9. Current Browser Java

  10. Current Browser HTML Java

  11. Java HTML JavaScript Current Browser

  12. Java HTML JavaScript CSS Current Browser

  13. Java HTML JavaScript CSS Current JSP Browser

  14. Current JavaScript Browser HTML Java CSS JSP HTML page

  15. Current Java String hql = "from Person p where p.age > :age"; Query q = session.createQuery(); q.setInteger("age", 33); List people = q.list(hql); JavaScript Browser HTML Java JSP CSS <table> <% for (Person p : people) { %> JSP <tr> <td>p.getName()</td> <td>p.getAge()</td> </tr> <% } %> </table>

  16. Current JSP <% if (request.getParameter("age") != null) { age=Integer.parseInt(request.getParameter(“age”)); } JavaScript Browser String hql = "from Person p where p.age > :age"; HTML Java Query q = session.createQuery(); q.setInteger("age", age); CSS List people = q.list(hql); %> JSP <table> <% for (Person p : people) { %> <tr> <td>p.getName()</td> <td>p.getAge()</td> </tr> <% } %> </table>

  17. Current JavaScript var onClick = function () { $.ajax({ url: ‘/people/’, dataType: ‘json’, JavaScript Browser data: { age: 33 }, success: function (data) { HTML Java var rows = []; $.each(data, function (person) { CSS rows.push(‘<tr><td>’ + person.name + ‘</td><td>’ + person.age +‘</td></tr>’); JSP } $(‘#peopletable > tbody:last’).append( ‘’.join(rows)); } }

  18. MVC

  19. MVC View Browser Controller, Model Server

  20. MVC View Browser Controller, Model ? Server

  21. MVC View Browser Controller, Model REST Server

  22. MVC Single page web application REST Server

  23. MVC HTML <html> <head> <link type="text/css" href="someframework.css"> <script src=”someframework.js”></script> <script src=”myapp.js”></script> </head> Single page web application <body> </body> </html> REST Server

  24. MVC Single page web application REST Server

  25. MVC Single page web application REST Server

  26. Case: Valvomo

  27. Valvomo Browser Server Transit API Paratransit System

  28. Valvomo Browser Single page UI Server RESTful API Transit API Paratransit System

  29. Valvomo Web Browser Application HTML Server Valvomo Web Transit API Application Paratransit System

  30. Valvomo Browser JSON Server Transit API Paratransit System

  31. DEMO

  32. Pros • browsers • mobile devices • programmatic clients • HTTP • Accessible API

  33. Pros • can have several different server • Accessible API implementations • same UI can be placed • Reusable API “on top” of another server implementation as long as it is the same API • no predefined application flow

  34. Pros • Accessible API • responsibilities are easier to assign • Reusable API • data validation • error handling • Decoupling • localization

  35. Pros • Accessible API • unambiguously assign responsibilities for state • Reusable API handling • server is responsible • Decoupling for resources and their states • Application flow / state • application (client) is responsible for the application flow and state

  36. Pros • Accessible API • fewer technologies to worry about • Reusable API • one language for the client • Decoupling • one language (maybe even the same) for the • Application flow / state server • client and server are • Development model easier to develop in parallel

  37. Pros • Accessible API • Reusable API • client and server may be tested separately • Decoupling • server API may be tested using isolated • Application flow / state HTTP request and checking the result • Development model codes and content • UI may be tested • Testing without the server or the network traffic

  38. Pros • Accessible API • Reusable API • REST offers minimal HTTP overhead • Decoupling • network is utilized only when necessary • Application flow / state (no page reloads) • no data (e.g. HTML or • Development model CSS) overhead when transferring only payload • Testing data (e.g. JSON or XML) • Network traffic

  39. Cons • some server frameworks have REST support • MVC support on • Framework support client depends solely on the chosen toolkit

  40. Cons • single page web applications are difficult • Framework support to crawl and index • RESTful API could be • Search engine support crawled and indexed but difficult to rank

  41. Cons • highly dynamic JavaScript UIs require • Framework support extra work to be accessible for the • Search engine support visually impaired • some JavaScript • Accessibility toolkits offer support for accessibility

  42. Future work • Authentication • Flexible authorization configuration • per resource • per request method • representations per auth level?

  43. Thank You

Recommend


More recommend