Closed yhl25 closed 1 year ago
With the factory, we hand over the control to the user for Reducer creation so that the user can define the way the Reducer should be instantiated, that way any user parameters can be passed to the constructor using the factory.
Got it. like what we implemented in EvenOddCounterFactory where parameters in config are passed in. Thanks for the explanation.
With our current design, the Reducer cannot accept constructor parameters provided by the user because the user has no control over Reducer creation. With the factory, we hand over the control to the user for Reducer creation so that the user can define the way the Reducer should be instantiated, that way any user parameters can be passed to the constructor using the factory.