|
[]
Re: Where to put config files?
[
tirsen
]
Dion is writing about where to put config files. I always try to make it possible to do as much work as possible without leaving the IDE. For example, I have something I call "standalone mode" where I create a simple StandaloneServer class with a simple main method which uses the Jetty API to start up the server directly inside the IDE. For this reason I always keep my config files around in such a way so that "standalone mode" works without requiring the use of a build script. That is I "Mimic The Deployment Structure". In this mode I try to stub out high-end J2EE services (not available in plain vanilla Jetty) such as JTA, JNDI, JAAS and so forth. Using Spring Framework this is easily done. I also try to stub out backend services that we don't have reliable connectivity to. The released app is usually deployed to a real appserver where JTA would take care of committing transactions and JNDI would be used to look up pooled DataSources. Therefor I have a build script that converts the standalone mode deployment structure into a deployed production mode ear file, tweaking config files and so forth to make it behave well in a real appserver. Doing it this way you can have the best of both worlds. You get high productivity in development because you don't need to do a full compile-build-redeploy-cycle every time you've done a change (restarting Jetty takes about 3 seconds), in fact you should never need to leave the IDE to execute build scripts during normal development. You also get an app that is a good J2EE citizen, demarcating transactions with JTA, using JNDI for DataSources and so forth. It really does wonders for productivity! You can just directly execute the main() method for the Resin startup class and pass it command line arguments to point it to the config file, etc. Very productive. I'm surprised to see you're using Spring. You didn't drink the Picocontainer kool-aid? --Jason Carreira, November 25, 2004 03:10 AM
Post a comment
|