• No results found

Chapter 4: User-Interface Retargeting

4.1 Overview

Figure 36. Retargeting between two lights in different rooms under Hodes’ System.

The basic idea of device user-interface retargeting was previously identified and implemented in Hodes’ System. The system retargets the user-interface of a source device to a target device when the XML descriptions of the two devices differ only in the device addresses (Figure 36). To retarget, the system simply changes the source user- interface’s RPC address from the source device’s address to the target device’s address. In the example of Figure 36, the RPC address changes from sn346.cs.unc.edu/0001 to

sn140.cs.unc.edu/0001. The buttons and state widgets of the source user-interface

stay the same throughout this process. However, the command invocations and state updates become associated with the target device. Hodes’ System has source user- interface and programming interface flexibility limitations, some of which we overcome.

<service name='lamp'> <label>lamp</label>

<addrspec>sn346.cs.unc.edu/0001</addrspec> <method name='power'>

<param lextype="enum:on,off,dim"> state </param> </method> </service> 1 (source) 2 (target) UI Light UIUI Light UI <service name='lamp'> <label>lamp</label> <addrspec>sn140.cs.unc.edu/0001</addrspec> <method name='power'>

<param lextype="enum:on,off,dim"> state </param> </method>

71

Source user-interface flexibility determines the kinds of user-interfaces a system can retarget. There are various levels of source user-interface flexibility a system can offer (Figure 37). A system could retarget user-interfaces containing operations possibly with arguments of primitive and/or structured types (Figure 38a). In addition, it could retarget user-interfaces possibly displaying primitive and/or structured typed properties (Figure 38(b and c)). Hodes’ System can retarget command and state-based user-interfaces. It only supports primitive-typed command arguments and state.

Figure 37. Levels of source UI flexibility.

Figure 38. User-interfaces requiring different levels of source user-interface flexibility.

Programming interface flexibility determines how different the programming interfaces of a source and target device can be in order to support retargeting. As

Source UI Flexibility State Commands Arguments No Arguments Primitive Types Arbitrary Types Primitive Types Arbitrary Types Source UI Flexibility State Commands Arguments No Arguments Primitive Types Arbitrary Types Primitive Types Arbitrary Types

Command-only

int - Primitive

Vector - Structured

(a)

(b)

(c)

Command-only

int - Primitive

Vector - Structured

(a)

(b)

72

supported by Hodes’ System, a generator could retarget only if the two devices share the same programming interface. By sharing the same programming interface, they inherently share identical commands and state properties. Thus, when retargeting, no time must be spent changing the appearance of the source user-interface to fit a target device (Figure 39). Time must only be spent changing the code associated with the components to direct method invocations to the target device and reflect the device’s state changes.

Figure 39. Devices with identical programming interfaces share identical user-

interfaces.

There is an important limitation with this level of retargeting. It can only be used if a user has recently interacted with a device of the same programming interface as the target device. Otherwise, the generator must spend the time creating a whole new user- interface. In this case, rather than create a new user-interface, a generator could change the source device’s user-interface to fit the target device, recycling parts of the user- interface that the two devices share. For example, a generator could change the user- interface of a non-dimmable lamp to fit a dimmable lamp (Figure 40). Conversely, the generator could retarget the dimmable lamp’s user-interface to the non-dimmable lamp. This task would involve removing dim-related components from the user-interface.

public interface DimmableLamp { //commands

public void on(); public void off(); public void dim(); public void brighten(); //state

public int getBrightness (); public boolean getPowered();

public void setPowered (boolean _powered);

}

public interface DimmableLamp { //commands

public void on(); public void off(); public void dim(); public void brighten(); //state

public int getBrightness (); public boolean getPowered();

public void setPowered (boolean _powered);

}

TARGET SOURCE

73

Figure 40. Retargeting between a dimmable and non-dimmable lamp.

Retargeting when the source and target devices have different programming interfaces does not always require changing the source user-interface. Figure 41 shows an example of this case. The ‘Current Channel’ properties of two different VCRs, though represented by different types (String and int), map to the same views. This is also true for the ‘Record Settings’ properties. The ‘Current Channel’ maps to a textbox for entering integers or strings and the ‘Record Settings’ maps to a special widget for displaying the elements of vectors or arrays.

Figure 41. Two different VCR programming interfaces that can share the same UI.

Beyond its flexibility limitations, Hodes’ work does not provide any quantitative evaluations showing the deployment time benefits of retargeting. It also supports

public interface VCR1{ //commands

public void power(); public void stop(); public void play(); public void ff(); public void rwd();

//state

public StringgetChannel(); public void setChannel(Stringc); public VectorgetRecordSettings(); public void setRecordSettings(Vectorc);

public interface VCR2{ //commands

public void power(); public void stop(); public void play(); public void ff(); public void rwd();

//state

public int getChannel(); public void setChannel(int c);

public RecordSettings[]getRecordSettings(); public void setRecordSettings(RecordSettings[]c);

Share same UI

public interface VCR1{ //commands

public void power(); public void stop(); public void play(); public void ff(); public void rwd();

//state

public StringgetChannel(); public void setChannel(Stringc); public VectorgetRecordSettings(); public void setRecordSettings(Vectorc);

public interface VCR2{ //commands

public void power(); public void stop(); public void play(); public void ff(); public void rwd();

//state

public int getChannel(); public void setChannel(int c);

public RecordSettings[]getRecordSettings(); public void setRecordSettings(RecordSettings[]c);

Share same UI

public interface Lamp { //commands

public void on(); public void off(); //state

public boolean getPowered();

public void setPowered(boolean _powered); }

public interface DimmableLamp { //commands

public void on(); public void off(); public void dim(); public void brighten(); //state

public int getBrightness(); public boolean getPowered();

public void setPowered(boolean _powered); }

TARGET SOURCE

public interface Lamp { //commands

public void on(); public void off(); //state

public boolean getPowered();

public void setPowered(boolean _powered); }

public interface DimmableLamp { //commands

public void on(); public void off(); public void dim(); public void brighten(); //state

public int getBrightness(); public boolean getPowered();

public void setPowered(boolean _powered); }

TARGET SOURCE

74

retargeting only in the domain of GUIs. As Table 5 shows, our goal was to offer more GUI retargeting flexibility and additionally support SUIs. We also wanted to provide a quantitative evaluation of retargeting.

We based our GUI retargeting support on the ObjectEditor framework. The generator provides mechanisms, unsupported by our SUI generator, which allowed us to achieve higher flexibility goals. For example, it can create state-based user-interfaces, thus allowing us to retarget such user-interfaces. The SUI generator, however, does not support state. We did implement a basic level of retargeting for this generator to quantify any possible benefits of retargeting SUIs.

Hodes Retargeting SUI Gen. Retargeting Object Editor Retargeting Primitive Types Y N Y Arguments Structured Types N N Y Command UIs No Arguments Y Y Y Primitive Types Y N Y Source UI Flex ibility State UIs Structured Types N N N Identical UIs N N Y Different Programming

Interfaces Non-Identical UIs N N Y

Prog ra mming Inter face Flex ibility

Same Programming Interfaces Y Y Y

Table 5. Retargeting flexibility – Hodes’ System vs. Our Goals.

In document Interacting with networked devices (Page 85-89)

Related documents