Join GitHub today
Refactor Input #138
This is part of #122
I believe it was really a good idea to take this approach, things are simpler now imo. Some problems I've found:
What I did:
So, for me, it looks like the code is simpler now, as Search doesn't have to manage translation and mdl, translation is only done at rendering time.
It is easier to understand, since we have less primitives and more types, we can look at function signature and understand what values it takes and what it do as not everything is a String, also creating more safety to the programmer. Then I've figured that not every value need to map to a string key, only the ones that will get on the url, the searchable ones.
Also, Inputs is too technical of a name, Search clarifies better what this part of the code do imo.
A few lessons learned:
What you think? I believe if you look commit by commit it is easier to understand the changes, let me know if you don't agree on some of those refactorings.