Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-2324

Create ValueMeta subclasses for specific types

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Severity: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      The ValueMeta class has a number of switch statements that could be removed if there were subclasses for the different types of ValueMeta types.

      This could be accomplished by creating a factory object to create the different types of ValueMeta.

      The advantage to this type of arrangement is that we can remove all the switch statements based on type in the class. Also, all the isType methods (isNumeric, isString, etc...) become hard returns. This can also make some type specific improvements easier. Example, why do all numeric type formats go through a DecimalFormat object? If there is no defined conversion format, the system could use the faster native conversion (Long.valueOf(...) for example).

      This may ease into the addition of custom types. Also, this can be done gradually by introducing the factory and routing all creation to this one method. I foresee the need for one ValueMeta subclasses for each of the current types. If you want to get really fancy, you could create one for each storage type as well.

      For compatibility you could leave the existing class as it is and deprecate the constructors.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ftownsend@indurant.com Francis Townsend
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: