Tuesday, 27 September 2016
I believe that JEE as sold in the JEE Blueprint is pretty much bullshit. All web development is—as D. Pierce might put it—an HTTP transaction wrapping some form data going to a persistence store, physically or in-memory, and presenting a response about how that data was stored. After that—as I might say—a thin layer of HTTP session management provides and some UX solves for the synchronous, stateless, HTTP protocol.
Simple, established patterns should be enough for almost every application, even at scale.
This is not to discount the GoF, JEE Patterns, or basic Design Patterns, but judgment and application ultimately trumps a generic "blueprint." My position certainly does not absolve a developer from understanding or grokking the JEE API. One cannot intelligently build anything on any platform without a foundation. Be it PHP, Python, node, Java, or the new money language, COBOL.
And so it was today, applying form best practices such as Get-After-Post, also called Post-Redirect-Get (PRG) or Redirect-After-Side-Effect, and the proper HTTP Response status to such a pattern.
As a production user of blojsom for some ten years now, I consider myself something its "steward." I recently pushed a Mavenized repository to github and have started committing to the project again. Mostly to fix my production build of the web application.
For years, every April for example, I would write posts and Draft them periodically to save entries in progress. This would, if I was not careful, result in entries that would be various versions or states of the post, all drafted and waiting for me to publish them. This is finally fixed.
One of the more recent commits was correcting the rich text editor (RTE) form to use PRG. That took some digging into the Administrative Plugin API and understanding how to short circuit the very procedural process method the EditBlogEntriesPlugin.
Initially, the well-managed session attributes—kudos to David Czarnecki—of the BaseAdminPlugin simply called response.sendRedirect(String). The application now properly does the same, but with a 303 See Other response. Moreover, the calling of super.process(request, response, blog, context, entries) returns from Publish with the 303 and presents the Manage Entries list.
I'm looking forward to continue working in the code base and improving blojsom in the coming months. Especially before Blogging A-to-Z 2017!