← Back to context

Comment by gngeal

13 years ago

It's not just the form generation. I've given some thought to how one might work with a MVCC/MGA system such as the one you have in PostgreSQL and Firebird to make an interactive system with tabular display that would keep the beneficial properties of these transactional architectures (optimistic concurrency) and still work the way that people expect from "business apps with data grids". Among other things, this implies data edit conflict resolution etc. The problem is that even if the way of going about this is straightforward, I'd never, ever want to write this even twice. Not just because it's extra work, simply because generating the updating transaction in the manner recommended by the designers of these RDBMS systems (a snapshot transaction to populate the UI and a read-committed transaction to post the edits) is error-prone.

Also, why would an extra layer of 'meta' make it harder to debug and decrease flexibility? I would have thought that it would enforce more structure by centralizing certain functionality, thus making it correct-by-design instead of relying that you'll follow conventions in multiple places consistently, and increase flexibility by separating aspects that you'd otherwise have to "weave-in" throughout the code and later change in multiple places.

> I've given some thought to how one might work with a MVCC/MGA system ...

Yes, it's an interesting problem. That's exactly what makes it fly paper ;)

Less flexible: suppose your framework is doing dynamic form generation on top of wxPython. You could have a date picker as a radio box item if you wanted. However it would probably not a be a good use of time to support that in your MDA system.

Harder to debug: Usually, bugs in the auto-form-generation infrastructure are "trickier" than the bugs you would get if you just wrote the forms.

A lot of the use cases for dynamic form generation are adequately served by automatic scaffolding in django/rails/turbogears or on the enterprisey side, technologies like Oracle forms and its successors.

  • I'd consider it easier to debug a piece of meta-code as long as the language wasn't too hostile to it, than multiple sections of similar code that need to be scanned manually to keep in sync.

    And for those corner cases, code them as one-offs but within the templating system, and keep the benefits of any logging etc from the system.

I think you're missing the forest for the trees. The lesson is just: don't spend the time to generalize something unless doing so will save you time and effort. You'll have to use a lot of judgement to determine where the crossover points are.