Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9954

FormatFactory should be real Factory-pattern

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.18.0
    • Component/s: camel-bindy
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Novice

      Description

      The class org.apache.camel.dataformat.bindy.FormatFactory is a utility class which supports a factory-pattern.
      According to the factory-pattern this should not be a utility-class but it should be a class that can be instantiated.
      This class should implement an interface or extend an abstract class.
      Maybe we should make a factory per Format and choose amongst the following solutions:

      • let each formatter answer the question about being able to format for certain formating-options (based on type and optionally the pattern for all "numeric" format factories);
      • put all formatters in a hashmap with the type as a key.
        With this last solution all the "numeric" format factory should decide which format to return (e.g. BytePatternFormat or ByteFormat based on the pattern being empty or not)

        Attachments

        1. CAMEL_9954Patch2.patch
          48 kB
          Arno Noordover
        2. CAMEL_9954__FormatFactory_should_be_real_Factory_pattern.patch
          157 kB
          Arno Noordover

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              anoordover Arno Noordover
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified