Spring Integration
  1. Spring Integration
  2. INT-1280

Move serializer Package from Core to Spring Commons

    Details

    • Type: Refactoring Refactoring
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.0 M7
    • Component/s: None
    • Labels:
      None

      Description

      Per discussion with Dave Syer - as part of moving the package, make the following changes...
      1. Move the implementation to a subpackage
      2. Change the interfaces to throw the appropriate (De)SerializationFailureException

        Activity

        Hide
        Dave Syer added a comment -

        Question: could (De)SerializingConverter go in the top-level package? It doesn't depend on the Java-IO serializer only on the interface. That way it would make more sense to see the exceptions in the top level package.

        Show
        Dave Syer added a comment - Question: could (De)SerializingConverter go in the top-level package? It doesn't depend on the Java-IO serializer only on the interface. That way it would make more sense to see the exceptions in the top level package.
        Hide
        Gary Russell added a comment -

        I'm a little confused by your comment - the (De)SerializingConverter delegates to the streaming converter...

        public class DeserializingConverter implements Converter<byte[], Object>

        { private JavaStreamingConverter converter = new JavaStreamingConverter(); ... }
        Show
        Gary Russell added a comment - I'm a little confused by your comment - the (De)SerializingConverter delegates to the streaming converter... public class DeserializingConverter implements Converter<byte[], Object> { private JavaStreamingConverter converter = new JavaStreamingConverter(); ... }
        Hide
        Dave Syer added a comment -

        Yes but does it need to delegate to the Java* implementation? It looks quite generic to me so we could wrap the interfaces and move it up a level. Maybe I'm missing something (what is the purpose of the (De)SerializingConverterConverter, I thought it was just an adapter from StreamingConverter to Converter.

        Show
        Dave Syer added a comment - Yes but does it need to delegate to the Java* implementation? It looks quite generic to me so we could wrap the interfaces and move it up a level. Maybe I'm missing something (what is the purpose of the (De)SerializingConverterConverter, I thought it was just an adapter from StreamingConverter to Converter.
        Hide
        Gary Russell added a comment -

        Excellent point - with the current structure, we'd have a virtually identical pair of (De)Serializers in each subpackage with the only difference being the delegate.

        I'll pop them up a level and add a setter for the delegate (which would default to the Java implementation).

        The setter on the Payload(De)Serializing transformers in SI core could probably be removed too, but I suppose we should allow them to inject any Converter defined with the appropriate types, and not force them to use the commons (De)Serializers. I think I'll just update the javadocs there to reflect that the default delegate there is the commons (De)Serializer.

        Show
        Gary Russell added a comment - Excellent point - with the current structure, we'd have a virtually identical pair of (De)Serializers in each subpackage with the only difference being the delegate. I'll pop them up a level and add a setter for the delegate (which would default to the Java implementation). The setter on the Payload(De)Serializing transformers in SI core could probably be removed too, but I suppose we should allow them to inject any Converter defined with the appropriate types, and not force them to use the commons (De)Serializers. I think I'll just update the javadocs there to reflect that the default delegate there is the commons (De)Serializer.
        Hide
        Dave Syer added a comment -

        OK. You can't default the converter values in commons.serializer, though, without creating a cycle. If you think a default is important we need the dreaded "support" package.

        Show
        Dave Syer added a comment - OK. You can't default the converter values in commons.serializer, though, without creating a cycle. If you think a default is important we need the dreaded "support" package.
        Hide
        Gary Russell added a comment -

        Duh... of course, thanks for your patience - I have removed the default and added a constructor. Let me know if you see anything else.

        Show
        Gary Russell added a comment - Duh... of course, thanks for your patience - I have removed the default and added a constructor. Let me know if you see anything else.
        Hide
        Gary Russell added a comment -

        spring-commons-serializer project created and code moved over - still need to remove code from SI

        Show
        Gary Russell added a comment - spring-commons-serializer project created and code moved over - still need to remove code from SI

          People

          • Assignee:
            Dave Syer
            Reporter:
            Gary Russell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: