Accessing Page's Code Behind: implement an interface to the Page Class
A couple of days ago I was reading a book related to Design Patterns in ASP.NET (Professional ASP.NET Design Patterns by Scott Millett).
S. Millet describes the MVP pattern that can be applied to Webforms. The Page must implement an interface called IView. The Page has the responsability to instantiate the presenter.
I am interested in using the MVP Pattern in Umbraco. I do need to access the Page's Code Behind to implement the interface. I can live without it by handling any event like Page_Load within a script block. But doing this is like cheating as implementing an interface forces the page to conform to a contract/interface.
The only way to have more control over the Page-like is to use UserControl as it is the manual way to do things.
To sum up what I have watched, Aaron used the MVP Framework and implemented the IView to a UserControl. As I said using UserControl in Umbraco is the only manual way to fiddle with code. He didn't implement the IVIew to the Page. It seems there is no way to implement an interface directly at the Page level.
If the topic is of interest to you I recommend you read S. Millet's step-by-step implementation of the MVP Pattern (Professional ASP.NET Design Patterns by Scott Millett). MVP makes Webforms much more interesting.
Accessing Page's Code Behind: implement an interface to the Page Class
A couple of days ago I was reading a book related to Design Patterns in ASP.NET (Professional ASP.NET Design Patterns by Scott Millett).
S. Millet describes the MVP pattern that can be applied to Webforms. The Page must implement an interface called IView. The Page has the responsability to instantiate the presenter.
I am interested in using the MVP Pattern in Umbraco. I do need to access the Page's Code Behind to implement the interface. I can live without it by handling any event like Page_Load within a script block. But doing this is like cheating as implementing an interface forces the page to conform to a contract/interface.
The only way to have more control over the Page-like is to use UserControl as it is the manual way to do things.
Any idea?
Aaron powell did a session about unit testing umbraco and using mvp see http://www.aaron-powell.com/unit-testing-with-umbraco im sure there is a video to the session somewhere.
Regards
Ismail
phenryll
Check out
http://stream.umbraco.org/video/726639/aaron-powell-unit-testing
Thanks guys.
To sum up what I have watched, Aaron used the MVP Framework and implemented the IView to a UserControl. As I said using UserControl in Umbraco is the only manual way to fiddle with code. He didn't implement the IVIew to the Page. It seems there is no way to implement an interface directly at the Page level.
If the topic is of interest to you I recommend you read S. Millet's step-by-step implementation of the MVP Pattern (Professional ASP.NET Design Patterns by Scott Millett). MVP makes Webforms much more interesting.
is working on a reply...