I realize that we can change the location of the handlers like this:
However, I am curious as to the reason behind not simply naming the handlers “Controllers”, which makes more sense in an MVC world. Although we can change the location in the framework settings, everything else that uses controllers still needs to use the “Handler” keyword, like framework functions relating to that, even CommandBox commands.
Luis can answer as well if he has more info, but I think it’s mostly just a case of “because that’s how it was done”. ColdBox is an event-driven framework, and so therefore your handlers can also be referred to as “event handlers” since they, well… handle events. The first version of ColdBox was also written around 2005 which is when pretty much all other MVC frameworks for web were in their infancy (or didn’t exist yet) so perhaps the term “controller” didn’t seem that ingrained at the time.
We actually had it in the ColdBox 4.0 roadmap to rename “handler” to “controller”, but the phrase “handler” is littered all over the source and would cause a major pain if we renamed all functions, settings, method arguments, etc, that had the word “handler” in them so we’ve left it for now.
Also, note in CommandBox that the “coldbox create handler” command is actually just an alias for “coldbox create controller”:
ColdBox Platform Evangelist
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Thanks Brad. Well thought out answer.
I suppose it makes sense. It would be nice to have, but not necessary. Let me know if you need any volunteers for cleaning that up once you decide to change it in the framework.