As the Naked Objects approach may feel quite unusual for a beginner, this chapter discusses the potentials and limitations based on a simple application. In general, gengui allows you to produce any kind of individual UI which can be implemented with Java and Swing. However, if you follow a strong UI-first approach, the efficiency of a Naked Objects architecture may get lost in a flood tide of specialized UI gimmick implementations. UI-first approach means: the users start thinking about their own business in terms of masks and dialog flow rather than business objects and business processes. There are definitely UIs which must follow this approach, e.g. public-facing web sites which in first place need to attract unexperienced consumers. But this is not what gengui is made for.
Naked Objects is based on the idea of "Form Follows Function" - an architecture principal which is not limited to software design. It first became famous by the Chicago School for Architecture and the Bauhaus movement (see http://de.wikipedia.org/wiki/Form_follows_function). The design and the shape of a building (or what-ever object) should be primarily based upon its intended function or purpose. The function comes first and aesthetics complies with this functionality without breaking or re-defining it.
The application to discuss is a simple personal todo list adapted from the site http://todomvc.com/ which provides various web implementations based on different web MVC frameworks. The pictures below show one of these web variants (which all look pretty much the same due to a common style sheet) and an advanced gengui-based implementation which imitates the original as good as possible.
As you can see, the gengui implementation doesn't provide a shadow around the list - this is way to difficult in Swing - and it doesn't show the check mark from the first line in a magnified style. But to be honest: we think this is rubbish anyway ;-)
MVC (Model-View-Controller) is the typical architecture pattern for UI construction which combines maximum layout flexibility with a reasonably maintainable code structure. On the other hand it is a heavy-weight pattern and Naked Objects is intended to provide a light-weight alternative by encapsulating many aspects of MVC behind the scenes of the framework. So comparing gengui-based variants of an application, which is actually intended to demonstrate MVC capabilities, should be a good practical guide.
The gengui distribution includes three different variants of the same application which is specified at https://github.com/tastejs/todomvc/blob/master/app-spec.md#functionality as follows, using a slightly un-webbified vocabulary:
So let's have a look how to deal with these requirements the gengui way...
Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator