IoC in MVP Asp.NET
I am developing an application that uses MVP and I am wondering how to inject my dependent into my presenter class. Because my real information is also an example of my view. I was thinking about creating a viewbase and inside it. I am instantiating dependencies and injecting them into my presenter instance. There could also be an HttpModule that intercepts calls to the page and then I could inject my dependencies. I have some ideas, but I cannot insert my view into the constructor, only I can inject my view into the mey presente by property. Anyone have any ideas how you are doing to inject my dependencies and my view into the presenter's constructor?
a source to share
To embed MVP inside webforms, this is slightly less perfect than MVC, mainly due to the fact that there is no custom assembly factory for your page, which means that at some level you need to connect your page to an IOC map like a rule at the base page level.
I wrote a blog about this. Creation of the general structure Model-View-Presenter . I extended this to allow me to implement multiple views and provide one presenter with multiple views, but I didn't have time to blog about it. Anyway, this is a more advanced usage, my source here should get up and running easily. My post specifically refers to StructureMap 2.5.3, but it can be easily adapted to fit any IOC framework that supports "BuildUp" type functionality.
a source to share