• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core

      Actionable involves both concrete implementation (including the instance field actions, set to an empty list whenever actions are retrieved) which may not be appropriate for all cases, and implements some interfaces related to model objects which are also not appropriate for all cases. (For example, it leaves SearchItem.getSearchUrl() abstract.)

      It would be desirable to have a new API interface (implemented by Actionable) which cleanly represents the ability of an object to be decorated by actions: principally getAction(Class), but also getAllActions() and getActions(Class). An extended interface could describe the ability to have an action list be externally mutated (addAction(Action), replaceAction(Action), and perhaps a remove method to satisfy the occasional caller currently mutating the return value of getActions()).

      TransientActionFactory could perhaps restrict its type parameter to the new (base, immutable) interface, and/or introduce some helper methods for searching factories.

          [JENKINS-33399] Marker interface for things with actions

          Jesse Glick created issue -
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26091 [ JENKINS-26091 ]
          Jesse Glick made changes -
          Link New: This issue is blocking JENKINS-33309 [ JENKINS-33309 ]
          Jesse Glick made changes -
          Description Original: {{Actionable}} involves both concrete implementation (including the instance field {{actions}}) which may not be appropriate for all cases, and implements some interfaces related to model objects which are also not appropriate for all cases. (For example, it leaves {{SearchItem.getSearchUrl()}} {{abstract}}.)

          It would be desirable to have a new API interface (implemented by {{Actionable}}) which cleanly represents the ability of an object to be decorated by actions: principally {{getAction(Class)}}, but also {{getAllActions()}} and {{getActions(Class)}}. An extended interface could describe the ability to have an action list be externally mutated ({{addAction(Action)}}, {{replaceAction(Action)}}, and perhaps a remove method to satisfy the occasional caller currently mutating the return value of {{getActions()}}).

          {{TransientActionFactory}} could perhaps restrict its type parameter to the new (base, immutable) interface, and/or introduce some helper methods for searching factories.
          New: {{Actionable}} involves both concrete implementation (including the instance field {{actions}}, set to an empty list whenever actions are retrieved) which may not be appropriate for all cases, and implements some interfaces related to model objects which are also not appropriate for all cases. (For example, it leaves {{SearchItem.getSearchUrl()}} {{abstract}}.)

          It would be desirable to have a new API interface (implemented by {{Actionable}}) which cleanly represents the ability of an object to be decorated by actions: principally {{getAction(Class)}}, but also {{getAllActions()}} and {{getActions(Class)}}. An extended interface could describe the ability to have an action list be externally mutated ({{addAction(Action)}}, {{replaceAction(Action)}}, and perhaps a remove method to satisfy the occasional caller currently mutating the return value of {{getActions()}}).

          {{TransientActionFactory}} could perhaps restrict its type parameter to the new (base, immutable) interface, and/or introduce some helper methods for searching factories.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 169314 ] New: JNJira + In-Review [ 183445 ]

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: