Yoz Grahame's Unresolvable Discrepancy

I came here to apologise and eat biscuits, and I'm all out of biscuits

So this by you is a methodology?

Posted: August 14th, 2002 Comments Off

So I was doing a Freshmeat trawl and came across the usual clutch of content management systems, and JPublish looks pretty good. It uses the Velocity engine, it has a repository abstraction layer and various other nice things. Haven’t tried it (CMSes aren’t the kinds of things I have quick plays with unless the interfaces are particularly spiffy) but it may be worth a look if Java is your bag.

Anyway, one thing that prodded my interest was a mention of a templating methodology called FreeEnergy that was created for PHP and apparently has been adopted for various templating systems in other languages. The key description is apparently in this article by the guy who created it. So I’m expecting something neat and useful, and what do I find? Nested includes. That’s it. Oh, and a big question about how to chain actions and do decent error handling without massive nesting, which shows the author has never heard of exceptions. (So that’s yet another reason to for me to continue my personal vendetta against PHP.)

Let me tell you about a templating feature which I really like and which should be supported in many more web app systems. I first encountered it in an open source e-commerce system called Minivend (now Interchange) and I haven’t seen it anywhere since. The big idea is that you can write some HTML-embedded code to be executed when a user clicks on a link or form, but this code lives in the same file as the link or form to be clicked, as opposed to living in the file targeted by the link.

An example: clicking on a link adds an item to your basket and then takes you back to the front page, in one page load. The code for adding the item lives in the item page, not in the front page or an intermediate page. I like the idea of putting the code for an action as close as possible to the button which activates it. The code lives with the link, not with the destination. (One problem, though, is that the final URL of the link is not the same as the URL for the page you end up at, but if it’s coded correctly, this shouldn’t be too much of a problem, since using the generated link later on should be able to deliver you to the right page without unwanted side-effects. The key’s in the session management.)

You could use it for all kinds of things, but most notably for the kinds of actions that usually require forms rather than links. It’s not exactly revolutionary but, as I say, I haven’t seen it anywhere else and it’s a really nice feature to have. Any system with decent session management should be able to handle it.

Interchange has a bunch of other lovely features too that are applicable to all kinds of web apps, not just shopping, but the interface orients it totally towards e-commerce. Perhaps it might be worth hacking around with to turn it into a generic web app kit?


Comments are closed.

Archive

The complete list of posts lives here.

yoz's bookmarks

  • How we use Redis at Bump - Bump Dev Blog 2011/07/16
    How Redis became Bump's Swiss Army Knife to solve all kinds of data-related problems
  • Heroku | The New Heroku (Part 4 of 4): Erosion-resistance & Explicit Contracts 2011/06/29
    Fascinating description of how Heroku's recent changes are aimed at killing software erosion (or what I think of as "bitrot").
  • What are the most interesting HTML/JS/DOM/CSS hacks that most web developers don't know about? - Quora 2011/06/17
    Marvellous collection of JS, CSS & HTML hacks. Did you know you can get the browser to parse a URL or escape HTML for you, with existing JS functions? (via gnat)
  • Avatars In Motion 2011/05/21
    "This blog is to show all the beauty you can find in Second Life." Gorgeous photography of great SL locations. (via Hamlet)
  • Gabe Newell on Valve | Game development | Features by Develop 2011/05/14
    Great, inspirational interview on how they hire and organise.
  • Design @ Quora (Web2.0 Expo Presentat... by Rebekah Cox - Quora 2011/05/03
    "Great design is all the work you don't ask the people who use your products to do."
  • David Kelley on Designing Curious Employees | Fast Company 2011/04/20
    "In this interview, he explains why leaders should seek understanding rather than blind obedience, why it’s better to be a coach and a taskmaster and why you can’t teach leadership with a PowerPoint presentation."
  • GIRP 2011/03/29
    Ingenious, tricky rock-climbing game which ends up being Twister for your keyboard (via infovore)
  • Goodnight Room - Skogkatt - Goodnight Moon - Margaret Wise Brown [Archive of Our Own] 2011/03/15
    "Goodnight Moon" fanfic, in which the room is actually travelling through space, the old lady is actually a stuck hologram, and this is wonderfully creepy yet still heartwarming.
  • Travel Hacks: What are the best travel hacks? - Quora 2011/01/24
    One of those super-compilation questions that shows off Quora at its best. Most tips are for heavy travellers, but some good ones for backpackers and adventurers too.

yoz on twitter

    follow me on Twitter

    Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

    Content licensed under the Creative Commons (Attribution - Share Alike) | Theme based on Clean Room by Columbia, MO Web Design