By Peter Bell

Proposed New Years Resolution: Generate Your Code

Code re-use has been the holy grail of software development for decades, but I think 2007/2008 are going to be break out years for improving programmer productivity – mainly due to better concepts rather than improved tooling . . .

I recently delivered an article to Judith for FAQU 3 (you have subscribed - right?!) about Software Product Lines. In short, if you are responsible for writing more than one web applications there are typically commonalities between those applications. By describing and designing software to support those variabilities you can generate projects in a fraction of the time that it would take to code them by hand.

If you are responsible for building/maintaining more than a single web application and don’t know what a Software Product Line or a Domain Specific Language is, 2007 is the year to find out. I’ll try to provide a full set of articles and tools for everything from capturing requirements using Intent Driven Design (CFDJ November) to architecting DSLs (FAQU 2 article) and developing Software Product Lines (FAQU 3). I’ll also be upgrading CF Template so the process of generating code should be simpler for CF developers who don’t want to learn XSLT. So really, there will be no excuse :->

Oh, and if you want to get the skinny on all of this in person, registration is still open for the Frameworks conference in DC on February 1st/2nd where I'll be presenting on all of this. Use code FR0788009 to save $50 off the registration fee. Anyone coming to the conference? Drop me a comment below!

Comments
Hi Peter

Happy New Year!

Enjoyed all of your stuff this year - great, thought provoking blog.

I was just thinking that the debate about code generation has resonances with the "buy don't build' paradigm of the last couple of decades. As someone who came through these times in enterprise IT I saw my stance change from embracing the "buy" point of view to eventually ditching it in favour of "domain" specific built solutions. Why? Enterprise IT projects are in my view the most complex engineering projects ever seen on the planet. IT organisations are ever more complex and the out-of-the-box solution doesn't work any more with as much effort involved in maintaining and customising one-size-fits-all as developing and maintaining application (domain) specific solutions.

What are your thoughts about this with regard to application generation? (I'm obviously looking at this as the modern equivalent of "buy-dont-build")

All the best

Richard
# Posted By Richard Tugwell | 1/2/07 1:01 PM
Hi Richard,

Thanks for the comment, and glad you're enjoying! Buy vs. build has always been one of those big debates. I theoretically prefer to buy (or even better use open source) instead of building, but I have been burnt so many times with solutions that wouldn't quite do what I wanted (everything from packaged apps to dev environments to frameworks) that I eventually decided to build anything critical to my business, only outsourcing (buy, OSS or third party custom dev) anything that isn't critical to my business.

Not sure exactly how you're comparing app gen to buy vs. build. Would you mind clarifying as whatever way you are asking it, it's an interesting question!
# Posted By Peter Bell | 1/2/07 1:16 PM
Well,it seems to me that application generation must have a generic aspect to it. Not in the same way that buying an HR package does, but by trying to anticipate a broad range of user requirements, application generation might fall into the same "jack-of-all-trades-master-of-none" category, after which the desire to tweak and customise leads down the same road. Otherwise it becomes a front end to a database /e-commerce, community sites etc) in which case it's not far offan out of the box solution.

I'm in favour of modular packages where the mix and match can replace customisation, but necessarily in my point of view, the modularisation occurs at a low level of functionality
# Posted By Richard Tugwell | 1/2/07 1:57 PM
It is a really good question. In my experience the value of an app generator is directly linked to the elegance of the Domain Specific Languages you create. I have found that very different applications can still share similar requirements that can be captured and generated. Broadly there are two approaches. One is functional specific where you look at classes of variability in your e-commerce shopping carts or newsletters and write DSL's to capture those variabilities. This works quite well, but will only take you so far. The other approach which I have been working on simultaneously is to develop DSL's that are higher levels of expression of programming intent. Examples would be the ColdSpring and MG XML files both of which allow you to describe programming intent at a higher, more abstract level than by wiring your components or controllers using a general purpose scripting language directly.

All of this aside, it is still important to create extension mechanisms such as using inheritance of generated base classes with custom subclasses to easily allow for round tripping. I have also engineered some other important extension points into SystemsForge (our in-house generator I'm upgrading).

My short answer is that for anyone creating a fairly large number of custom web applications (lets say more then 3-4 a year) with variability too great to simply implement as a packaged product with property:value attributes, an application generation approach will yield close to order of magnitude savings in the coding, debugging and maintenance phases and potentially similar savings in the quotation and specification phase if they are capable of architecting a software product line and engineering in the majority of the required variability between applications.

The Software Product Line approach will be tough for smaller or less capable shops, but the programming savings using LightBase (when it is released OSS) should be achievable by all. I have read and quoted Fred Brookes "No Silver Bullet" a number of times, but Software Product Lines are no more a silver bullet than being able to generate a Yahoo Stores! shopping cart in minutes - it is simply a different way of creating applications and I really think we're going to see a quantum shift in how the majority of web applications (by volume - not dollar amount) are created over the next 2-3 years. Interesting times.
# Posted By Peter Bell | 1/2/07 2:11 PM
Hmm, maybe. But Peter we are developing many applications that have nothing to do with shopping carts or newsletters, Things like messaging(Email) or newsletter and digest functionality are a given for these, but may be plugged in and are reusable from other stuff we've written (aided by frameworks such as FB of course), but the application drivers are much more diverse than the generic web applications that you suggest. Now it could be that 99% of the business of application generation is driven by just such applications, so that is why I'm linking it with the package/buy vs build scenario.

Guy comes to you and says we want e-commerce site to sell widgets - fine, Guy wants portal site or community site for widget-weenies - fine. Guy wants pangalacticgargleblaster site - whoaaaa wait a minute. So you see my point is how many pangalacicgargleblasters are there out there? If the answer is only x(you choose)% - then app generation is fine. Otherwise better go build (using appropriate architecture designed for speedy re-use)
# Posted By Richard Tugwell | 1/2/07 2:27 PM
Depends! With the first (functional) SPL approach, you're right, unless you build a bunch of pangalacicgargleblasters you're outa luck. But here is my question . . . is a PGGB REALLY that different from an email newsletter, portal, job application management system or workflow application? Most have users, roles, security, authentication and maybe auditing/versionsing. All probably have UI templates including lists, views and maybe import/export/approve/delete screens. All of them have objects that need wired together and controllers that need to be implemented. We've developed a pretty decent methodology and set of tools for specifying ANY web app in terms of screens, steps, actions, etc. and then generating the vast majority of the functionality required. Right now we're working on everything from simple e-commerce to a site allowing physical fitness trainers to design exercise programs online and a generation tool for 200 loosely interrelated international sites. There is a level of abstraction higher than ColdFusion but lower that "what kind of shipping rules do you need" and there is a lot of potential for generation at that level as well.

Like most of what I'm doing, no doubt it'll make more sense when I ship code!
# Posted By Peter Bell | 1/2/07 2:34 PM
Sure I agree - all our applications use common stuff - encapsulated in ruesable code that we can drop in wherever, but these do not define the application. It's main functional drivers are virtually always unique.

Anyway, let's draw a line under an interesting discussion - I feel a nightcap coming on

Cheers

Richard
# Posted By Richard Tugwell | 1/2/07 2:49 PM
Hi Richard,

Agreed. As with all debates, the answers will be obvious as sufficient time goes by. I'm over in the UK right now and I'm already two nightcaps into the evening, so probably a good time to stop!
# Posted By Peter Bell | 1/2/07 3:01 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.