ASP.NET And MVC And Front Controllers...Yikes!
I think my brain is going through the ringer on something that should be easy...
At my client we're trying to do things in ASP.NET to make our development easier. More to the point, we're trying to move things towards a MVC approach, and I'm initially leaning towards the Front Controller idea. Here's where I went:
- I found this article - it's a good starting point, but the implementation is way too basic. It also doesn't address postback issues at all - that's my big beef.
- Then I found this and this - good articles, but I couldn't find the "here's a sample solution that shows how I tie everything together" from Michael.
- Google searches led me to interesting threads (like this one) where people are running into the same problem with trying to get Front Controller to work.
- Finally, I found this, which makes me wonder if doing a Front Controller in ASP.NET (esp. in .NET 1.1) is problematic at best unless we're willing to use a hot fix.
After all of this, I'm wondering if trying to do MVC and/or a Front Controller in ASP.NET is just not worth the hassle. I really want some kind of separation of concerns, but so far I can't find a framework that ties everything together and shows a clear example that addresses real-world issues. I've found a bunch of frameworks currently there - here's a general list (and the concerns I have about them):
- UI Process Application Block (appears thorough but it also seems pretty complex out of the box - maybe if I spent more time with this I'd "get it" but I'm not getting it just yet)
- MonoRail (pretty new and their demo didn't show them addressing post-back issues)
- Lattis (doesn't seem like a lot of activity around this)
- Maverick.NET (seems like a good option but it hasn't been updated in over 2 years - that's not a good sign in my book)
- NStruts (seems dead - last update was 2 years ago)
If you've used a framework in ASP.NET successfully to separate views from controllers from models, I'm all ears. Links to other frameworks are nice, but I'm really looking for information on a successful approach. An example is sorely needed - if I can see how something works that ties things together so much faster than reading pages and pages of documentation that talk about theory and never get to the problem itself (e.g. MS's UI block).
I really don't want to go back to the client and say, "let's just stick to having everything in the code-behind." That feels so wrong because trying to write tests around heavy-weight pages kind of sucks (and please don't mention NUnitAsp - I tried to use it and it's just not worth the hassle). I know that we could have the page route information it receives to the correct controller and it could then transfer, or redirect, or throw an exception so the page could show the client what's going on. That would be a bit cleaner than having all that logic in the page itself. I'm open for suggestions.
* Posted at 07.08.2005 10:19:26 AM CST | Link *