Grails design for domain class initialization from static data

Posted by Allison Eer on Stack Overflow See other posts from Stack Overflow or by Allison Eer
Published on 2012-12-18T16:52:28Z Indexed on 2012/12/18 17:03 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about design

Related posts about grails