views:

323

answers:

7

Hi guys,

I was wondering if someone could provide me with some answers. I've been asking to swap our internal apps to an MVC architecture for quite a while now. Rails was absolutely shot-down as a toy, Struts is just too huge for the apps we do, Django's name makes these old folks nervous (oil & gas industry) but finally, finally Microsoft has come out with MVC 1.0.

Since the Powers that Be are dead-set on using Microsoft technologies, I think I may be able to convince them to move our applications to an MVC pattern. Unfortunately, I can't come up with a good reason to swap to our forms-based structure to an MVC style.

Can anyone think of justification good enough to feed to my bosses? :-)

+12  A: 

Do you have a good reason to switch? It sounds like you don't so I am wondering if you are switching for the sake of MVC itself which I would discourage you from doing.

ASP.NET MVC is helpful when you wish to have more control over the output and lifecyle of your application. Keep in mind that in many cases this means more work for you as the developer. MVC frameworks are good for sites that are not data-entry intensive - in other words if you handle a lot of form POSTs and process data out of those forms then ASP.NET MVC will actually create more work for you.

I don't mean to sound harsh but it seem strange to me that you want to switch to ASP.NET MVC but don't really know why.

Andrew Hare
I appreciate the comment and mostly I am concerned with managing large applications that have all kinds of logic on what (would be) the controller side of things.A large portion of our apps do things like take user input and return a result-set. It's not dealing with the view that is complicated, it is taking a large number of (e.g. complex billing) variables and processing them.As a result of that problem, unit testing almost doesn't exist (yet) because it hardly fits the form methodoly (I can't fully test against my model/controllers because they are integrated into everything)
(Oops and by "large applications" I mean large in terms of code complexity not in terms of how big they are...the user load is light but the complexity of what actually happens after the user hits submit is the killer - seperating that set of classes allows me to to let my jr. devs go after the views and the "committee" that decides the internal number crunching (an ever-changing thing) to attack the logic and test it immediately to make sure it does what it's supposed to[tm] ... mostly billilng stuff, so it's highly visible
Having said all the above...I guess the answer to your last question is: I posted the question because I hoped someone else had been through it before and maybe because I needed a little convincing myself :-)
A: 

I think that in this case the OP is looking for a pragmatic (profitable) reason to switch over to MVC, since most companies think that way.

The biggest advantage is that it is much easier to create unit tests for ASP.NET MVC applications. A good suite of unit tests can then serve as the foundation of a Continuous Integration process.

The bottomline for the powers to be is that you can create a build in a single step, simplifying deployment, creating installers, patches etc.

Praveen Angyan
This is excellent advice and I believe I will use it as the foundation of my argument. Sometimes it's easy to forget that the people making the decisions are making considerations from a business perspective and not a programming mind. I'll appeal to their sense of cost benefit rather than my original notion that it makes everyone happier.
A: 

Rails and Django both follow the Model View Controller (MVC) pattern so sounds like you will just be creating a load of work for yourself. Why do YOU want to switch to ASP.NET MVC?

Absolut40
+1  A: 

I think it's not a matter of "selling" MVC, but rather of understanding it's advantages. also, you should seriously evaluate whether migrating an existing system to MVC will be cost effective. however, MVC has many advantages - here are some from the top of my head:

  • separating control, data and presentation makes your application more maintainable
    • easier to make changes
    • after a relatively short learning curve, easier for other programmers to comprehend
  • better design means introducing new features is easier. try adding caching, form validation, etc when everything is mixed up...
  • an MVC system may be more testable (and therefor can be more reliable) - it's much easier to test your controllers than to test a spaghetti of data, control and presentation code.
Yonatan Karni
I think you're definitely correct. Answers like yours and questions like Absolut40 and Andrew Hare's are definitely helping me to map out the specifics as they apply to my industry and company. Very much appreciated!
A: 

"Struts is just too huge for the apps we do"

In what way? Struts made even simple internal applications a breeze to develop in our company, once we had learned how it worked (which was quite quick). A few JSPs, a few Actions, backend database access done in JDBC via some simple DAOs, bundle it all up in a war with ant/maven and deploy. Done.

JeeBee
Don't get me wrong, I'm a fan of Struts but trying to explain J2EE (Struts, Spring, Sitemesh, Hibernate and ORM in general, using a new IDE ala Eclipse/Netbeans, pox.xmls, libraries being all over the place opposed to the Microsoft Way, tying it into Oracle and adding JUnit on top of it all is miles from where we are at this point and I'm pretty much the only one who even understands it)
Well don't use Spring, Sitemesh, Hibernate/ORM, pox.xmls (what - not that awful JPOX JDO thing?). Eclipse isn't hard to use. Libraries you need can go into a folder called /lib on your project. Tying to Oracle - use JDBC. I thought you wanted to write simple webapps!
JeeBee
A: 

Also, fyi, keep Joel's advice in mind (Things You Should Never Do, Part I): avoid rewrite the code from scratch.

jao
While I do agree with you in principal, sometimes I have to make hard decisions. In our case, some of these applications (being ORM-free) are not even unit tested and are dangerously close to being spaghetti through years of outsourced developer churn. I know that I can take (at least some of) these apps and make them MVC with ORM and unit testing and make the entire cycle much happier for everyone. But these processes are heavily entrenched, so it's not so straightforward.