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