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

Context should be Map<String, ? extends Object>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • 2.0
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: