Author Archives: Sony Hartono Wijaya

About Sony Hartono Wijaya

Department of Computer Science Bogor Agricultural University (IPB)

User Interface Design

The Golden rule

These golden rules actually form the basis for a set of user interface design principles that guide this important software design activity.

1 Place the User in control

Most interface constraints and restriction that are imposed by a designer are intended to simplify the mode of interaction. The designer might introduce constraints and limitations to simplify the implementation of the interface. The result may be an interface that is easy to build, but frustrating to use.

Design principles:

  • Define interaction modes in a way that does not face a user into unnecessary or undesired actions.
  • Provide for flexible interaction
  • Allow user interaction to be interruptible and undoable.
  • Streamline interaction as skill levels advance and allow the interaction to be customized.
  • Hide technical internals from the casual user.
  • Design for direct interaction with objects that appear on the screen.

2 Reduce the User’s Memory Load

A well designed user interface does not tax the user’s memory. Whenever possible, the system should “remember” pertinent information and assist the user with an interaction scenario that assists recall.

Design principles to reduce the user’s memory load:

  • Reduce demand on short-term memory. The interface should be designed to reduce the requirements to remember past actions and results.  This can be accomplished by providing visual cues that enable a user to recognize past actions, rather than having to recall them.
  • Establish meaningful defaults.
  • Define shortcuts that are intuitive.
  • The visual layout of the interface should be based on a real world metaphor.
  • Disclose information in a progressive fashion.

3 Make the Interface consistent

The interface should present and acquire information in a consistent fashion. This implies that

  1. all visual information is organized according to a design standard that is maintained throughout all screen displays,
  2. input mechanisms are constrained to a limited set that are used consistently throughout the application, and
  3. mechanism for navigating from task to task are consistently defined and implemented.

Design principles to Make the Interface consistent:

  • Allow the user to put the current task into a meaningful context. It’s important to provide indicators that enable the user to know the context of the work at hand.
  • Maintain consistency across a family of applications. A set of applications should all implement the same design rules so that consistency is maintained for all interaction.
  • If past interactive models have created user expectation, do not make changes unless there is a compelling reason to do so.

Galitz, 2007

Developing a Structure Chart

Two approaches that can be used to develop a Structure Chart are Transaction Analysis and Transform Analysis (Satzinger 2007).

Transaction analysis

  • Uses system flow chart and event table inputs
  • Upper-level modules developed first
  • Identifies each transaction supported by program

Transform analysis

  • Uses DFD fragments for inputs
  • Computer program “transforms” inputs into outputs
  • Charts have input, calculate, and output subtrees
uTransaction analysis
lUses system flow chart and event table inputs
lUpper-level modules developed first
lIdentifies each transaction supported by program
uTransform analysis
lUses DFD fragments for inputs
lComputer program “transforms” inputs into outputs
lCharts have input, calculate, and output subtrees

Java – How to read input from console

JDK 5.0 provides a feature to read input from console. Java.util,Scanner is used for this purpose. This code read a String and an Integer from the console and stores them in the variables.
import java.util.Scanner;

public class InputExp {

public static void main(String[] args) {

String name;
int age;
Scanner in = new Scanner(System.in);

// Reads a single line from the console  and stores into name variable
name = in.nextLine();

// Reads a integer from the console  and stores into age variable
age=in.nextInt();
in.close();

// Prints name and age to the console
System.out.println(“Name :”+name);
System.out.println(“Age :”+age);

}
}

http://www.java-tips.org/java-se-tips/java.util/how-to-read-input-from-console.html

CPP – Set decimal precision

// setprecision example
#include <iostream>
#include <iomanip>
using namespace std;

int main () {
double f =3.14159;
cout << setprecision (5) << f << endl;   //3.1416
cout << setprecision (9) << f << endl;   //3.14159
cout << fixed;
cout << setprecision (5) << f << endl;   //3.14159
cout << setprecision (9) << f << endl;   //3.141590000
return 0;
}

http://www.cplusplus.com/reference/iostream/manipulators/setprecision/

Java – Features Removed from C and C++

This section discusses features removed from C and C++ in the evolution of Java.The first step was to eliminate redundancy from C and C++. In many ways, the C language evolved into a collection of overlapping features, providing too many ways to say the same thing, while in many cases not providing needed features. C++, in an attempt to add “classes in C”, merely added more redundancy while retaining many of the inherent problems of C.

1 No More Typedefs, Defines, or Preprocessor

Source code written in Java is simple. There is no preprocessor, no #define and related capabilities, no typedef, and absent those features, no longer any need for header files. Instead of header files, Java language source files provide the declarations of other classes and their methods.A major problem with C and C++ is the amount of context you need to understand another programmer’s code: you have to read all related header files, all related #defines, and all related typedefs before you can even begin to analyze a program. In essence, programming with #defines and typedefs results in every programmer inventing a new programming language that’s incomprehensible to anybody other than its creator, thus defeating the goals of good programming practices.

In Java, you obtain the effects of #define by using constants. You obtain the effects of typedef by declaring classes–after all, a class effectively declares a new type. You don’t need header files because the Java compiler compiles class definitions into a binary form that retains all the type information through to link time.

By removing all this baggage, Java becomes remarkably context-free. Programmers can read and understand code and, more importantly, modify and reuse code much faster and easier.

Continue reading