Link Details

Step 1: Login - Step 2: Vote! Login and vote now.
Link 85897 thumbnail
User 283959 avatar

By fcoury
via felipecoury.wordpress.com
Published: Jun 08 2008 / 10:43

It’s almost certain every Java programmer out there have had to deal with handling of delimited of fixed length flat files at one moment of his career. I have just created a library that makes it easier to work with that: JFileHelpers. Check it out!
  • 15
  • 1
  • 2045
  • 737

Comments

Add your comment
User 270877 avatar

killerweb replied ago:

0 votes Vote down Vote up Reply

So I guess now every single new library will include Annotations as part of the solution. Let me ask you think it's smart to include your metadata right into your classes for parsing. Think about that for a minute. You add @DelimitedRecord("|") to your class. Now you want to use the same class but it uses a comma to parse.... hmmmm don't think so.

User 283959 avatar

fcoury replied ago:

0 votes Vote down Vote up Reply

killerweb, you are probably right. That's why we are adding support for XML descriptors as well. Instead of being so negative about the library, which I think have it's merits, why don't you enter the forum: http://forum.jfilehelpers.com and make your suggestions? We need and embrace criticism as part of the precess to achieve a better library. Thanks!

User 270877 avatar

killerweb replied ago:

0 votes Vote down Vote up Reply

Well that's what the comment system is for. If i said it in http://forum.jfilehelpers.com, no one here would have seen it. It's not about being negative it's about critiquing and you should use critiques where ever you might find them. My critique was more about Annotations then just your library, but your library made for a good example of why Annotation as a solution can be over used.

User 229513 avatar

jeyben replied ago:

0 votes Vote down Vote up Reply

I have created a smaller but in some case similar framework - http://fixedformat4j.ancientprogramming.com - where most of the ideas originate from a project I currently work on. This framework uses annotations as well.
The reason why we use flatfiles in the first place is because we have to integrate with some legacy application. The flatfile format will not change as the entire application is build around the data to be formatted exactly as it is.
In this case I think of the length/offset etc. as part of my domain and I prefer to have this data close to the code and not in a configuration file.
Hence I believe annotations earned its right somewhere here.

But if you have to be able to switch ex. delimiter as your example demonstrates a configuration file would probably be the right thing.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.