uqbar-project / arena

MMVC framework
http://arena.uqbar-project.org/
4 stars 2 forks source link

Add the concept of Bootstrap/Seed/Fixture end environments #15

Closed flbulgarelli closed 8 years ago

flbulgarelli commented 10 years ago

Arena sample applications we deliver tend to have test data initialization code as part of the repositories or even views. This is a bad practice, since it couples the data set - which is envirment dependent e.g. production and development - to the views or repositories, making them impossible to use in diferent environment wihout modification to code.

It would be nice that Arena had some kind of bootstrap interface - essentially, a runnable - that could be passed to an Arena Application init code, ensuring it is executed before the app starts, similar to Rails seeds or Grails Bootstraps. That way we would discourage the previously mentioned bad practice.

flbulgarelli commented 10 years ago

The interface could look like the following:

interface Bootstrap {
  abstract void run()
  abstract boolean isPending() //in order to know whethere the boot must be run or not.  
}