hci lecture 11 david aspinall - informatics homepages...

43
Interface Implementation HCI Lecture 11 David Aspinall Informatics, University of Edinburgh 26th October 2007

Upload: others

Post on 10-May-2020

2 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Interface ImplementationHCI Lecture 11

David Aspinall

Informatics, University of Edinburgh

26th October 2007

Page 2: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Outline

Overview

Software Engineering

Usability Engineering

Explaining Design

Implementation SupportWindowing systemsApplication architecturesMulti-threading

Page 3: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Outline

Overview

Software Engineering

Usability Engineering

Explaining Design

Implementation SupportWindowing systemsApplication architecturesMulti-threading

Page 4: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Focus on Implementation

É HCI in the software process:Usability Engineering and Design Rationale

É Programming interfaces:Implementation Support

Page 5: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Outline

Overview

Software Engineering

Usability Engineering

Explaining Design

Implementation SupportWindowing systemsApplication architecturesMulti-threading

Page 6: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

HCI in Software Engineering

waterfall model with feedback

É traditional processmodels requiremodification. . .

É user participationÉ during designÉ during evaluation

É usability evaluationÉ should design

interface early, notas a bolt-on!

É −→ UI in process

Page 7: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

HCI in Software Engineering

waterfall model with feedback

É traditional processmodels requiremodification. . .

É user participationÉ during designÉ during evaluation

É usability evaluationÉ should design

interface early, notas a bolt-on!

É −→ UI in process

Page 8: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

HCI in Software Engineering

waterfall model with feedback

É traditional processmodels requiremodification. . .

É user participationÉ during designÉ during evaluation

É usability evaluationÉ should design

interface early, notas a bolt-on!

É −→ UI in process

Page 9: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

HCI in Software Engineering

waterfall model with feedback

É traditional processmodels requiremodification. . .

É user participationÉ during designÉ during evaluation

É usability evaluation

É should designinterface early, notas a bolt-on!

É −→ UI in process

Page 10: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

HCI in Software Engineering

waterfall model with feedback

É traditional processmodels requiremodification. . .

É user participationÉ during designÉ during evaluation

É usability evaluationÉ should design

interface early, notas a bolt-on!

É −→ UI in process

Page 11: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

HCI-oriented processesÉ Lauesen and Harning (2001) describe a process

called Virtual Windows which connects tasks, datamodels and UI design.

Page 12: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

HCI-oriented processesÉ Lauesen and Harning (2001) describe a process

called Virtual Windows which connects tasks, datamodels and UI design.

Page 13: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Outline

Overview

Software Engineering

Usability Engineering

Explaining Design

Implementation SupportWindowing systemsApplication architecturesMulti-threading

Page 14: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Usability Engineering

É Ultimate usability test: measure user experience

É Usability measures made explicit as requirementsÉ Usability specification:

É usability attribute/principleÉ measuring conceptÉ measuring methodÉ now level/ worst case/ planned level/ best case

É Cf. ISO 9241 metrics in Lecture 10É Problems:

É usability spec requires level of detail that may notbe possible early in design

É satisfying a usability specification does notnecessarily satisfy usability

Page 15: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Usability Engineering

É Ultimate usability test: measure user experienceÉ Usability measures made explicit as requirementsÉ Usability specification:

É usability attribute/principleÉ measuring conceptÉ measuring methodÉ now level/ worst case/ planned level/ best case

É Cf. ISO 9241 metrics in Lecture 10

É Problems:É usability spec requires level of detail that may not

be possible early in designÉ satisfying a usability specification does not

necessarily satisfy usability

Page 16: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Usability Engineering

É Ultimate usability test: measure user experienceÉ Usability measures made explicit as requirementsÉ Usability specification:

É usability attribute/principleÉ measuring conceptÉ measuring methodÉ now level/ worst case/ planned level/ best case

É Cf. ISO 9241 metrics in Lecture 10É Problems:

É usability spec requires level of detail that may notbe possible early in design

É satisfying a usability specification does notnecessarily satisfy usability

Page 17: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Usability specification for a VCR

Attribute: Backward recoverability

Measuring concept: Undo an erroneousprogramming sequence

Measuring method: Number of explicit useractions to undo currentprogram

Now level: No current product allowssuch an undo

Worst case: As many actions as ittakes to program-inmistake

Planned level: A maximum of twoexplicit user actions

Best case: One explicit cancel action

Page 18: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Outline

Overview

Software Engineering

Usability Engineering

Explaining Design

Implementation SupportWindowing systemsApplication architecturesMulti-threading

Page 19: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Design RationaleÉ Design rationale is information that explains why

