Tuesday, 13 October 2015

Blast from the past with MVC

By chance I met an ex-colleague the other day. I had spent a few months at the beginning of the century consulting with his company creating a framework for a Health and Safety system. He reminded me that the company was still going strong but that every developer after me had raised an eyebrow or made a few remarks about that framework. I'm not surprised really.

You have to remember that this was the era of the dot com bubble and bust. Technology to deliver the product vision of many founders was in its infancy, costly and immature. What stands out for me thinking back, was that I was probably ahead of my time without really knowing it!

Leading each technology in the early 2000's was Visual Basic, ADO and ASP. Oh, and don't forget liberal use of COM and ActiveX objects. What I proposed back then was a little revolutionary. The idea was simply to use XSLT to render the display rather than the ASP page. We would create a data access layer (DAL) which retrieved all the necessary model information as XML. This XML was passed to the compiled XSLT which rendered HTML. The ASP page now became the controller. Gone was the horrible ASP syntax embedded with for loops and global variables. Form post back was also handled by the ASP page which validated and passed it on to the DAL.

If you'd come from a traditional ASP development environment you would wonder what was going on. If you had one of today's developers read the code, they would probably understand many of the constructs. Today we would probably call this framework MVC, back at the beginning of the century that acronym didn't exist - well not that I can remember.

I read widely, I synthesised ideas, I put some together and it kind of worked. It was like that back then. Nobody was really definitive about best practice - it was the dom com boom and bust. I'm happy it didn't bust.

1 comment:

  1. > ... back at the beginning of the century that acronym didn't exist - well not that I can remember....

    You might want to read ModelViewControllerHistory. SmallTalk-80 and more notably NeXTStep made use of MVC which was first developed at XEROX-PARC in 1979. It was invented by Trygve Reenskaug. By the late '90s, "MVC" was a programming paradigm that some, but not many, had adopted to bring some sanity to their app code (regardless of whether is was for stand-alone or Web apps). You seem to have been among that growing minority. (Lots of programmers end up adopting useful, recognized patterns, quite often unconsciously, by trial and error and insight. Most don't even realize that they have "re-invented" a pattern on their own. And then again, lots never stumble into them.)

    Whatever became of NeXTStep?

    In Web development, WebObjects (NeXT, then Apple) was a good bit ahead of the ASP tools you mention with respect to "MVC". (A history can be found here: WebObjects). It got steamrolled in the marketplace because it was expensive initially (eventually free under Apple), but framework authors in both the Microsoft and Java spheres acknowledged (more often privately than publicly) that it had important influence on their work. (The same applies to a number of GUI frameworks -- e.g., Borland's Delphi.)

    Finally, there were plenty of us in the Java world who were approaching Web and stand-alone app development using "MVC" and other patterns by the late '90s, early 2000s. Some of us were pleading back then for Sun to adopt NeXT's approach of separating views in JFC/Swing into something like NIBs and developing a graphical programming tool equivalent to Interface Builder, with the aim of making it really difficult for programmers to mix controller code in the view. Fast (or was it plod) forward to JavaFX 2 and Scene Builder in 2012 -- finally! (Recently, Oracle has jettisoned Scene Builder development. So much for progress. Fortunately, GluonHQ has taken up development at Scene Builder.)

    I first encountered MVC in 1989 when the Purdue physics department installed several labs of NeXT cubes and held workshops on NeXTStep programming. I had to laugh (quietly to myself) when 20 years later, a somewhat younger colleague went prattling on and on about how we had to "use MVC, use MVC!" Okay. I'm not sure what he thought the rest of us were doing, but for him it was obviously a revelation.

    ReplyDelete