When I saw a new item in my RSS feed from Rob Conery about MV* I was immediately interested to read it, because I have been working on trying to create my web app pages using MVP, but am unable to find any examples beyond the most basic.
I would love to see how other people manage the interactions between the Controller and the View, to see how it compares to how I am doing it.
My view interfaces tend to be kinda large. For example, if I have a button that I hide and show depending on business rules, I will create a MyButtonVisibility property on the interface can set the properties from the controller.
I would be interested to see how others deal with things like the hiding / showing of items. I could see wrapping more of that kind of functionality in the view, and giving the view some more logic but I think you would then start to lose some of the testability.
Anyway, the articl on Rob’s blog was really to talk about creating an MVC style architecture for subsonic itself, not the pages that use it. However, Rob seemed to suggest that the new changes would aid you in using MV* in your pages by forcing you into good habits.
But I really don’t understand how that would work. If you have code that does:
MyGridView.DataSource=Product.FetchAll();
MyGridView.DataBind();
And you change it so that you use a Controller (or Manager as I have called it when loading Business Objects or DTOs) to look like this:
Product product = ProductController.Get(newID);
product.ReorderLevel = 100;
ProductController.Save(product,"unit test");
I don’t see how this helps you create an MV* architecture in your pages.
Maybe I am just not understanding.