Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Push to the limit - rich and pro-active user interfaces with ADF (Oracle Open World 2011)


Published on

Visual appeal and desktop-like reaction to user input were key elements in Web 2.0, powered by AJAX. The next generation user interface is active - presenting data and events in real time, driven by server push technology. This session demonstrates how ADF Active Data Service (ADS) and the BAM Data Control are leveraged to create an active UI. Messages arriving on JMS, through HTTP, from Complex Event Processing and from email servers are pushed to the browser, updating charts, tables and even causing popups to open. The session demonstrates a Chat implementation integrated in a Fusion Web application. It also shows how Database Query Result Change Notification and ADS allow events to be pushed from database all the way to user interface.

Published in: Technology
  • ♣♣ 10 Easy Ways to Improve Your Performance in Bed... ▲▲▲
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Push to the limit - rich and pro-active user interfaces with ADF (Oracle Open World 2011)

  1. 1. Push to the limit – rich and pro-active user interfaces with ADF<br />Lucas Jellema – AMIS (Nieuwegein, The Netherlands)<br />Oracle Open World 2011<br />
  2. 2. Overview<br />Real time architecture<br />Push – ADF middle tier to browser<br />Active Data Service<br />Custom Push<br />Push triggering pull<br />Push – Database to middle tier<br />Push all the way across the tiers<br />Client to Client Push<br />
  3. 3. Asynchronous communication in the real world<br />“I’ll get back to you”<br />“Don’t call us,…”<br />Low fuel warning in car<br />“Please let me know”<br />“Return to sender – address unknown” <br />Newspaper delivery<br />Next instruction from car navigation system<br />Telephone ringing<br />Alarm clock buzzing<br />Parking sensors beeping<br />Fire alarm screaming<br />
  4. 4. Asynchronous interactions and push in the IT landscape<br />More timely information<br />Notification as soon as possible<br />Proactive offering<br />Do not ask and you shall be given <br />Lower load on back end – don’t call us (all the time) …<br />Stop hitting the F5 button!<br />Multi-channel information manipulation and dissemination<br />Changes and events come in from everywhere<br />Decouple system components through generic infrastructure for handling events and push<br />Yet integrate<br />
  5. 5. Pushing it … into the user interface<br />Automatically refreshing (part of) a page<br />Update table<br />Redrawing chart<br />Displaying popup to alert user to an event<br />Arrival of message (email or chat)<br />Signing in or out of contact (presence)<br />Lock or release of some resource<br />Notification<br />Changing status of items on the page<br />Highlight change indicator<br />Show icon<br />Change text to italic<br />Play a sound<br />
  6. 6. 3rd party<br />Mobile Device<br />Mobile Device<br />Web Browser<br />Web Browser<br />JEE Application Server<br />JEE Application Server<br />Complex Event Processor<br />Non<br />Java<br />Server<br />RDBMS<br />Email Server<br />Chat Server<br />RDBMS<br />
  7. 7. The ‘Only tell when asked’ game<br />
  8. 8. Introducing ADF Active Data Service<br />Built in mechanism in ADF to push updates from the middle tier to the browser<br />active UI components that refresh upon reception of the push (table, image, output text, DVT graphs)<br />client side infrastructure to process received push messages <br />a multiplexed (multi-event) channel to push to client – leveraging WebLogic Server push capabilities<br />Long poll today, WebSockets or SPDY tomorrow<br />server side infrastructure to manage active beans and turn events into pushed messages<br />Active data control: <br />BAM Data Control for push from BAM’s Active Data Cache all the way to data bound UI components<br />
  9. 9. Overview of ADS infrastructure<br />
  10. 10. Using ADF active Data Service to embed chat client in web application<br />Instant Messaging should be instant<br />Requirement to push incoming messages to client<br />Common IM protocol is XMPP (over TCP)<br />Extensible Messaging and Presence Protocol<br />XMPP Java Libraries help to connect to and communicate with XMPP servers<br />For example Smack<br />To embed chat in in ADF application we need to<br />consume messages over XMPP <br />and push them to the Web Client<br />The ADS approach:<br />Use ‘active’ UI Components<br />Bind them to bean that implements ActiveDataModel<br />Turning the IM messages into entries in ActiveDataModel<br />
  11. 11. Example of ADS: Google Talk<br />Web Browser<br />JEE Application Server<br />
  12. 12. Example of ADS: Google Talk<br />Web Browser<br />JEE Application Server<br />
  13. 13. Push trough Active Data Service<br />Web Browser<br />ADS<br />MessageReceiver<br />
  14. 14. Push trough Active Data Service<br />Web Browser<br />ADS<br />MessageReceiver<br />
  15. 15. Introducing Business Activity Monitoring<br />Operational Business Intelligence<br />Data fed in from many sources:<br />RFID sensors, BPEL, Database Triggers, RSS, ODI<br />Real Time insight <br />Dashboard<br />Live updates<br />Looking for threshold crossing, exceptions, trends, missing events<br />Display visually and turn into alerts & notifications<br />
  16. 16. Introducing Business Activity Monitoring<br />ADF Application<br />
  17. 17. Embedding real time displays in ADF based on BAM Data Control<br />Configure connection to BAM Server<br />Create BAM Data Control<br />Based on Data Objects inActive Data Cache<br />Drag & Drop Data Control’scollections & attributes toADF Faces pages<br />Just like ADF BC Data Control<br />However: BAM Data Control is active<br />
  18. 18. Live volleyball reporting<br />Web Browser<br />JMS Queue<br />BAM<br />Data Object<br />
  19. 19. Create BAM Data control<br />
  20. 20. Programmatic cross tier interaction <br />Web Browser<br />JEE Application Server<br />
  21. 21. Client<br />JavaScript<br />Components<br />manipulate<br />component<br />user action<br />JavaScript Function<br />component<br />clientListener<br />component<br />userorprogrammaticaction<br />partialSubmitautoSubmit<br />Load JSON, CSS, Image, XML, JS<br />property change<br />Requestdata orPush message<br />poll<br />setPropertyListener<br />partial triggers, added targets<br />Queue Custom Event<br />serverListener<br />activeOutputText<br />ERKS ‘ppr script’<br />partial page refresh<br />Full pagereload<br />push<br />add JS toexecute (ERKS)<br />Server (middle tier)<br />component<br />activeOutputText<br />component<br />add componentsas partial target<br />actionListener, valueChangeListener, …Listener<br />Bean<br />serverListener<br />Active DataModel<br />Object<br />Components<br />Beans & Objects<br />push (DB QRCN)<br />Database<br />Client Server interactions vv.<br />
  22. 22. The push-to-nudge trick(Matthias Wessendorf)<br />Client Listener Function<br /><ul><li>Show popup
  23. 23. Update field value
  24. 24. Modify style property
  25. 25. Call Server (PPR)</li></ul>activeOutputText<br />clientListener<br />type=propertyChange<br />Servlet<br />Active Bean<br />Active data<br />register<br />Event Handler<br />JMS Listener<br />Scheduled Job<br />& <br />Event Listener<br />
  26. 26. Simple nudge to client<br />
  27. 27. Simple nudge to client<br />
  28. 28. Client to client push – slide synchronization<br />
  29. 29. Client to client push – slide synchronization<br />
  30. 30.
  31. 31. activeImageBean<br />activeImageBean<br />
  32. 32. Cross tier push – architecture pattern<br />listener<br />listener<br />listener<br />register<br />event handler<br />Payload Retriever<br />Scheduled Poll Job<br />Push Receptor<br />‘Events collector’<br />
  33. 33. Cross gap push mechanisms<br />Many channels are available to push messages from one entity to another, <br />across application, technology and location boundaries<br />JMS<br />(one way) WebService (SOAP or REST)<br />“HTTP Channel”<br />WebSockets<br />Http Call to Servlet<br />XMPP<br />
  34. 34. Client to Client pusH<br />Usually really a combination of<br />Client-to-Server<br />and Server-to-the-other-Client push<br />Exception: Blue Tooth, Near-Field Communication<br />
  35. 35. Server to mobile push:multiplexed, semi-poll based<br />
  36. 36. Push from Database to middle tier <br />Middle tier asks database – through JDBC, ODBC, SQL*Net, HTTP, …<br />The database is reactive only – not pushy at all<br />Some mechanisms allow the database to take the initiative and start to push<br />Database Query Result Change Notification<br />Http calls from utl_http or JSP<br />Table with Multiplexed Poll<br />
  37. 37. The Hollywood Principle: Query ResultSet Change Notification<br />POJO / ADF BC<br />
  38. 38. Cache Refresh triggered by DB<br />Oracle RDBMS invokes Java Listener with event details<br />POJO / ADF BC<br />Register DatabaseChangeNotification<br />SQL query<br />PL/SQL<br />
  39. 39. Shared Application Modules<br />Regular Application Module instances are session level – i.e. not shared across (web) sessions<br />Shared Application Module instances are shared across sessions like an Application Scope Managed Bean<br />Used for Static Data Sets: Look Up Data and Reference Tables<br />Sessions can reuse the data from a shared Application Module without having to access the database<br />And without loading the data in session level memory scope<br />View Accessors can be used to access data in the Shared Application Module’s VOs<br />For example for use in LOVs or Validation Rules<br />
  40. 40. Shared Application Module Instance<br />
  41. 41. Auto Refresh for View Objects<br />ViewObjects in a Shared Application Module can be registered for auto refresh<br />Typically such application wide VOs are near-static<br />Whenever the underlying data set changes (in the database), the VO rowset should be refreshed<br />By setting Auto Refresh (to true) for the ViewObject, the VO will be refreshed whenever the database is changed<br />ADF registers the VO query with the Database (11g) Result Set Change Notification mechanism through JDBC<br />Note: the VO should not have an Order By clause nor select a Date column<br />
  42. 42. Steps for auto refresh enabling<br />Create Shared Application Module<br />New application module that is added to list of Application Level instances in the Project properties<br />Create the ViewObject that queries the ‘static data’ and add to Shared Application Module<br />Set the Auto Refresh property to true for VO instance<br />Database must be 11g (and have parameter compatible set to 11.1.0 or above)<br />database user must have the Change Notification privilege<br />To piggy back changes to page, set changeEventPolicy to autoPPR on data binding<br />
  43. 43. Set Auto Refresh for ViewObject<br />Set Auto Refresh for ViewObject<br />Grant Change Notification todatabase user<br />
  44. 44. Demo: Database push to View Object in action<br />DBQRCN<br />
  45. 45. Auto-PPR for immediate refresh of Data Bound components<br />To have ADF automatically refresh data bound components when underlying value binding has changed its value<br />Set changeEventPolicy=ppr on iterator<br />Refresh as piggy back on any request cycle<br />No partialTriggers attribute required!<br />
  46. 46. JEE Application Server<br />Alternative Database to middle tier push implementation<br />Session scope bean<br />listener<br />listener<br />listener<br />register<br />Application scope bean<br />event handler<br />servlet<br />Payload Retriever<br />Scheduled Poll Job<br />Push Receptor<br />utl_http<br />RDBMS<br />‘Events collector’<br />trigger<br />
  47. 47. Cross Tier Push<br />Web Browser<br />table<br />activeOT<br />Cache refresher<br />JEE Application Server<br />evtlsnr<br />servlet<br />RDBMS<br />job<br />trg<br />
  48. 48. Initiate ‘normaL’ PPR cycle in which to refresh ui components<br />Client Listener Function<br />component<br />queue event<br />activeOutputText<br />someComponent<br />serverListener<br />clientListener<br />type=propertyChange<br />refresh page<br />PPR request<br />Bean<br />Iterator<br />Auto ppr<br />retrieve data<br />View<br />clear cache<br />Entity<br />RDBMS<br />
  49. 49. Server Push challenges<br />How to push against the ‘one way direction’ and despite limitations<br />HTTP and JDBC are request/response – not response only<br />Browser limit of only two channels to one server<br />Server side ‘event handling’<br />Session has to have an active life beyond requests<br />Or requests have a life beyond response<br />Higher load on the server<br />How to handle the (potential) volume of ‘concurrent’ channels and the number of open threads<br />NIO, Servlet 3.0, Jetty Continuations, Tomcat Advanced I/O<br />
  50. 50. Server Push challenges (2)<br />Where do events to push actually come from?<br />Who perceives/receives (real-time) events (on the server side)<br />How are they tied in to the appropriate sessions?<br />Client (consumer) side: how to asynchronously receive events and how to process them/turn them into action and UI updates<br />How to correlate an asynchronously received message with a previously sent request or a subscription<br />For example: mobile phone showing SMS or WhatsApp messages in a conversation thread style<br />
  51. 51. Future Developments<br />The real time enterprise<br />The event driven enterprise<br />Further evolution of push notification at every tier<br />Mobile perhaps leading the way<br />Infrastructure and frameworks providing push mechanisms<br />Such as Active Data Service<br />Servlet 3.0, Java NIO, WebSockets,SPDY, XMPP and other lighter weight solutions for bi-directional communication over TCP<br />And broad support in browsers and application servers<br />
  52. 52. Summary<br />Push <br />Pro active or at least real time user interface<br />Real time user to user interaction<br />Decrease load on infrastructure (refresh over and over)<br />Real push hardly exists<br />Smart poll/pull is often underlying implementation<br />Piggy backing, Multiplexing, decoupling etc. are required to scale<br />ADS is powerful<br />Especially with the ‘nudge now you do a fine grained fetch or refresh’ pattern<br />Database can push too – using DBQRCN, HTTP, ….<br />ADF can push to Android or iOS<br />Using Google and Apple Push Notification Services<br />ADF Mobile should support push notification as well<br />
  53. 53. Session Plugging<br />Sunday – Gold Nuggets in ADF (S32502)3.15-4.15, Moscone West-2000<br />Tuesday – Reaching Out from PL/SQL (S08625 )10.15-11.15, Mariott Marquis, Salon 7<br />Tuesday – (JavaOne) Cross Tier Push Architecture (Don’t call us, we’ll push you) (S24722)4.30-5.15 PM, Hotel Nikko, Monterey I/II<br />Wednesday – Push to the Limit: Rich and Proactive User Interfaces with Oracle ADF (S08620)5-6 PM, Mariott Marquis, Golden Gate A<br />Thursday –Instant Agility in Oracle Fusion Middleware through Design Time @ Run Time (S08623)4-5 PM, Moscone West – 2020<br />