mendicant-university/newman — comment on commit c17fd52e0706cf80e46ffbfec08e3ff80428aa92
File: lib/newman/commands.rb line 12
By ericgj:

Yeah, I see that. What I meant is it adds *more* coupling :_(

I always go back & forth about mixins and where to put the state. I guess my thinking now is, `matchers` really belongs in the Commands module - all the manipulation of them is done there, it's an implementation detail for Application. Likewise with `callbacks`. All Application knows about callbacks is the `trigger_callbacks` method. So why does the state have to reside in Application? Why not in Commands?

OTOH, Application *itself* needs to apply the extensions onto the controller. Application knows about Controller, Commands doesn't care a bit about Controller. So my mental model is, everything about extensions should be in the Application really, or at least...not in the Commands. (Maybe could be in a separate `ControllerPlugins` mixin for alternative Application classes to use, but that seems theoretical at this point... especially when you could do `Controller.include(MyModule)` if you had to. )

Sorry to belabor the point, but it hits on a question I often come up against - the question of mixins and where to put the state.