views:

212

answers:

1

On episode #41 of the Stack Overflow Podcast Jeff and Joel discussed GUI ideologies that lead to poor usability. What GUI toolkits have you seen that most beneficially influence the programmers that use them? What level of separation (between user-interface and implementation) do you find most efficient for testability and usability?

+4  A: 

What GUI toolkits have you seen that most beneficially influence the programmers that use them?

My own, developed based on experience with computer science and the specific needs of the industry I develop for. In short there is no magic bullet just tools that you have to use experience and judgment with. What works for my CAD/CAM software, is not going to work for a web developer's website, nor for a developer of office software, and so on.

What level of separation (between user-interface and implementation) do you find most efficient for testability and usability?

For traditional applications that run on the desktop of a computer I recommend variants of the Passive View. The class responsible for creating and managing the form is a thin shell that passes events to the UI Object. The UI_Object interact with the form via a interface. In term the UI Object implements a UI_View Interface and registers itself with a View Controller that is situated lower in the object hierarchy.

The UI_Object then execute object implementing the Command Pattern which modifies the model. The command object can interacts with the various views via the interfaces exposed by the View Control.

What this does is allow you to rip off the form classes and replace them with stub classes that implement the form interfaces. The stub classes are used for automated testing especially for integration tests.

The interfaces precisely define the interaction between the Form, the UI_Object, Commands and the views. They can be designed to be relatively language agnostic so they can make porting between platform easier.

I am not as proficient with programming for the web but there are related patterns that accomplish the same thing.

I have to also caution that Passive View can be overkill. You may not want to use it for simple setup dialog (like the dialog setting up serial port parameters). This a judgment call on whether the ease of maintenance and coding is worth the added testing time. If a dialog is only called by a single command to modify some setup parameters then it is a good candidate to have it defined within the command itself.

RS Conley