Javazone 2011: Goal Directed Web Applications

1,136 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,136
On SlideShare
0
From Embeds
0
Number of Embeds
45
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Afternoon everyone; welcome to this talk on Lift the web framework for Scala.
  • Before we get started with the presentation here’s a little information about me.** CLICK **I’ve been working on the lift project for around 2.5 years and using it in production for about 3 years. I work on a lot of different aspects of the framework but I am particularly interested in localization and process abstractions within Lift core. I also use Lift during my day job as do most of the other committers so in that sense we are not just making a framework for the sake of it, what we put into lift are real-life abstractions from the field ** CLICK **I am the author of a new book called Lift in Action, available on Manning publications. At the end of this talk I will be giving away a 40% discount for people who are interested in learning more about Lift.** CLICK **CodingScala since the end of 2007 – both with Lift and standalone Scala applications** CLICK **Before I came to the scala community I was working extensively with Ruby, along with Rails. Before that I was coding a lot of Objective-C and Java for desktop applications. ** CLICK **My day job is producing interesting sections of middleware for marketing automation and cross-media marketing for a division of Xerox corporation.** CLICK **
  • 150 years old
  • Quartz crystals are piezoelectric, which means that they generate an electrical charge when mechanical pressure is applied to them. They also vibrate if an electrical charge is applied to them. The frequency of this vibration is a function of the cut and shape of the crystal. Quartz crystals can be cut at a consistent size and shape to vibrate at thousands of times per second, making them extremely stable resonators for keeping very accurate time
  • MSFT conducted a focus group to determine what features users actually wanted. The result indicated that a large percentage of the features users wanted actually already existed within the product – people simply couldn’t find them amongst all the menus.
  • Here’s a classic example of a developer created user interface that is a 1-1 mapping in user interface and data model. Each control no doubt directly relates to an attribute on the data model or structures represented in the code… whilst this may be a more extreme example, its fairly indicative of the kinds of mistakes often made when building application interfaces, both for web applications and on the desktop. It’s important to note that the actual UI toolkit used in this example is completely separate from the model used to arrive at the interface itself. If you’re using straight HTML, GWT or Lift or anything else for that matter, the salient point is that often developers make the mistake of directly representing the data structures in forms on the interface.
  • Smart UI = fail“Computer literacy” is required to use products
  • IT is the only place where implementation and interaction can be completely decoupled, located in different parts of the world and feature a wide range of other attributes what would have been near-impossible scenarios even 30 years ago.
  • There is a better way: task based interfaces and analysis.In the early 2000s there were several individuals and organizations alike who had recognized the deficiencies in the CRUD approach; specifically, a Dutch researcher called Martin van Weille released his PhD thesis studying task-based interfaces and around the same time Microsoft research released a paper on so-called “Inductive User Interfaces”. I’m sure many of you here have been in a talk on DDD or CQRS that has perhaps had a single bullet point mentioning task based user interfaces and referencing the Microsoft paper, but whilst both papers share the idea of putting the user and their interaction intention right in the heart of the interface design, TBUI and IUI actually target different segments of the software marketTBUIs are really designed for applications that are regularly used and often have “power users”, whilst IUIs are typically put in place for large scale consumer software that is infrequently used, and in many cases IUI will fall down in situations where power users are present as they often feel like they have to do too many things in order to achieve the simplest operation. It is however worth noting that both TBUI and IUI style approaches are no good for systems that are largely devoid of humans. Rather they are specifically designed for analyzing and implementing intuitive systems that are used by real people.
  • Jonas has already presented
  • Activity theory“sought to understand human activities as complex, socially situated phenomena and go beyond paradigms of cognition, psychoanalysis and behaviorism”Application within HCIDonald Norman, Bonnie Nardi
  • How to identify a goal:Typically does not change over a long period of time and are technology agnostic.Goals motivate people to behave the way they do, and perform the tasks they do
  • In order to achieve goals, tasks must be completed which in and of themselves may have subordinate task items. This is key to the flexibility of task based analysis as you can build up sophisticated trees of tasks where a given task requires that other tasks be completed before the calling task can be deemed complete. In this way, goals have many tasks.TASKS=====+ Gather Order Items|_ Pick Items|_ Pack Items- Create Consignment- Assign Consignment to Transport- Reassign Consignment to Alternative Transport- Collect Route Consignments+ Operate Delivery Route|_ Deliver Consignment- Sign for ConsignmentROLES=====- Service Order (Gather Order Items, Create Consignment)- Logistics Co-ordinator (Assign Consignment to Transport)- Driver (Collect Route Consignments, Operate Delivery Route)- Contact Person (Sign for Consignment)AGENTS======- Picking Line Worker (Service Order)- Shift Fleet Manager (Logistics Co-ordinator)- Delivery Person (Driver)- Consignment Recipient (Contact Person)EVENTS======- Item Picked - Item Packed- Consignment Created- Consignment Assigned to Vehicle- Consignment DeliveredGOALS=====- Order Pending- Order Ready to ship- Order Dispatched- Order DeliveredOBJECTS=======- Consignment- Item- Van
  • The next component is known as “object”. This is of course a very overloaded term in computer science circles but in the context of task based analysis an object represents something that the task represents. So, for example, if you were again providing a hotel booking system, “Passport” might be a legitimate object as any booking task would need to collect passport information from guests. It’s important to note that “object” can be both tangible things that exist in the real world, and also intangible concepts. For example, in addition to passport information the hotel would need to collect the address of the visiting guest and as this would need to be interacted with from other tasks that use the address information it should be modeled as an object.
  • Events.Now things get interesting. Events trigger tasks to take place, and typically encapsulate a change in the users task worldEVENTS======- Item Picked - Item Packed- Consignment Created- Consignment Assigned to Vehicle- Consignment DeliveredGOALS=====- Order Pending- Order Ready to ship- Order Dispatched- Order DeliveredOBJECTS=======- Consignment- Item- Van
  • A role is essentially a someone or something that is response for a particular task and as with objects and tasks the roles can be hierarchically composed. ROLES=====- Service Order (Gather Order Items, Create Consignment)- Logistics Co-ordinator (Assign Consignment to Transport)- Driver (Collect Route Consignments, Operate Delivery Route)- Contact Person (Sign for Consignment)
  • Agents are, in the typical use case a human players that interact with the application. The important definition is AGENTS======- Picking Line Worker (Service Order)- Shift Fleet Manager (Logistics Co-ordinator)- Delivery Person (Driver)Consignment Recipient (Contact Person)
  • Tasks are greatGoals are great The problem here is that by focusing on what the user does, and only that, without any social or situational context can give a malformed model of representation.This is where we can blend in the ideas from activity theory which has as part of its framework strong roots in social, historical and situational context.
  • Activity theory when applied to HCI
  • Depending upon the kind of web application you are building, there will likely be several goals, for both the customers / user and the business. Business goals can often be stimulated by supporting activities, and consider the average amazon.com product page: there are no less than 16 different ways to comment, share, review, suggest and all manner of other activities which support the shopping goal.With applications becoming far richer, complex and multi-facited its important to be able to build these features in a slick and intuitive way, whilst also having a technical implementation that is efficient
  • Christine applied lessons of scientific management to the household and wrote several books on the matter… some of which heavily influenced kitchen design in the 1920s and 1930s
  • If Java got its features when promised I wouldn't have to do this slide
  • Taylorism
  • Many core ideas in Lift can be expressed as functions
  • Many core ideas in Lift can be expressed as functions
  • Break free of full page reloadsPush, don’t pullBuild entirely event based systemsUser experience can be truly real-timeLeverage ask->answer semantics
  • Shout out to VasilRemeniuk for the scatter / gather idea.
  • Caveats:
  • Javazone 2011: Goal Directed Web Applications

    1. 1. Goal-directedWeb Applications(with Scala)<br />Timothy PerrettJavaZone 2011<br />
    2. 2. Agenda<br />The Problem<br />Users<br />Existing drawbacks <br />The Theory<br />Modeling<br />The Detail<br />Task and functions<br />Asynchronous web<br />Leveraging Lift and Akka<br />
    3. 3. About Me<br /><ul><li>Author of Lift in Action</li></ul>Coding Scala since 2007(its awesome)<br /><ul><li>Background in both dynamic and statically typed languages
    4. 4. Manufacturing and marketing automation is my day job</li></ul>http://manning.com/perrett/<br />
    5. 5. > what does this…<br />
    6. 6. …have to do with this?<br />
    7. 7. RepresentativeModels.<br />
    8. 8. “…For the majority of customers, each feature or procedure is a frustrating, unwanted puzzle...”<br /> Microsoft Research<br />
    9. 9. Oh Noes!<br />
    10. 10. …butseriously...<br />
    11. 11. Oh Noes!<br />
    12. 12. Square peg.<br />Round hole.<br />
    13. 13. MissedOpportunities<br />
    14. 14. There must bea better way<br />
    15. 15. Better?<br />
    16. 16. TalkingTheory<br />
    17. 17. Talking Theory<br />
    18. 18. Talking Theory<br />
    19. 19. Talking Theory<br />
    20. 20. Talking Theory<br />
    21. 21. Talking Theory<br />
    22. 22. Talking Theory<br />
    23. 23. But why?<br />
    24. 24. Talking Theory<br />
    25. 25. Talking Theory<br />
    26. 26. Talking Theory<br />
    27. 27. “We find that work […] does not consist of independent, separate acts, but of a series of inter-related processes.”<br /> Christine Frederick, The Labor-Saving Kitchen. 1919.<br />
    28. 28. TheDetail.<br />
    29. 29. λ<br />functions<br />
    30. 30. public Thing do(what: String) {<br /> ...<br />}<br />
    31. 31. public Thing do(what: String) {<br /> ...<br />}<br />
    32. 32. public <A> Thing do(what: A) {<br /> ...<br />}<br />
    33. 33. def do[A](what: A): Thing = ...<br />
    34. 34. A => Thing<br />
    35. 35. A => B<br />
    36. 36. (A => B) => C<br />
    37. 37. “We find that work […] does not consist of independent, separate acts, but of a series of inter-related processes.”<br /> Christine Frederick, The Labor-Saving Kitchen. 1919.<br />
    38. 38. Tasks<br />
    39. 39. Tasks<br />A => B<br />Tasks are functions<br />
    40. 40. Tasks<br />A => B => C => n<br />Tasks are made-up of composable operations <br />
    41. 41. “…User interface design needs to become more engineering rather than a pure creative or artistic process…”<br />Martijn van Welie<br />
    42. 42. AddingLift<br />
    43. 43. Tough ProblemsSimple Functions<br />
    44. 44. Binding<br />NodeSeq => NodeSeq<br />
    45. 45. Binding<br />def list = <br /> "li" #> prods.map { p => <br /> "h2 *" #> p.name &<br /> "a [href]" #> p.link<br />}<br />
    46. 46. Binding<br /><ullift="list_products"><br /> <li><br /> <h2>Product Name</h2><br /> <a href="#">More...</a><br /> </li><br /></ul><br />
    47. 47. AJAX<br />T => JsCmd<br />
    48. 48. AJAX<br />SHtml.ajaxButton(“click me”, () => Alert(now.toString))<br />
    49. 49. BeAsynchronous <br />
    50. 50. Be Asynchronous<br />
    51. 51. Be Asynchronous<br />
    52. 52. Demo<br />Not a chat application in sight!<br />
    53. 53. Demo<br />
    54. 54. Demo<br />
    55. 55. Summary<br />“Smart UI’s” are a complete fail<br />Task-based analysis provides an abstract for the entire task world<br />Functions neatly represent tasks<br />Capture UI interaction with true user intent<br />Comet is useful for more than chat applications!<br />Scalable and efficient backends using Akka<br />End-to-end event based systems<br />
    56. 56. Further Reading<br />Task-Based User Interface Design (PhD Thesis)Martijn van Welie<br />About Face 3Cooper et al<br />Human-Centered Design Considered HarmfulDonald Norman<br />Context and Consciousness: Activity Theory and H.C.I BonieNardi<br />Inductive User InterfacesMicrosoft Reasearch<br />Moments of SignificanceDix, Chisalita, van der Veer<br />The Inmates are Running the AsylumAlan Cooper<br />Twitter Bootstrap: http://twitter.github.com/bootstrap/<br />
    57. 57. “Significant change must be significantly better”<br /> Cooper et al.<br />
    58. 58. Questions?<br />twitter.com/timperrett<br />github.com/timperrett<br />blog.getintheloop.eu<br />Lift in Action<br />manning.com/perrett/<br />

    ×