The Artima Developer Community
Sponsored Link

Java Buzz Forum
Starting a new project: Where to put config files?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Starting a new project: Where to put config files? Posted: Nov 24, 2004 12:20 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Starting a new project: Where to put config files?
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement
Whenever I am with a new project team, one of the early questions arise around the issue of "where to put stuff". With typical J2EE projects you end up with various config files that AT DEPLOMENT want to be in different places. For example: WEB-INF: At the root you will have a web.xml, and other beasts such as sitemesh.xml WEB-INF/classes: This covers the "has to be in the classpath" issue. Here you will often find an applicationContext.xml, log4j.xml, message bundles, and more. META-INF: Here you will have some EJB-ish stuff (if you are using EJB ;) Spread out: Your Hibernate .xml files may be in various locations, etc I normally run across two styles on how to handle this: One Place For Dev. Then Build To The Right Place In this mode, there is a /src/config, or something like it, which has ALL of the XML, and properties files. This makes things very simple to find when you need to get to a config file, as you don't find yourself hunting around in all of the various places that it could be. The responsibility of putting these files in the correct places falls on the build master. In your source control you don't even HAVE a WEB-INF directory. The build creates this and sets it all up for you on the fly. The problem is that if you are debugging, you often find yourself "checking out what is on the deployed server". Here there is no longer a nice config directory, and you are slower at finding the files as you don't really know where they are meant to go. Mimic The Deployment Structure In this scenario you simply mimic the end structure. You cringe when you check-in a directory called WEB-INF/classes to source control, which has config files that need to be in the classpath. Although the files are spread out all over the shop, they do mimic the Real World, and hence you can find things quickly in that world. A Bit Of Both The scary scenario is when you see projects that do a bit of both. At this point you don't have a clue where anything is :) Smart Folder Maybe you can get a bit of the best of both worlds if you had a Smart Folder. Then, the config directory could aggregate the config files from everywhere else, but they would just be symlinks. WinFS can make this easy. On *NIX you can just have a script which generates the symlinks for you!

Read: Starting a new project: Where to put config files?

Topic: ClientJava.com Links(12) - Swing MVC Examples, InfoNode Docking 1.2 Released, Hiding JTable Columns Previous Topic   Next Topic Topic: Tapestry by Example with Erik Hatcher

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use