a computer system is the way it is.É Benefits of design rationale

É communication throughout life cycleÉ reuse of design knowledge across productsÉ enforces design disciplineÉ presents arguments for design trade-offsÉ organizes potentially large design spaceÉ capturing contextual information

É Types of DR:É Process-oriented preserves order of deliberation

and decision-makingÉ Structure-oriented emphasizes post hoc

structuring of considered design alternativesÉ Examples:

É Issue-based information system (IBIS)É Design space analysisÉ Psychological design rationale

Page 20: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Issue-based Information SystemÉ Process-oriented; main elements are:

É issues: hierarchical structure with rootÉ positions: potential resolutionsÉ arguments: modify relationship between above

Page 21: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Design Space Analysis

É Structure-oriented: QOC hierarchyÉ questions: major issues of a designÉ options: alternative answersÉ criteria: means to assess options

Page 22: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Psychological Design Rationale

É Supports the task-artefact cycle in which usertasks are affected by the systems they use

É Consequences of design for users made explicitÉ Method:

É designers identify tasks system will supportÉ scenarios are suggested to test taskÉ users are observed on system

É Psychological claims of system made explicitÉ Negative aspects used to improve next iteration

Page 23: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Psychological Design Rationale

É Supports the task-artefact cycle in which usertasks are affected by the systems they use

É Consequences of design for users made explicitÉ Method:

É designers identify tasks system will supportÉ scenarios are suggested to test taskÉ users are observed on system

É Psychological claims of system made explicitÉ Negative aspects used to improve next iteration

Page 24: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Psychological Design Rationale

É Supports the task-artefact cycle in which usertasks are affected by the systems they use

É Consequences of design for users made explicitÉ Method:

É designers identify tasks system will supportÉ scenarios are suggested to test taskÉ users are observed on system

É Psychological claims of system made explicitÉ Negative aspects used to improve next iteration

Page 25: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Outline

Overview

Software Engineering

Usability Engineering

Explaining Design

Implementation SupportWindowing systemsApplication architecturesMulti-threading

Page 26: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Programming the Interface

É How does HCI affect the programmer?É Advances in coding have elevated programming

É hardware specific =⇒ interaction-technique specific

É Layers of development toolsÉ windowing systemsÉ interaction toolkitsÉ user interface management systems (UIMS)

É Application architecturesÉ Model-View-Controller (MVC)É Presentation-Abstraction-Control (PAC)

É Body of programming techniquesÉ concurrency management

Page 27: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Programming the Interface

É How does HCI affect the programmer?É Advances in coding have elevated programming

É hardware specific =⇒ interaction-technique specificÉ Layers of development tools

É windowing systemsÉ interaction toolkitsÉ user interface management systems (UIMS)

É Application architecturesÉ Model-View-Controller (MVC)É Presentation-Abstraction-Control (PAC)

É Body of programming techniquesÉ concurrency management

Page 28: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Programming the Interface

É How does HCI affect the programmer?É Advances in coding have elevated programming

É hardware specific =⇒ interaction-technique specificÉ Layers of development tools

É windowing systemsÉ interaction toolkitsÉ user interface management systems (UIMS)

É Application architecturesÉ Model-View-Controller (MVC)É Presentation-Abstraction-Control (PAC)

É Body of programming techniquesÉ concurrency management

Page 29: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Programming the Interface

É How does HCI affect the programmer?É Advances in coding have elevated programming

É hardware specific =⇒ interaction-technique specificÉ Layers of development tools

É windowing systemsÉ interaction toolkitsÉ user interface management systems (UIMS)

É Application architecturesÉ Model-View-Controller (MVC)É Presentation-Abstraction-Control (PAC)

É Body of programming techniquesÉ concurrency management

Page 30: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Windowing systems

É Role: mediate between devices and applicationsÉ “multiplex” I/O devices to allow multiple

applicationsÉ device indepedence on top of imaging model

É Three possible software architectures:É each application manages all processes

É everyone worries about synchronizationÉ reduces portability of applications

É management role within kernel of operating systemÉ applications tied to operating system

É management role as separate applicationÉ maximum portabilityÉ client-server, e.g. X Windows

Page 31: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Windowing systems

É Role: mediate between devices and applicationsÉ “multiplex” I/O devices to allow multiple

applicationsÉ device indepedence on top of imaging model

É Three possible software architectures:É each application manages all processes

É everyone worries about synchronizationÉ reduces portability of applications

É management role within kernel of operating systemÉ applications tied to operating system

É management role as separate applicationÉ maximum portabilityÉ client-server, e.g. X Windows

Page 32: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Application architecture: read-eval

