• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controller Filters - Input needed

#10
I think the whole discussion just comes back to the struggle between two (often opposing) philosophies: discoverability and maintainability.

MVC makes discoverability slightly more difficult, until you learn the conventions of the framework. Some URLs are impossible and it can be difficult to maintain a large site with MVC conventions alone, so you need something beyond naming conventions to deal with routing.

The next step is configurable routing, and to balance maintainability, discoverability, and even ease of coding the solution, you centralize it. The discoverability in this case cuts both ways: it's easy to discover every route in the system, but the user has to be aware that the feature and know where to look.

Events and hooks deal with the same issues.

I could even look at the idea of defining filters within the controller as being similar to using observers in Bonfire models. It's a very powerful feature that I use quite heavily, but the second inheritance comes into play, it's not nearly as discoverable as everyone thinks it is (and it's often not any more discoverable than stuffing it in a config file somewhere if you don't bother to read the docs, anyway).

If the feature and the related configuration file(s) are well-documented, I think that's the best we can do. We can continue doing similar things by leveraging other features, but I think it would be better to give it first-class support and do our best to document it. Then it can be easy to discover every filter/middleware in the request/response chain, and hopefully we can make it easy for users to be aware of the feature and know where to look.
Reply


Messages In This Thread
Controller Filters - Input needed - by kilishan - 07-07-2016, 08:39 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 06:46 AM
RE: Controller Filters - Input needed - by arma7x - 07-07-2016, 09:14 PM
RE: Controller Filters - Input needed - by mwhitney - 07-08-2016, 07:29 AM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 11:42 PM
RE: Controller Filters - Input needed - by arma7x - 07-12-2016, 01:55 AM
RE: Controller Filters - Input needed - by arma7x - 07-13-2016, 12:23 AM
RE: Controller Filters - Input needed - by arma7x - 07-14-2016, 12:37 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.