Results 1 to 5 of 5

Thread: Why make FieldSet final?

  1. #1

    Default Why make FieldSet final?

    I am not sure why Spring Batch team make FieldSet final. This decision limits customized formatting. For example, some of my client send Date field as CCYYMMDD. When they do not have a valid date, they put "00000000" and readDate will generate bad results (no exception). I would like to overwrite readDate to handle it correctly.

    Also, our client is encoding numbers as IBM numeric so the last digits is symbols like "{", "A", etc. I would like to overwrite readDecimal to handle it correctly.

    From design perspective, why not allowing extending FieldSet?

    Thanks

  2. #2
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    I think we can probably allow extensions to FieldSet. It's a tough call when writing frameworks, how much to expose for extension, and traditionally Spring has been rather lax. In this case I can see that it is a pretty useful extension point, and the package is definitely not internal, since it necessarily contains the FieldSetMapper interface. I will change FieldSet to be non-final.

  3. #3
    Join Date
    Apr 2005
    Location
    New York
    Posts
    35

    Default

    Dave,

    Can you also perhaps make FieldSet be an interface rather than a class (and make the current FieldSet be "FieldSetImpl")? Since your docs say this:
    A FieldSet is conceptually very similar to a Jdbc Result Set.
    this would be more consistent with the ResultSet and [font=courier]RowSet[/courier] which are both interfaces.

    There are some other suggestions I have regarding the FieldSet which I hope to post in the next day or so, but I'm finishing up some sample code I'll share with you before I do so.
    Tony Falabella

  4. #4

    Default

    Dave,

    Thanks for the quick response.

    It would be great if you can change indexOf to protected too. It is very useful when trying to extend this class.

    I would agree with Tony it makes sense to make it an interface.
    Last edited by joeserel; Jan 14th, 2008 at 03:13 PM.

  5. #5
    Join Date
    Apr 2005
    Location
    New York
    Posts
    35

    Default

    I've opened a JIRA for the FieldSet interface...
    http://jira.springframework.org/browse/BATCH-289
    Tony Falabella

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •