On 15 June 2012 04:06, Adam Howard <[email protected]> wrote:

I tried it out [Johan's client] ...
> He already has many of the features I wanted to add to my little project.
> ...
>
> One of those features, though, you mentioned as a possible negative of the
> DnD viewer was maintaining a client-side cache of objects. Johan uses this
> so that the views can be direct projections of the local model. You change
> a field in one view and all others views automatically update.


Indeed.  Those caches can get out of date; at least: they do on the Irish
system.

The main workaround there is that, when the user searches for a Customer,
then the client invalidates the client-side cache.  It works well enough
because the Customer is the usual start point for most business processing.
 But it's not generic solution, ie is a hack.

Also (and this is even more of a dirty secret), the validation methods
(hidden, disabled, validate) run client-side.  Strictly speaking, they
should run server-side which would force the latest version of the object
to be grabbed.

This second point isn't an issue with an RO-based client, because
validation must trigger a call to the REST API... there is no Java code
client-side.  Of course, with REST we can using HTTP caching to stop the
server being flooded with calls.




> The next
> step I suppose would be to tie in either the WebSockets or EventSource API
> to allow the server to broadcast object change events back to all connected
> viewers. Would you advise against this sort of approach?


Not necessarily... it's hard to say.  I guess we're all going to learn
where websockets (and related technologies) work well and where they don't
as HTML5 becomes commonplace.

I do think it's worth taking this work forward and seeing what happens.
 But ultimately it will require server-side changes to fully support...  It
might end up being quite simple to implement, hard to say.

It also occurs to me that a full WebSockets impl would mean that the UI
would change dynamically in front of a "user's eyes".  Although that sounds
cool, I could also see that it might be disconcerting in some scenarios.
 (You wouldn't want that to happen to a Java source file you were editing,
for example).




> Or is the
> client-side cache you mention more an artifact of the remoting protocol?
>

The bespoke remoting that we had (and have now thrown away) certainly
didn't help matters.  But it was also complicated by the fact that OIDs
(the serializable object identifier by which we identify every object, eg
"customer|123") used to be mutable.   This was because an object would be
transient client-side, then get persisted (ie: users hits the "save"
button), then the object would be sent over the wire, persisted, and its
OID would change.  Figuring all this stuff out was complex.

OIDs are now immutable, which basically means that we don't really support
transient objects anymore.  I can think of patterns that would allow us to
simulate this, though.




>
> On Heroku, I just signed up for the account to post this demo. It seemed
> like the easiest and cheapest (free) way to post a simple java webapp.
> Especially since I didn't require an RDBMS. My 24 hours of experience have
> been fine.
>

OK, looking into it.  I'm also looking at CloudBees and OpenShift, cos I
want a (non-Apache) CI server for this new project that is kicking off.




>
> On the iPad, I thought this would be cool too and then started to think
> about how dragging and right-clicking doesn't work. Then I found jQuery UI
> Touch Punch [1] which maps the jQuery UI events to touch events: click
> becomes tap, right-click becomes tap & hold, and they've made dragging and
> dropping work as well. I'll definitely have to try it out.
>

It's great how many of these UI frameworks are.  Hopefully the REST API
will allow for all sorts of interesting user interfaces going forward.

Cheers
Dan



>
> --
> Adam Howard
>
> [1] http://touchpunch.furf.com/
>
> On Thu, Jun 14, 2012 at 10:12 AM, Dan Haywood
> <[email protected]>wrote:
>
> > Hi Adam,
> > Welcome to Isis, and thanks very much for your interest and the good work
> > you've already done so far!
> >
> > Since you've made a number of points, I've commented on them inline....
> >
> >
> > On Thursday, 14 June 2012, Adam Howard wrote:
> >
> > >
> > > I started reading Dan's book last fall and made it part way through the
> > > carserv example app using Isis 0.1.2-incubating. I used the DnD viewer
> > > almost exclusively, enjoying how tangible the objects became using the
> > > multi-window interface.
> > >
> >
> >
> >
> > >
> > > About a month ago I came back to the book and decided to start writing
> my
> > > own little app alongside carserv. I grabbed the latest Isis quickstart
> > > archetype (0.2.0-incubating) and started coding. Surprisingly, I saw
> that
> > > the DnD viewer was no longer included as standard in the archetype. I
> > used
> > > the HTML viewer for about a week but it just didn't feel the same. With
> > the
> > > DnD viewer I could look at my object representations and it would help
> > > drive my modeling. "Oh, I need a relationship here so I can drop this
> > > object on that one."
> > >
> >
> > Like you, I also have a soft spot for the DnD viewer, and Rob does too of
> > course because it's his baby.  It's also the viewer that's used on the
> big
> > system in Ireland, used by 2,500+ people on a day-to-day basis.
> >
> > On the other hand, the DnD viewer, let's say, not the prettiest of UIs.
> >  (For myself at least) I'm pretty sure lots of people have seen it and
> got
> > turned off by Isis / the naked objects pattern....
> >
> > As you've probably realized, the DnD viewer code itself has not been
> > deleted.  However, we removed it from the archetype because:
> > * we wanted to try to include only the stuff that was "complete", and in
> > its current incarnation a few new features are only semi-implemented
> > * its status was becoming less clear with the move to remove the remoting
> > stuff
> > * to figure out what it's positioning should be within the context of the
> > other viewers.
> >
> > Where I think we are now is that we see the DnD viewer as being
> > resurrected, but positioned solely as a design tool for developers.
> >
> > At some point Rob needs to do some tidy up work to remove the
> > semi-implemented features and get it back to where it was (ideally: I'd
> > like it to look like NOF 3.0.3, with the collections on the left).  As
> and
> > when that's done, I'll add it back into the archetype.
> >
> > In the meantime, you can of course create a Maven module and reference
> the
> > viewer; the module generated from the 0.1.2-incubating archetype will
> > probably work just fine (save change the version of Isis referenced,
> > obviously).
> >
> >
> >
> >
> > >
> > > This got me wondering. Could a browser-based multi-window interface be
> > > built on top of the JSON viewer and a javascript ui library? I looked
> at
> > > all the contenders (YUI, jQuery, MooTools, Backbone, ExtJS) and finally
> > > settled on jQuery after seeing this blog post [1] and looking at the
> > > jqMobile example.
> > >
> >
> > Indeed.  And in fact a chap called Johan Andries had the same idea and
> > spent some time putting together an early JS application against the
> > Restful interface using JQueryUI and Backbone.  He's also shared his
> code,
> > at [5].
> >
> >
> >
> >
> > >
> > > I've been playing with it for the past couple weeks and I'm at the
> point
> > > where I wanted to know if this is something the community is interested
> > in.
> > > I know it's ANOTHER viewer and I'm making no claims that it's ready (or
> > > will ever be ready) for anyone else to use. I'm really asking if the
> > ideas
> > > embodied in the DnD viewer are still desired?
> >
> >
> > Yes, I think they are.  In fact, Johan's viewer also uses the DnD as its
> > metaphor.  I had a quick play with your app [4] (though not for long)
> and I
> > think that Johan has gotten a little further with his framework than you.
> >  That said, he doesn't seem to have done any work on it since Nov last.
> >
> > So, one option you might want to explore is to contact Johan and either
> > join his project, or fork it and take it from there.
> >
> > For myself, I was thinking that a GUI based on ExtJS might do well as a
> > sovereign style app... but I can't see myself starting on that this year
> > (2012).
> >
> >
> >
> > > The most important to me
> > > being multiple objects on a virtual desktop that you can visually
> layout
> > to
> > > increase understanding.
> > >
> >
> > Agreed.  Also, with toolkits such as SenchaTouch, I think there are
> > opportunities for very interactive UIs that can be deployed on iPADs and
> > the like.
> >
> >
> >
> >
> > >
> > > All of the latest developments I've seen, both in Isis and
> > NakedObject.NET,
> > > have centered on single-object view web layouts. Was it discovered that
> > the
> > > desktop metaphor viewers were lacking for some users?
> >
> >
> > The next generation of the Irish government project is indeed moving to
> > Naked Objects MVC.  It's too early to say how that will pan out.
> >
> > However, the issue with the DnD viewer is mostly its architecture: the
> > client/server remoting protocol, and having to maintain client-side cache
> > of objects and managing transient/persistent objects and lazy loading
> over
> > the wire.  The Irish app which runs under this architecture does work,
> but
> > the sordid little secret is that there are a number of hacks under the
> > covers to get it to do so.
> >
> > But this is why the Restful interface (per the json-viewer) is so
> > important, I think: it will enable different types of viewers with
> whatever
> > UI paradigm fits, but on a solid, scalable, back-end architecture .
> >
> > So... I would say, go for it and build a DnD (or whatever) viewer, using
> > the restful API.  There's no reason not to.
> >
> >
> >
> > > The new web viewers
> > > are great but they don't give me the same sense of exploration as the
> > > original GUI. Maybe that exploration isn't needed after the model
> > > solidifies and the app is being used.
> > >
> > > Anyway, sorry for rambling.
> >
> >
> > Not at all... very interested to hear your thoughts.
> >
> >
> >
> > > I tried something new and posted my little app
> > > on Heroku. If I understand the service right you can access the JSON
> > viewer
> > > [2], the HTML viewer [3] and my "windowed" viewer [4] at the urls
> below.
> > It
> > > might take a few seconds to spool up. Credentials are sven/pass. Tested
> > in
> > > Chrome, FF, and Safari.
> > >
> >
> > Heroku: that's on my todo list to look into.  I might pick your brains.
> >
> >
> >
> > >
> > > Again it's nowhere near complete but you can execute actions, view
> > objects
> > > and collections, create objects and modify properties (mostly.)
> > >
> > > Thanks for creating a wonderful framework to build on.
> > >
> >
> > Thanks for the kind words, looking forward to continuing the
> conversation!
> >
> > Cheers
> > Dan
> >
> >
> >
> > > --
> > > Adam Howard
> > >
> > > [1]
> > >
> > >
> >
> http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-windows-like-interface-with-jquery-ui/
> > > [2] http://simple-dusk-6870.herokuapp.com
> > > [3] http://simple-dusk-6870.herokuapp.com/htmlviewer
> > > [4] http://simple-dusk-6870.herokuapp.com/services.html
> >
> >
> > [5]  http://code.google.com/p/restfulobjects-js/
> >
>

Reply via email to