Thursday, February 23, 2006

Configuring Subversion with Netbeans

Configure Subversion with Netbeans

Step 1: Download Subversion profile from site http://vcsgeneric.netbeans.org/profiles/index.html
I configured it with Netbeans 4.1. The site also have profiles for other version of netbeans.

Step 2: Open Netbeans

Step 3: Click on Tools --> Update Center

Step 4: Select Install Manually downloaded Modules (.nbm Files)

Step 5: Click on Add and select the file that you downloaded. Finish the Wizard

Step 6: Click on Versioning --> Versioning Manager. In this popup add the working directory of the project and repository URL for Subversion. For instance I added c:\projects\projectname\src and repository as file:////svn ( mapped to c:\svn, if working on windows environment)

Step 7: Done. Now you can right click the project and view the files and status for the same.

Tuesday, February 21, 2006

Properties file or XML File

While working on Java Projects we usually come to question whether to use properties file or to use XML files for reading configuration information.

Before we consider what solution should be used, first let's see what kind of the configuration data is involved.

Configuration data are range from simpler items like server urls, schema name, database environment, mailing servers, etc. This kind of data can be classified as name=value pair. No relationship or hierarchy exist between them.

The other cases of configuration data that might be used within project contains relationship within data elements. One of the example of such data is struts-config.xml. For this kind of data they will be more or less stored as Java Objects.

Once we made the classification decision is simple.

Use properties file for configuration data which is flat in nature. Data elements does not contain any relationship or hierarchy. Using XML file to store will involve parsing overhead without any significant advantage.

XML file usage is justified only when we are going to create Java Objects out of config data elements having relationship between them.

One of the pitfalls using XML file to store config file is to go on overkill and start integrating logic in XML tags. Make sure that it is only config data and you are not actually programming in XML.