Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • That would be the simple solution but it has several drawbacks: First, it uses 'string typing' which can be fixed. Second, it moves the job of instantiating a controller to the place of calling if I understood your solution correctly. That's exactly what I'm trying to avoid right now because prior to refactor controller instantiations were spread everywhere. It is very hard to maintain. Thank for the links, I will check them out. Commented Oct 6, 2016 at 17:07
  • Oh, I think now I get it, thanks, that's an idea. But still, weak typing, cannot be sure that passed the right argument. It is kinda hard to refactor if module requires different argument. Commented Oct 6, 2016 at 17:16
  • @charlag_khan i guess you can have a mix of them. According to the names, your 3 first arguments will always be present on the page right ? And the others wioll change accordin to what you click. So you could keep the 3 first ones as constructor arguments and the others as i sugessted here. Commented Oct 7, 2016 at 6:22