«« Next » « Previous
«« Next » « Previous

Link Details

You do understand how this works, don't you? Login and vote now.
Link 71396 thumbnail

By pulesen
via fixedformat4j.ancientprogramming.com
Published: Mar 18 2008 / 16:36

Using annotations and annotation processing, to read and write fixed format files to and from Java objects.
  • 13
  • 1
  • 1184
  • 403

Comments

Add your comment
User 60056 avatar

ed12176 replied ago:

0 votes Vote down Vote up Reply

This library is a typical example of very bad usage of annotation. As soon as you store configuration data within
annotations and therefore within the source code you completly wreaks your code. Configuration data has to reside outside of the source code.
,

User 188795 avatar

villane replied ago:

0 votes Vote down Vote up Reply

I took a glance and couldn't see how it was configuration.

User 52357 avatar

pulesen replied ago:

1 votes Vote down Vote up Reply

In my opinion, it is not configuration at all. It would more be input/output for the application. One example is when it (the application) writes a fixed-format file to some external system. Then, it is an integral part of the application, and not something that you reconfigure.

User 229513 avatar

jeyben replied ago:

0 votes Vote down Vote up Reply

I agree that configuration data has to be stored outside the code, but this is not configuration.
The api could be used to help you format text in a way you interchange with at third party application, hence it is a part of your businesslogic and it is not appropriate to move that into configuration.

I do not see the big difference between using these fixedformat annotations and ex. JPA annotations.

User 60056 avatar

ed12176 replied ago:

0 votes Vote down Vote up Reply

Obvioulsy, it depends on what you think configuration is. IMHO, the offset and the length variables have to be considered as configuration values because they are likely to change depending on external factors. Therefore some users would prefer to be able to store them in a configuration file. And that's not possible if you use annotations.

User 193149 avatar

p3t0r replied ago:

0 votes Vote down Vote up Reply

@ed12176 fixed formats are a thing from the past. Things from the past don't tend to change much. When you're telling me you need flexibility AND working on a new system you might consider using something like XML, YAML, JSON or even CSV.

User 60056 avatar

ed12176 replied ago:

1 votes Vote down Vote up Reply

You may be surprised on how many things from the past survive in financial institutions ;-)

But the real problem remains: why using annotations when you could write plain java classes and offer more flexibilty to your users? ATM annotations seem to be the cool new thing to use and, unfortunately, they tend to be overused. It's a pity because there are so many possible good uses for them. In the context of this library, I don't see any avantages - but a big drawback - for using annotation over plain java classes.

About this problem, there is an interesting blog http://willcode4beer.blogspot.com/2007/12/annotations-good-bad-and-ugly.html

User 229513 avatar

jeyben replied ago:

0 votes Vote down Vote up Reply

The crux of the matter seems to be that we doesn't seem to agree on this being configuration.
But ed12176, could you explain a bit more on how you could see this implemented without those annotations? It would be nice if it doesn't involve xml hell.

User 229513 avatar

jeyben replied ago:

0 votes Vote down Vote up Reply

I have finally released a version of this api. Soon it will be available from ibiblio. In the mean time feel free to download the latest stable release from the download list: http://code.google.com/p/fixedformat4j/downloads/list. At the current time of writing that will be version 1.1.1.
All comments and/or contributions are appreciated.

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.