Adding a controller factory to ASP MVC

前端 未结 2 1709
情话喂你
情话喂你 2020-11-30 12:29

I have a design idea for a large project at work and I think I have it figured out but would really love to get some feedback on a) the idea in general, and b) my proposed i

相关标签:
2条回答
  • 2020-11-30 12:52

    There is nothing wrong with the idea of a controller factory, as long as it is simply for flexibility later. the problem si when you load up the controllers with code that belongs in other layers, which is one reason you might "need" the flexibility of other controllers. As long as you are not mashing layers togehter, I see no real issue with the factory idea.

    0 讨论(0)
  • 2020-11-30 13:01

    The end of this article shows how to implement your own ControllerFactory. Basically, you derive from DefaultControllerFactory and then wire it up in Application_Start() in your global.asax.

    0 讨论(0)
提交回复
热议问题