Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

non-java files in package structure

Tags:

java

We have a developer who is in the habit of committing non-java files (xsd, dtd etc) in the java packages under the src/java folder in our repository. Admittedly, these are relevant files to that package, but I just hate to see non-java files in the src folder.

Is this is a common practice that I should get used to or are we doing something strange by maintaining these files like this?

like image 741
Kapsh Avatar asked May 06 '09 17:05

Kapsh


2 Answers

The problem with putting non Java (or other languages) files that are closely tied to the code in a different place than the code is knowing where to find them. It is possible to standardize the locations then theoretically everyone will know where to go and what to do. But I find in practice that does not happen.

Imagine your app still being maintained 5 or 10 years down the road by a team of junior - intermediate developers that do not work at the company now and will never talk to anyone who works on your project now. Putting files closely linked to the source in the source package structure could make their lives easier.

I am a big proponent of eliminating as many ambiguities as possible within reason.

like image 169
nash Avatar answered Sep 21 '22 14:09

nash


It's very common and even recommended as long as its justifiable. Generally it's justifiable when it's a static resource (DTD+XSLT for proprietary formats, premade scripts etc.) but it's not when the file is something that's likely to be updated by a third party like IP/geographic location database dump.

like image 41
Esko Avatar answered Sep 17 '22 14:09

Esko