6

A while ago I read the book on Naked Objects and was excited by the ideas. Writing only my core business logic and having the UI automatically generated? Sign me up!

Further, the potential goes beyond that. This can be a great tool in domain modeling. With the ability to directly invoke one's objects, one is encouraged to directly use one's domain objects, whereupon one can discover...

  • Flaws
  • Useful interaction patterns (for UI implementation, particularly pertinent if one holds the view that a UI is basically "scripting the domain objects")
  • New features.

To this end, I'm interested in any systems similar to Naked Objects. I did some leg-work, such as searching for hits under strings like "Direct Manipulation UI", but haven't found anything useful.

Do you know of any work along similar lines? I'd prefer something in PHP or JavaScript and that doesn't assume I'm running a Linux box. I know of NakedPHP and Spiro (can't find documentation for that), but they're both basically Naked Object implementations for PHP and javascript, respectively.

Do you know of any other systems?

R. Barzell
  • 666
  • 5
  • 24
  • 1
    Symfony 1.3+ and Propel (now no longer supported) used to generate forms based on database schemas plus sensible defaults. It used quite a complicated OO forms builder system. I wonder if Symfony 2.x and an ORM (I think Doctrine is now the default) does something similar? – halfer Feb 24 '15 at 20:57
  • Not a bad angle, but what about something more tied to objects themselves? – R. Barzell Feb 24 '15 at 20:59
  • Wouldn't it make more sense to tie UI to model objects? In most cases, UIs are just renderings of database tables/rows. If you want to do this explicitly from objects rather than models, then I don't know - just wanted to throw the Symfony suggestion in. – halfer Feb 24 '15 at 21:07
  • I'd look at Symfony and Doctrine. I think it will get you where you need to go. – Halfstop Feb 24 '15 at 21:08
  • @halfer tying the UI to models makes sense, but there's also a place for tying a UI to objects. For instance, what if I'm also implementing my models as objects? Or what if I'm trying to "execute" my object network as part of an analysis phase? Or what if I'm brainstorming UI ideas? What if I'm exploring emergent functional paths that arise due to object interactions, which I can then capture as an interaction script? The main thing here is I'm trying to find something lightweight, where I don't have to buy into a framework, paradigm or methodology. – R. Barzell Feb 26 '15 at 14:18
  • I think you have to draw the line somewhere between not tying yourself down and re-inventing the wheel. You certainly could try writing something simple yourself, and it sounds like an interesting problem, but I dare say that the existing solutions Richard mentions have learnt from past experience what projects need in practice. I imagine they would have mechanisms to hint to the UI builder how to modify a specific UI from default interpretations. You'd be building all that again, and throwing away the knowledge captured in existing work. – halfer Feb 26 '15 at 14:24
  • In terms of existing solutions (and I am conscious this might metamorphose into a "recommendations question", which is off-topic), consider searching for "PHP admin generator" and "PHP CRUD builder", which may yield software that does not tie to a specific framework. – halfer Feb 26 '15 at 14:26

2 Answers2

9

As co-author of the Naked Objects book, I would like to add my view.

It is not uncommon that people really like the concept of the naked objects pattern, but don't like the particular UI. You didn't say how long ago you looked at the implementation, or indeed, which one. The two main open source implementations (there are a few others, but less established) are:

  • The Naked Objects Framework, for the .NET platform
  • Apache Isis, for the Java platform

both of these have more than one UI. But, let's presume that you have looked at all the default UIs and are not happy with any of them. First, most people who use either framework in an enterprise setting end up customising the default UI quite a bit, whether using just .css, or with additional JavaScript - but still keeping to the concept of a 'generic' UI that is created dynamically.

More recently, Dan Haywood and I took the idea of the naked objects pattern much further forward with the introduction of theRestful Objects specification - an ultra-pure REST API that works for any rich domain model. Both the two naked objects implementations now also implement the Restful Objects specification. The point about this is that using the RO API it is now relatively easy to design new, radically different, UIs (generic, or fully bespoke) that talk to a server implementation of RO. In other words, it is relatively easy to create your own client-side implementation of the naked objects concepts, re-using either of the two main server-side implementations.

Spiro, which you mentioned, is our first attempt to create a library of building blocks for creating such a UI, using JavaScript (TypeScript, actually) and Angular.js. And the cool thing about using the RO spec, is that you could run the same client against any server implementation. I recommend you take a good look at it.

Richard Pawson
  • 1,494
  • 1
  • 10
  • 15
  • Loved your book!!!!! I don't remember when I first used it, but it predated Apache Isis and Spiro. I didn't mean to attack the UI; rather, I was trying to segue into my main interest in Naked Objects, so that any answers wouldn't be too focused on the quality of the UI for alternatives. I'll edit my question accordingly. I really want to try Spiro, but couldn't find docs or examples -- maybe those are in the distro? In any case, I'll give Spiro another look. If nothing else comes down the pipe, I'll accept your answer. – R. Barzell Feb 25 '15 at 14:07
2

I hit upon a few other possible key terms and found a few, although not all are in javascript.

These seem to be better fits...

Metawidget is especially interesting. It supports javascript, and is easy to use. You can just provide it your domain model (a JSON object) and it can generate a UI for it. Further, it doesn't take over your page, so it can live in a pre-existing UI, and it allows UI customizations.

They also include a comparison page with similar products.

Another interesting one is BlueJ; it's an educational platform based on (the idea of?) Naked Objects, but can be used for smaller projects. Basically you can graphically create instances of your class via a context menu, then you can inspect and invoke the resulting object methods via the same way (potentially creating more objects in the process).

Going further afield, to looking towards any UI auto-generation, there are CRUD visualizers which are tied to the database.

I'm still researching these, especially the object ones, and am open to other suggestions.

R. Barzell
  • 666
  • 5
  • 24