Alexander et al’s Architecture Patterns

Architecture, Patterns, Town Planning

Any book on patterns must include the obligatory Christopher Alexander discussion. In my case, it’s brief, for the following reason:

One side benefit of this project has been to see how “patterns” are being accepted by the development community. The attention on the Ajax Patterns has always been on the “Ajax” and not the “Patterns”. This is a good thing and a welcome change from the late ’90s, when you not only had to explain what a pattern is, but also justify its existence. “Ajax” itself is a kind of pattern, one whose popularity is further evidence for the power of “just a name”. For these reasons, I’ll keep this section brief.

It’s brief, but it’s still there. The original book’s worth looking at in order to “get” patterns and pattern languages (as is the companion work, “The Timeless Way of Building”). Here are the best online references:

If you know something about these, you might want to mention it on wikipedia, current info on A Pattern Language is wanting.

Alexander et al’s Architecture Patterns

Architecture, Patterns, Town Planning

Any book on patterns must include the obligatory Christopher Alexander discussion. In my case, it’s brief, for the following reason:

One side benefit of this project has been to see how “patterns” are being accepted by the development community. The attention on the Ajax Patterns has always been on the “Ajax” and not the “Patterns”. This is a good thing and a welcome change from the late ’90s, when you not only had to explain what a pattern is, but also justify its existence. “Ajax” itself is a kind of pattern, one whose popularity is further evidence for the power of “just a name”. For these reasons, I’ll keep this section brief.

It’s brief, but it’s still there. The original book’s worth looking at in order to “get” patterns and pattern languages (as is the companion work, “The Timeless Way of Building”). Here are the best online references:

If you know something about these, you might want to mention it on wikipedia, current info on A Pattern Language is wanting.

“Proving” a Technology

… a blog entry in which I define the term “proving”. I’m defining it here because I needed to link to a definition and couldn’t find a suitable URL to point to.

A few years ago, we were in a meeting when an architect explained to the project manager “we’ll be spending the first few weeks of the project proving the technology”. The manager was a taken aback. He took a deep breath and pointed out that the project was already committed to the technology – J2EE Web etc – and that the project sponsors would be a smidgen disappointed to learn that the underlying technology was “unproven”. Really, everyone was committed to the technology, but it was clear that no-one in the room (me included) had a solid understanding of “prove”.

What does it mean “to prove the framework” or to “prove the MVC architecture”? Are you proving these things exist? Checking if they’re feasible? Are you offering a mathematical proof that it’s the be-all and end-all? Here’s one definition:

  1. To establish the truth or validity of by presentation of argument or evidence.
  2. Law. To establish the authenticity of (a will).
  3. To determine the quality of by testing; try out.
  4. Mathematics. To demonstrate the validity of (a hypothesis or proposition). To verify (the result of a calculation).
  5. Printing. To make a sample impression of (type).
  6. Archaic. To find out or learn (something) through experience.

The third and sixth definitions say it best. Proving a technology means bashing it around to see what works and what doesn’t. According to The Straight Dope, it derives from a medieval term, Exceptio probat regulam, which is where you get seemingly paradoxical expressions like “the exception that proves the rule”, “proving ground”, and “the proof of the pudding”. However, said article also refutes that theory completely! In any event, it’s certainly a useful way to explain the usage in a software context.

Definitions – and arguments about them – are rather boring. This post is not here to prove a point (sorry), but to lend significance to an idea. Proving technology early on is a smart strategy for reducing risks later on. It’s really the idea behind the XP notion of “spiking” and also a key jusitifcation for the more traditional idea of throwaway prototypes; prototypes can be used to prove technology, not just for user acceptance.

AjaxPatterns Tutorial: Demos are Online

Here’s a heads-up on the tutorial to be included with “Ajax Design Patterns”. I’ll let you know when the tutorial text is available, but for now, the demos are running:

Demos for the AjaxPatterns Tutorial

The first half is a fairly standard intro to Ajax, using the Foundational Technologies patterns (Display Manipulation, Web Remoting, Dynamic Behaviour).

The second half is more interesting, as it documents the Ajaxification of Ajaxagram, an anagram finder (finds all combinations of a word, no dictionary used so as to keep the business logic simple). It begins as a conventional web app First, into a basic Ajax version. Then with a number of patterns progressively applied: first, Live Search, Progress Indicator, and One-Second Spotlight (Yellow Fade Technique) (about 3 lines, 8 lines, and 3 lines of code respectively). Followed by Submission Throttling. And finally, I want to state loudly that most of the patterns don’t have to be implemented by hand, thanks to the many great Ajax libraries and frameworks available. For that reason, the final refactoring is not about one particular pattern, but is instead about introducing a library. In this case, the AjaxPatterns library.

Following the Ajaxification, I’ll give some suggestions for further enhancements and refactorings. Some people like to learn by hacking an existing app rather than building it from scratch. Taking the code base established in the final version of Ajaxagram, it should be easy to play around with many of the Ajax patterns. For example, use an XML Message instead of the custom-format Plain-Text Message that’s used. Or try a different visual effect in place of the Yellow-Fade Technique.

One thing you’ll notice is there’s only five characters due to the exponential nature of anagrams. A nice refactoring would be to use a Virtual Workspace so the anagrams are loaded gradually.