Page 33: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Application architecture: notification based

Page 34: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

MVC: Model-View-Controller

É MVC highly influential design pattern used inSmalltalk (1980)

Page 35: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

PAC: Presentation-Abstraction-Control

É Coutaz (1987) introduced PAC, a generalisation ofMVC:

Page 36: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Graphical specificationÉ Trend in dialogue control:

É internal control (e.g. read-eval loop)É external control (e.g. UIMS)É presentation control (e.g. graphical specification)

É coder drawscomponents

É sets actions withscript or links toprogram

É Issues: focus on onewindow, hard to “see”paths through system

É Examples: VisualBasic, Flash,DreamWeaver,NetBeans InterfaceBuilder

Page 37: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Graphical specificationÉ Trend in dialogue control:

É internal control (e.g. read-eval loop)É external control (e.g. UIMS)É presentation control (e.g. graphical specification)

É coder drawscomponents

É sets actions withscript or links toprogram

É Issues: focus on onewindow, hard to “see”paths through system

É Examples: VisualBasic, Flash,DreamWeaver,NetBeans InterfaceBuilder

Page 38: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Multi-threading in practice

Multithreaded GUI toolkits seem to be one of the FailedDreams [of Computer Science].

Graham Hamilton, Sun VPhttp://weblogs.java.net/blog/kgh/archive/2004/10/

É Multi-threading desirable; yet nearly all GUI toolkitsuse single-threaded subsystem, e.g. an eventdispatch thread as in Swing. Why?

É GUI components (visual, e.g. JTable and data, e.g.TreeModel) accessed only from event thread.

É A few exceptions, e.g:É adding and removing listenersÉ SwingUtilities.isEventDispatchThread to check

if current thread is event thread

Page 39: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Multi-threading in practice

Multithreaded GUI toolkits seem to be one of the FailedDreams [of Computer Science].

Graham Hamilton, Sun VPhttp://weblogs.java.net/blog/kgh/archive/2004/10/

É Multi-threading desirable; yet nearly all GUI toolkitsuse single-threaded subsystem, e.g. an eventdispatch thread as in Swing. Why?

É GUI components (visual, e.g. JTable and data, e.g.TreeModel) accessed only from event thread.

É A few exceptions, e.g:É adding and removing listenersÉ SwingUtilities.isEventDispatchThread to check

if current thread is event thread

Page 40: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Example Event Listenerimport javax.swing.*; import java.awt.event.*;import java.awt.Color; import java.util.Random;

public class ColorButton extends JFrame {// A button with a listener to change its colorpublic static void main(String[] args) {

new ColorButton();}final Random random = new Random();final JButton button = new JButton("Change Color");ColorButton() {

button.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e) {

button.setBackground(new Color(random.nextInt()));

}});add(button); pack(); setVisible(true);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}}

Page 41: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Flow of Events

É Simple event listener processes events like this:

mouseclick

// actionevent

// actionlistener

// setcolor

É To use a view and data model (MVC), this:

mouseclick

// actionevent

// actionlistener

//updatetablemodel

updatetableview

tablelistener

ootablechangedevent

oo

É fireXxx methods used to indicate model changeÉ control stays in event thread

Page 42: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

Advanced GUI architecturesÉ Update presentation from GUI thread:

É SwingUtilities.invokeLater, schedules a task forexecution in the event thread (callable anywhere)

É SwingUtilities.invokeAndWait, schedules task inevent thread and blocks (call from non-GUI thread)

É To keep GUI responsive, handle long-running tasks:É dispatch separate non-GUI threads to do work (e.g.

using thread pool Executor)É Need “thread-hopping”:

É non-GUI thread queues GUI events to signalprogress, completion

É GUI thread handles cancellation event to killnon-GUI thread

É Managing data models:É shared data model: synchronisation neededÉ thread-safe data models: fine-grained concurrency;

versioningÉ split data model: presentation-domain and

application-domain models

Page 43: HCI Lecture 11 David Aspinall - Informatics Homepages Serverhomepages.inf.ed.ac.uk/da/teach/HCI/implementing.pdf · É Supports the task-artefact cycle in which user tasks are affected

References

Joëlle Coutaz.PAC, on object oriented model for dialog design.In Interact’87, 1987.

Soren Lauesen and Morten Borup Harning.Virtual windows: Linking user tasks, datamodels, andinterface design.IEEE Software, pages 67–75, July/August 2001.

See also:É Dix et al, Chapters 6 and 8.É Jakob Nielsen’s website for more on Usability

Engineering: http://www.useit.com.É Java Swing programming resources at http://java.sun.com/docs/books/tutorial/uiswing/