Dialog Framework

Any SketchUp plugin that uses WebDialogs in a serious way will require substantial amounts of HTML, CSS, and JavaScript code. There are also some capabilities (eg, browser-based dialogs) which SketchUp's WebDialog class does not provide. The Dialog Framework (DF), inspired by web application frameworks such as Ruby on Rails, addresses these issues.

Looking for a way to keep my code under control, I realized that I could adopt some of the approaches taken by the Ruby on Rails (RoR) framework, including:

  • Convention over configuration (eg, _head.html.erb, main.css.erb)

  • Don't Repeat Yourself (DRY)

  • Metaprogramming (eg, dynamic creation of HTML, JavaScript, classes)

  • Views and templates (eg, ERb, partials)

At the same time, DF leans heavily on jQuery and jQuery UI and uses Ruby callbacks for many activities that could (in an Ajax-style implementation) be handled by JavaScript code. So, although DF is reminiscent of RoR, it is also quite different.

Note: Although DF is functional, there are parts of it (eg, code generation, callback handling) that seem a bit awkward. So, I am investigating a variety of notions. In particular, some advanced JavaScript frameworks (eg, AngularJS, Backbone.js, Ember.js) look quite interesting.


The pages listed below provide background and/or detailed information, including annotated copies of some of the supporting code. Please let me know if I've left out anything critical...

This wiki page is maintained by Rich Morin, an independent consultant specializing in software design, development, and documentation. Please feel free to email comments, inquiries, suggestions, etc!

Topic revision: r24 - 06 Jul 2012, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email