Details
-
Type:
Improvement
-
Status: Closed
-
Severity:
Medium
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Notice:
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
- is related to
-
PDI-13819 Deprecate the ValueMeta Class
-
- Open
-