Uploaded image for project: 'Commons Chain'
  1. Commons Chain
  2. CHAIN-64

Context should be Map<String, ? extends Object>

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      Hello,

      I belive that restriction imposed on context value types to be Objects is unnecesary severe. I can imagine context which can only hold values of certain (sub-)class.

      I think that the Context should be declared as

      interface Context<T> extends Map<String, T extends Object>;

      The commands should be generic as well

      interface Comamnd<T>

      { Object execute(Context<? extends T> context); }

      The commands provided by the chains can either:

      a) be generic as well, or
      b) defined as "implements Command<Object>"

      Ales

        Attachments

          Activity

            People

            • Assignee:
              simone.tripodi Simone Tripodi
              Reporter:
              alesd Ales Dolecek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: