views:

771

answers:

10

In my experience, UI programming is very time consuming, expensive (designers, graphics, etc) and error prone - and by definition UI bugs or glitches are very visible embarasing.

What do you do to mitigate this problem?

Do you know of a solution that can automatically convert an API to a user interface (preferably a Web user interface?).

Probably something like a JMX console

  • with good defaults
  • can be tweaked with css
  • where fields can be configured to be radio button or drop down list, text field or text area, etc
  • localizable
  • etc
A: 

Hi Andy, if you already know or could learn to use Ruby on Rails, ActiveScaffold is excellent for this.

Adam Alexander
+2  A: 

Looks like you are looking for the 'Naked Objects' Architectual pattern. There are various implementations available.

http://en.wikipedia.org/wiki/Naked_objects

Jens Schauder
I'm not too sure why you would have chosen this answer as "the answer" andy? This is the most generalized/vague answer of them all. Actually I don't even see how in the world you could possibly find the solution to your problem and enhance your UI development time with Naked Objects. Would it be possible to give feedback as to what you saw in this solution that makes you think it resolves your problem in your question? I'm not being sarcastic, I'm just really curious. Thanks!
Jeach
obvioiusly I can't speak for the OP, but Naked Object Frameworks do exactly what he asked for: they generate a UI from an API
Jens Schauder
+2  A: 

I'm not providing a solution, but I'll attempt to answer the why.

So I don't speak for everyone, but for me at least, I believe one reason is because programmers tend to concentrate on functionality more so than usability and they tend not to be too artistic. I think they just tend to have a different type of creativity. I find that it takes me a long to time to create the right graphics, compared to how long it takes me to write the code (Though, for the most part, I haven't done any projects with too many graphical requirements).

CookieOfFortune
+6  A: 

I don't believe UI programming is more time consuming than any other sort of programming, nor is it more error prone. However, bugs in the UI are often more obvious. Spotting an error in a compiler is often much more tricky.

One clear difference between UI programming is that you have a person at the other end, instead of another program, which is very often the case when you're writing compilers, protocol parsers, debuggers, and other code which talks to other programs and computers. This means that the entity you're communicating with is not well-specified and may behave very erratically.

EDIT: "unpredictable" is probably a more appropriate term. /Jesper

Your question of converting an API to a user interface just doesn't make sense to me. What are you talking about?

JesperE
'is not well-specified and may behave very erratically' - how true! +1
Treb
What is API if it is not user interface for a programmer.
Newtopian
Programs themselves are written by humans and are usually not well-specified and behave erratically. Furthermore, your interpretation of a user as some intrinsically flawed entity is the root of all usability issues.
Kurt Schelfthout
Maybe "erratically" is the wrong word. "Unpredictable" is probably more along the lines of what I meant.
JesperE
@Newtopian: Now I see what you mean.
JesperE
A: 

One reason is that we don't have a well-developed pattern for UTDD - User Test Driven Development. Nor have I seen many good examples of mapping User Stories to Unit Tests. Why, for example, do so few tutorials discuss User Stories?

le dorfier
+7  A: 

Developing UI is time consuming and error-prone because it involves design. Not just visual or sound design, but more importantly interaction design. A good API is always interaction model neutral, meaning it puts minimal constraints on actual workflow, localisation and info representation. The main driver behind this is encapsulation and code re-use.

As a result it is impossible to extract enough information from API alone to construct a good user interface tailored to a specific case of API use.

However there are UI generators that normally produce CRUD screens based on a given API. Needless to say that such generated UI's are not very well-suited for frequent users with demands for higher UI efficiency, nor are they particularly easy to learn in case of a larger system since they don't really communicate system image or interaction sequence well.

It takes a lot of effort to create a good UI because it needs to be designed according to specific user needs and not because of some mundane API-UI conversion task that can be fully automated.

To speed the process of building UI up and mitigate risks it is possible to suggest either involving UI professionals or learning more about the job yourself. Unfortunatelly, there is no shortcut or magic wand, so to speak that will produce a quality UI based entirely and only on an API without lots of additional info and analysis.

Please also see an excellent question: "Why is good UI design so hard for some developers?" that has some very insightful and valuable answers, specifically:

Totophil
A: 

Automatically generating user interfaces may be possible to some extent, in that it can generate controls for the required input and output of data. But UI design is much more involved than simply putting the required controls onto a screen. In order to create a usable, user friendly UI, knowledge from disciplines such as graphics design, ergonomics, psychology, etc. has to be combined. There is a reason that human-computer interaction is becoming a discipline of its own: its not trivial to create a decent UI.

So I don't think there's a real solution to your problem. UI design is a complex task that simply takes time to do properly. The only area where it is relatively easy to win some time is with the tooling: if you have powerful tools to implement the design of the user interface, you don't have to hand-code every pixel of the UI yourself.

Daan
A: 

ASP.NET Dynamic Data is something that you should investigate. It meets most, if not all your requirements

Conrad
A: 

You are absolutely correct when you say that UI is time consuming, costly and error prone!

A great compromise I have found is as follows...

I realized that a lot of data (if not most) can be presented using a simple table (such as a JTable), rather than continuously try to create custom panels and fancy GUI's. It doesn't seem obvious at first, but it's quite decent, usable and visually appealing.

Why is it so fast? Because I was able to create a reusable framework which can accept a collection of concrete models and with little to no effort can render all these models within the table. So much code-reuse, its unbelievable.

By adding a toolbar above the window, my framework can add to, remove from or edit entries in the table. Using the full power of JTables, I can hide (by filtering) and sort as needed by extending various classes (but only if/when this is required).

I find myself reusing a heck of a lot of code every time I want to display and manage new models. I make extensive use of icons (per column, rows or cells, etc) to beautify the screens. I use large icons as a window header to make each screen 'appear' different and appealing and it always looks like new and different screens, but its always the same code behind them.

A lot of work and effort was required at first to do the framework, but now its paying off big time.

I can write the GUI for an entirely new application with as many as 30 to 50 different models, consisting of as many screens in a fraction of the time it would take me using the 'custom UI method'.

I would recommend you evaluate and explore this approach!

Jeach
Why on earth would the user want to see the datamodel. Most of the time the user are not interested. They want to perform a goal oriented task, with as little effort as possible. The UI is supposed to do the interpretation of the model in the users language, not the developers.
haqwin
Jeach
A: 

It's hard because most users/customers are dumb and can't think straight! :) It's time consuming because UI devs/designers are so obsessive-compulsive! :)

zvolkov