Thanks Walter ~ Comments interspersed below.
On Sunday, June 7, 2015 at 11:38:12 AM UTC-4, Walter Lee Davis wrote: > I don't know of any within the true meaning of "generator" that do all > that you have outlined here. But there are systems that ape the Django > admin view (RailsAdmin etc) that introspect your database and build an > interface to modify it on the fly. This is similar to how the Scaffold > system in Rails worked in versions less than 1 (and maybe a few minors > after 1). The problem with these systems that I have encountered is that > they have a well-formed opinion of how any type of field should be > represented, and in what order, and they build you an 80% solution in no > time at all. If you're happy with what they give you, then you're > completely set. But if you want something even a little bit off the tracks > they've laid, then you have a whole world of work to fake them into giving > it to you. > I have some experience with Django, and it fits with what you're saying. I'm pretty sure that Rails is ahead of Django in its ability to to the kind of generation/synchronization I'm looking for. For example, as far as I know, Django's schema-to-model generator (inspectdb) generates only models (not controllers or views); and it can only "introspect" the whole DB and generate models for all of its tables (as opposed to Rails where you can run the generators table-by-table). BTW if any Django experts are listening in and I have sold Django short, please steer me straight. > > One thing you might try is after you've made significant changes, try > making a new stunt-double app with the generator, with the new version of > your schema. Then copy the relevant files over to your actual working app. > You'll be able to cherry-pick which parts of the new code make sense, so > you don't have the generator overwrite something you spent time > customizing. > Good idea. Could use a "file compare and merge" tool to do the synthesis. Another thing that's emerging from this discussion is the interaction between a platform's generator abilities and the optimal design of the apps that you build with it. There's a lot to be gained if the objects it generates are "good enough" for your purposes, even if they aren't exactly what you would create if starting from a blank slate, because you can the time and effort saved to writing custom code where it really matters or simply to getting done earlier. (For example, I hear that the generated Django "admin interface" was inspired by the fact that Django's original purpose was to build online newspapers. The data-entry people were basically the paper's reporters, who could do fine with plain-vanilla entry forms; the designer/developer creativity could be devoted to the read-only pages, to attract and serve the readers/customers.) So, it's valuable to understand what kinds of automagic your platform can and can't do, and proceed accordingly. ~ Ken > > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2eb5742f-0acf-4f3c-8874-7c1de1c0d19c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.