in reply to Web: interactive, REST: batch?

Well, the baby is already down the river, but imho you shouldnt have implemented the "web application" at all. I'm currently at a similar project and can tell you it's virtually impossible to keep the web app part and the REST part (for those who dont know, REST is basically a datacentric approach to AJAX) in sync. In the end it led to a complete rewrite, abandoning the web app and moving the control flow/logic to the client side (using the ExtJS framework).

As for your question, no the REST part should not act like the web app.


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Web: interactive, REST: batch?
by talexb (Chancellor) on Dec 20, 2007 at 21:06 UTC
      I'm currently at a similar project and can tell you it's virtually impossible to keep the web app part and the REST part (for those who dont know, REST is basically a datacentric approach to AJAX) in sync.

    I must not have explained myself very well -- the web part and the REST part run from the same Perl code, they just output using different TT2 directories. It's impossible for them to be out of sync, unless you count the 'race condition' where two files arrive via REST and a user gets a web page generated after just one of the files has arrived and worries that the other file is missing.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      This is basically the approach that I would take as well, so I think you're at least on the right track. For the specific point that you're asking about, it sounds like the "there are stale files" page is essentially just a click-through warning, is it not? (It may also contain links to do something about the cause of the warning, etc., but I'm talking about its core function/nature.)

      If that is the case, then it's not essential to the app and it has a sensible default exit behaviour (i.e., "user clicks OK and continues on to the same page they would have gotten if there weren't stale files"). I would, therefore, have application check to see whether the corresponding template exists and, if not, just skip over the page and jump straight to the default exit behaviour. For the REST interface, then, you just delete the template for that page and it will skip over the warning. Later on, this also allows you to easily remove the warning from the interactive interface (delete the template) or add the warning to the REST interface (create a template) as requirements change, all without requiring the application to know (or care) which interface is being used, just which template directory to use.