Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-270

setProperty method in SequencerOutput interface should enforce limitations on property value types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Minor Minor
    • 0.5
    • 0.1, 0.2
    • Graph (2.x)
    • None

      The setProperty method of the SequencerOutput method, as it currently exists, accepts arbitrary single Objects or arrays of Objects as property values via its use of "Object..." in the method signature. In DNA-77, it was suggested that the current method definition should be replaced with multiple type-specific methods, but it was decided to not do this, and instead recommend use of ValueFactory to create the values used in this method.

      The problem with this is that, by leaving the interface as is and having use of ValueFactory be optional, it is easy for users to set properties to value types that are not currently supported (meaning that they will see a run-time error somewhere else in the code in these cases, rather than a compile-time or run-time error at the actual point where the issue was introduced (their misuse of setProperty).

      One possible way to enforce this in the interface is to define the interface as throwing some sort of exception if the value is not an instance of an allowed class. Another solution would be a more substantial revision of the interface to mandate use of ValueFactory to create property values.

              bcarothers_jira Brian Carothers (Inactive)
              greghaber_jira Greg Haber (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: