Grails design for domain class initialization from static data
- by Allison Eer
I have some data, stateNames, to instantiate an instance of the object Country. Right now, I will only have one Country but stateNames for each country should be different. What is the best way to instantiate the instance of Country with my data? I am new to grails and would appreciate any "best practices" or common designs.
One solution I can think of is to use BootStrap to save the unitedStates instance of Country to the database. What are the cons of this approach?
Another solution would be to save the data in a file (in xml?) under web-app folder. If I did this approach, should the unitedStates instance of Country be instantiated by a controller?