To use interceptors or not interceptors in MVC application framework?
Does using interceptors for controlling the flow of events in a MVC framework == business logic coupled with, or leaked to, the framework?
Is that some开发者_如何学Cthing one should even worry about? Doesn't seem likely that someone would change the MVC / Application framework unless the framework is severely broken or outdated, right?
But if I follow the same logic, does that mean one can bypass the Service layer and just have fat controllers? hmm...
You should worry about it only if you want to use MVC Pattern in its pure form. If you are using the interceptors to controlling the flow of the events, your business logic would not be decoupled which is not a good thing if you want to reuse it later. Having a fat controller will hurt the foundation of unit testing controller. However - its upto an individual to 'pick n choose' what he or she wants to use from a framework and in what ways?
Just my 2 cents...
精彩评论