I had the same goals and am running a project using generate-all to
keep up with domain changes.
To prevent the custom pages being overwritten I manually added
'Detailed to the customised Controller and View folder names.
See the Grails section here:
and the code here: http://www.gnumims.org/trac/browser/trunk/grails-app/controllers
This allowed me to change the domain, generate-all and view the diff to
To be honest in the long run this strategy was a pain and I would not
do it again.
- It created lots of longer variable names and editing.
- Was slow since I kept running generate-all on several domain classes.
- The actual live controllers are the 'Detailed ones.
(it may be possible to reverse this by editing where the templates
generate to but I have not tried.)
- Wasted memory since I doubled up on almost all controllers and views
(I'm pruning out the generated ones to lighten).
- The intent was to use the generate-all views as admin views and this
worked for a while but I
would use db edit tools in future and save on the running server
memory. For anything more complex custom
admin features are required anyways.
- Does not promote best practise since the controllers are not Service
I found myself designing the navigation and work flow in a page by
Generate-all is a good way to get started, see simple domain classes
saved to a real db and get the basics of gsp+controllers.
Once you know these basics you are going to be much better off writing
the front end from scratch using templates for better
re-use and learning jQuery or perhaps ZK or GWT for faster dev
As for VCS I'm still using SVN in this project and have always liked it
but recommend Git.
On 08/08/11 13:33, Rob Manthey wrote:
Also what's the common recommendation for a best-fit code versioning package for IntelliJ/Grails? I only know CVS, so its a learning curve with either of the others, and there is no standard CV established here yet. Preferably it should also be fit for connecting to eclipse and C++/Python/MSDosBasic code, which are used here as well.
On 08/08/2011, at 1:27 PM, RM wrote:
I'm prototyping a web app in Grails, building up the domain model as I go in consultation with the business owner.
What is the best-practice way to write custom gsps and controllers alongside the Grails generate-all output, so that my customisations don't get blown away each time I add to my domain model? I still want to generate the crud pages in full as I'm going along, at this point at least.
At present I have added two custom gsps and keep injecting some code scraps back into the generated files to connect them, and I've tweaked the entry page.
Welcome to just point me back to Paul's book or a well-known tut if the answer is already there.
Thanks in advance.
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Rob Manthey ([address removed]) from Queensland JVM Group.
To learn more about Rob Manthey, visit his/her member profile: http://www.meetup.com/qldjvm/members/9438934/
To unsubscribe or to update your mailing list settings, click here: http://www.meetup.com/qldjvm/settings/
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]