we need all these - why not just see into the future a tiny bit and carve out a namespace instead of continuing to dump billions of consts into the top-level?
I kind of like this idea, although my gut instinct tells me that it
might want to follow the existing module hierarchy.
class Application::ActionController < ::ActionController::Base
class Application::ActiveRecord::Base < ::ActiveRecord::Base
class Application::ActionView::Base < ::ActionView::Base
Please excuse my silly question, but what if people want to have a
model "application" with a controller "application_controller" etc? I
like the idea of doing some global namespacing or something so that
wouldn't be an issue.
No, no, no! You see, if you do that then it's one step to
EigenClass::ClassFactory::ApplicationFactory::Application::ApplicationSpace::MyApplication::Factories::ModelFactory::Interfaces::IModel
< EigenClass::Namespace::Rails::ApplicationAPI::Abstract::Interface::Models::ActiveRecord::Base
I'm not really satisfied with this use case. From plugins, you're much
more likely to monkeypatch ActionController::Base and much more less
likely to monkeypacth ApplicationController. In fact, if plugin is
monkeypatching ActionController::Base, it's a lot easier to override
it in ApplicationController. But again, I might be missing a point
here. So please feel free to correct me !
Wow, you managed to say "monkeypatch" three times in two sentences
I guess, a distinction might help.
Most Rails plugins target the framework as a tool to build
applications. E.g. all acts_as_* plugins live on this level. But the
same strategy of "let people work out solutions in plugin land" that
has been so wildly successful for Rails has been adopted to
applications like Mephisto. As such there are plugins that don't
target Rails itself but specific applications. And the same success
story continues to work on this level, too.
I totally agree that for framework level plugins it makes sense to
alter ActionController::Base. But that doesn't apply to plugins that
target an application.
Examples for this usecase are additions to Mephisto like pagination of
article lists, custom spam protection mechanisms, additional archives
and stuff like that (i.e. features that are intentionally left out of
Mephisto and pushed into Mephisto plugin land). These need to amend
MephistoController and can't be done just working on
ActionController::Base. The same thing applies to many application
level controller plugins.
I kind of like this idea, although my gut instinct tells me that it
might want to follow the existing module hierarchy.
class Application::ActionController < ::ActionController::Base
class Application::ActiveRecord::Base < ::ActiveRecord::Base
class Application::ActionView::Base < ::ActionView::Base