<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: fixedformat4j api - bring on your feedback!</title>
	<atom:link href="http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/</link>
	<description>What I encounter in my software part of life is in danger of being commented upon here</description>
	<pubDate>Thu, 11 Mar 2010 18:13:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Shakir Gusaroff</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-42</link>
		<dc:creator>Shakir Gusaroff</dc:creator>
		<pubDate>Fri, 30 May 2008 14:58:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-42</guid>
		<description>Hey jeyben, I have got the following run time exception when I run your tutorial:



C:\Documents and Settings\gusaros\Desktop\fixformat&#62;java FixedTesting
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lo
gging/LogFactory
        at com.ancientprogramming.fixedformat4j.format.impl.FixedFormatManagerIm
pl.(FixedFormatManagerImpl.java:48)
        at FixedTesting.main(FixedTesting.java:30)


Thank you.</description>
		<content:encoded><![CDATA[<p>Hey jeyben, I have got the following run time exception when I run your tutorial:</p>
<p>C:\Documents and Settings\gusaros\Desktop\fixformat&gt;java FixedTesting<br />
Exception in thread &#8220;main&#8221; java.lang.NoClassDefFoundError: org/apache/commons/lo<br />
gging/LogFactory<br />
        at com.ancientprogramming.fixedformat4j.format.impl.FixedFormatManagerIm<br />
pl.(FixedFormatManagerImpl.java:48)<br />
        at FixedTesting.main(FixedTesting.java:30)</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ancient Programming &#187; Blog Archive &#187; Fixedformat4j released!</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-40</link>
		<dc:creator>Ancient Programming &#187; Blog Archive &#187; Fixedformat4j released!</dc:creator>
		<pubDate>Sun, 25 May 2008 21:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-40</guid>
		<description>[...] fixedformat4j api - bring on your feedback! [...]</description>
		<content:encoded><![CDATA[<p>[...] fixedformat4j api - bring on your feedback! [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felipe Gonçalves Coury</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-25</link>
		<dc:creator>Felipe Gonçalves Coury</dc:creator>
		<pubDate>Thu, 20 Mar 2008 23:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-25</guid>
		<description>Hey jeyben,

I have a great, working library that does what you intend on doing with your library. Wouldn't you like to join forces instead or splitting in two different ways?

Take a look:
http://tinyurl.com/32cybz

And for code refer the original version, in Portuguese:
http://blog.felipecoury.com/jep/2008/02/java-text-import-export.html

Please e-mail me if you think it's a good idea to join forces.

Best regards,
Felipe Coury.</description>
		<content:encoded><![CDATA[<p>Hey jeyben,</p>
<p>I have a great, working library that does what you intend on doing with your library. Wouldn&#8217;t you like to join forces instead or splitting in two different ways?</p>
<p>Take a look:<br />
<a href="http://tinyurl.com/32cybz" rel="nofollow">http://tinyurl.com/32cybz</a></p>
<p>And for code refer the original version, in Portuguese:<br />
<a href="http://blog.felipecoury.com/jep/2008/02/java-text-import-export.html" rel="nofollow">http://blog.felipecoury.com/jep/2008/02/java-text-import-export.html</a></p>
<p>Please e-mail me if you think it&#8217;s a good idea to join forces.</p>
<p>Best regards,<br />
Felipe Coury.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan O'Connor</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-24</link>
		<dc:creator>Jonathan O'Connor</dc:creator>
		<pubDate>Thu, 20 Mar 2008 11:32:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-24</guid>
		<description>Many years ago I worked on &lt;a href="http://www.jpos.org" rel="nofollow"&gt;jPOS&lt;/a&gt;. This library processes ISO-8583 records. This format has all sorts of interesting ideas. It would be great if your library could parse these types of records. Some ideas:
1. Allow conditional fields. E.g. If field1 has value x, then field 2 exists.
2. Support inheritance ala discriminator fields in JPA. This is a different way to support conditional fields.
3. Your idea of annotating fields is a great idea. How about using the same idea to support reading fixed-column CSV files.

Have fun!</description>
		<content:encoded><![CDATA[<p>Many years ago I worked on <a href="http://www.jpos.org" rel="nofollow">jPOS</a>. This library processes ISO-8583 records. This format has all sorts of interesting ideas. It would be great if your library could parse these types of records. Some ideas:<br />
1. Allow conditional fields. E.g. If field1 has value x, then field 2 exists.<br />
2. Support inheritance ala discriminator fields in JPA. This is a different way to support conditional fields.<br />
3. Your idea of annotating fields is a great idea. How about using the same idea to support reading fixed-column CSV files.</p>
<p>Have fun!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeyben</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-21</link>
		<dc:creator>jeyben</dc:creator>
		<pubDate>Wed, 19 Mar 2008 11:13:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-21</guid>
		<description>Martin: I haven't released a version yet, as the api is to unstable.

Niels came with a bunch of good suggestions on how to change the api and I will go in that direction.

But of course you are free to download the source and compile your own version. Just execute the following svn command:
&lt;code&gt;svn checkout http://fixedformat4j.googlecode.com/svn/trunk/ fixedformat4j-read-only&lt;/code&gt;

The api is tested and works as described on &lt;a href="http://fixedformat4j.ancientprogramming.com" rel="nofollow"&gt;fixedformat4j.ancientprogramming.com&lt;/a&gt;, but keep in mind that the first final version will vary a bit in usage from the current trunk version.</description>
		<content:encoded><![CDATA[<p>Martin: I haven&#8217;t released a version yet, as the api is to unstable.</p>
<p>Niels came with a bunch of good suggestions on how to change the api and I will go in that direction.</p>
<p>But of course you are free to download the source and compile your own version. Just execute the following svn command:<br />
<code>svn checkout <a href="http://fixedformat4j.googlecode.com/svn/trunk/" rel="nofollow">http://fixedformat4j.googlecode.com/svn/trunk/</a> fixedformat4j-read-only</code></p>
<p>The api is tested and works as described on <a href="http://fixedformat4j.ancientprogramming.com" rel="nofollow">fixedformat4j.ancientprogramming.com</a>, but keep in mind that the first final version will vary a bit in usage from the current trunk version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-20</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Wed, 19 Mar 2008 07:53:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-20</guid>
		<description>Where can i download the JAR-File?</description>
		<content:encoded><![CDATA[<p>Where can i download the JAR-File?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeyben</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-18</link>
		<dc:creator>jeyben</dc:creator>
		<pubDate>Tue, 18 Mar 2008 18:44:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-18</guid>
		<description>&lt;strong&gt;Bob&lt;/strong&gt;: Ok, I will include a BigDecimal formatter in the default "ByTypeFormatter", but as I can't be sure how data is prefered to be formatted, I have made it easy to implement your own formatters. Just implement the interface:
&lt;code&gt;
public interface FixedFormatter {
  Object parse(String value, FixedFormatData data) throws FixedFormatException;
  String format(Object value, FixedFormatData data) throws FixedFormatException;
}
&lt;/code&gt;

Ex: on my current project a number like 100.50 is to be formatted like this in string representation: 000010050+, where the signing is prepended.


&lt;strong&gt;Niels&lt;/strong&gt;: I agree with the record implementation dependency and I will remove it.

To fully be able to do what you suggest I have to change the api a bit more. 
Today a record modifies a StringBuffer behind the scenes as you manipulate the data through setters. That gives the user the posibility to hand in a StringBuffer and still hold a reference to an always updated buffer. We took that approach on my current project. That was neat when we had a text file with 50 different records and only had to load in and modify 10 of those before exporting the data. It was easy to export the data as we held a reference to all the stringbuffers, both those modified by record ojects and those we kept unmodifed.

It will not be a bit more hardwork (if not impossible) to keep a reference to an updated stringbuffer in your suggested POJO approach - but I like the idea of being able to export any object. The stringbuffer will suffer probably suffer then :-)
  
My suggestions to api changes:
- To create an "empty" record you just create an instance like any other pojo. That makes it possible to load such objects through, say JPA. 
- Do you want to create one from an existing text you have to go through the RecordManager (former RecordManager) as I dont want to force a interface implementation.
- The same goes for exporting, you have to go through the RecordManager. 

The API will look Something like this:
&lt;code&gt;
//Empty record
MyRecord record = new MyRecord();
&lt;/code&gt;
&lt;code&gt;
//A record instance loaded with text
MyRecord record = RecordManager.create(MyRecord.class, "This is a record foobar   00004200");
&lt;/code&gt;
&lt;code&gt;
//export of record data
String export = RecordManager.export(record);
&lt;/code&gt;

About adding annotations to the setters and getters it is actually possible today as well. I just included the possibility to add those to properties as well, to reduce duplication of annotation data on setter getter pairs.</description>
		<content:encoded><![CDATA[<p><strong>Bob</strong>: Ok, I will include a BigDecimal formatter in the default &#8220;ByTypeFormatter&#8221;, but as I can&#8217;t be sure how data is prefered to be formatted, I have made it easy to implement your own formatters. Just implement the interface:<br />
<code><br />
public interface FixedFormatter {<br />
  Object parse(String value, FixedFormatData data) throws FixedFormatException;<br />
  String format(Object value, FixedFormatData data) throws FixedFormatException;<br />
}<br />
</code></p>
<p>Ex: on my current project a number like 100.50 is to be formatted like this in string representation: 000010050+, where the signing is prepended.</p>
<p><strong>Niels</strong>: I agree with the record implementation dependency and I will remove it.</p>
<p>To fully be able to do what you suggest I have to change the api a bit more.<br />
Today a record modifies a StringBuffer behind the scenes as you manipulate the data through setters. That gives the user the posibility to hand in a StringBuffer and still hold a reference to an always updated buffer. We took that approach on my current project. That was neat when we had a text file with 50 different records and only had to load in and modify 10 of those before exporting the data. It was easy to export the data as we held a reference to all the stringbuffers, both those modified by record ojects and those we kept unmodifed.</p>
<p>It will not be a bit more hardwork (if not impossible) to keep a reference to an updated stringbuffer in your suggested POJO approach - but I like the idea of being able to export any object. The stringbuffer will suffer probably suffer then <img src='http://www.ancientprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>My suggestions to api changes:<br />
- To create an &#8220;empty&#8221; record you just create an instance like any other pojo. That makes it possible to load such objects through, say JPA.<br />
- Do you want to create one from an existing text you have to go through the RecordManager (former RecordManager) as I dont want to force a interface implementation.<br />
- The same goes for exporting, you have to go through the RecordManager. </p>
<p>The API will look Something like this:<br />
<code><br />
//Empty record<br />
MyRecord record = new MyRecord();<br />
</code><br />
<code><br />
//A record instance loaded with text<br />
MyRecord record = RecordManager.create(MyRecord.class, "This is a record foobar   00004200");<br />
</code><br />
<code><br />
//export of record data<br />
String export = RecordManager.export(record);<br />
</code></p>
<p>About adding annotations to the setters and getters it is actually possible today as well. I just included the possibility to add those to properties as well, to reduce duplication of annotation data on setter getter pairs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels Sthen Hansen</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-17</link>
		<dc:creator>Niels Sthen Hansen</dc:creator>
		<pubDate>Tue, 18 Mar 2008 10:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-17</guid>
		<description>I think it is an absolutely brilliant idea. Very simple - and that is a good thing! Now for my comments:

Annotations - naming: Instead of @FixedFormatField, @FixedFormatPattern etc. why not settle for @Field and @Pattern? The package name of the annotations com.ancientprogramming.fixedformat4j... should surely be enough to signify that we are dealing with fixed formats?

A more important point for me, though, is the interface Record which has one method, String export()

As I understand the API a record is supposed to implement the interface. In your examples you declare your record classes as abstract so you won't have to implement an empty export() method.

I can see why it is syntactically &lt;i&gt;nice&lt;/i&gt; to be able to write

&lt;code&gt;myRecord.export();&lt;/code&gt;

However, having to implement an empty method (or declare your entire class abstract) is in my view a very severe restriction to put on record classes - mostly because it is not really needed.

What I would prefer would be remove the interface Record and replace it with an annotation, much like the JPA @Entity

&lt;code&gt;@Record
public class MyFixedRecord {

    @Field(offset = 1, length = 10)
    String getMyField() {
	...
    }
...
}&lt;/code&gt;

Furthermore I would like to have the option of putting @Field and @Pattern annotations on getters rather than fields. This would give more flexibility, e.g. the fixed format record could wrap another class and delegate its properties.

All this would of course require your FixedFormat helper classes to do a bit more work - you would need something like a FixedFormatManager (just as JPA makes use of an EntityManager). 

However, the advantage of this approach is that there will be very few restrictions on the Record class. It can be a POJO or it can be something else entirely. In fact, you could have a class that is both a JPA @Entity and a FixedFormat @Record

&lt;code&gt;@Entity
@Record
public class MyEntityWhichCanAlsoBeExportedInFixedFormat {
    ... yada yada yada
}&lt;/code&gt;

Now that would be rather cool, wouldn't it?</description>
		<content:encoded><![CDATA[<p>I think it is an absolutely brilliant idea. Very simple - and that is a good thing! Now for my comments:</p>
<p>Annotations - naming: Instead of @FixedFormatField, @FixedFormatPattern etc. why not settle for @Field and @Pattern? The package name of the annotations com.ancientprogramming.fixedformat4j&#8230; should surely be enough to signify that we are dealing with fixed formats?</p>
<p>A more important point for me, though, is the interface Record which has one method, String export()</p>
<p>As I understand the API a record is supposed to implement the interface. In your examples you declare your record classes as abstract so you won&#8217;t have to implement an empty export() method.</p>
<p>I can see why it is syntactically <i>nice</i> to be able to write</p>
<p><code>myRecord.export();</code></p>
<p>However, having to implement an empty method (or declare your entire class abstract) is in my view a very severe restriction to put on record classes - mostly because it is not really needed.</p>
<p>What I would prefer would be remove the interface Record and replace it with an annotation, much like the JPA @Entity</p>
<p><code>@Record<br />
public class MyFixedRecord {</p>
<p>    @Field(offset = 1, length = 10)<br />
    String getMyField() {<br />
	...<br />
    }<br />
...<br />
}</code></p>
<p>Furthermore I would like to have the option of putting @Field and @Pattern annotations on getters rather than fields. This would give more flexibility, e.g. the fixed format record could wrap another class and delegate its properties.</p>
<p>All this would of course require your FixedFormat helper classes to do a bit more work - you would need something like a FixedFormatManager (just as JPA makes use of an EntityManager). </p>
<p>However, the advantage of this approach is that there will be very few restrictions on the Record class. It can be a POJO or it can be something else entirely. In fact, you could have a class that is both a JPA @Entity and a FixedFormat @Record</p>
<p><code>@Entity<br />
@Record<br />
public class MyEntityWhichCanAlsoBeExportedInFixedFormat {<br />
    ... yada yada yada<br />
}</code></p>
<p>Now that would be rather cool, wouldn&#8217;t it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-16</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Tue, 18 Mar 2008 10:27:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientprogramming.com/2008/03/17/fixedformat4j-api-bring-on-your-feedback/#comment-16</guid>
		<description>For EDI it must support BigDecimal (you can ditch Double and Float).</description>
		<content:encoded><![CDATA[<p>For EDI it must support BigDecimal (you can ditch Double and Float).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
