On my current project, I'm stuck in an ASP.Net 2.0 Webforms anti-pattern quagmire. I am aware of the myriad of anti-patterns we're using (huge code-behinds, no separation of concerns, untestable code, and on and on). Now, I'm not interested in rescuing this application from this situation as it's too far gone. Instead, my focus is on other projects that I will undertake in the near future for which I would very much like to graduate from these anti-patterns.
I have done a LOT of study recently in ASP.Net MVC, good OO design (Head First OOA&D and Eric Evans DDD book), design patterns (Head First Design Patterns), and automated unit testing with mocks (through presentations and blogs). I'm looking for advice on how to tackle an ASP.Net MVC 2 project while achieving good design, flexibility, maintainability and testability. What would you recommend that I do to achieve this? Here's my thoughts so far:
Utilize an iterative approach to development outlined in Head First OOA&D, and apply design patterns where applicable. Use Linq to NHibernate for data access, but perhaps avoid the Repository pattern (Ayende on his blog indicates that it's an unnecessary layer with NHibernate). Should I employ StructureMap or other IoC container? What else do I need to know in order to build a rockin ASP.Net MVC 2 application with membership, support for a media gallery, and some simple custom CMS for administrative users?
It seems to me that there should be a balance between anti-patterns, and potentially getting bogged down with DDD. Just a thought.
Thanks, Andy