
These days, I am reading a bit about ASP.NET MVC and it looks like Microsoft is trying to implement Java Struts !
Does it mean that it took so long for .NET guys to understand Struts and get ASP.NET support such a paradigm?
Let's not get into a Java vs .NET debate but see the similarities and differences between ASP.NET MVC and Java Struts:
Does it mean that it took so long for .NET guys to understand Struts and get ASP.NET support such a paradigm?
Let's not get into a Java vs .NET debate but see the similarities and differences between ASP.NET MVC and Java Struts:
- To start with, an ASP.NET form expects/mandates only one form tag but with MVC now, you can have any number of form tags in an ASPx page. You could have any number of form tags in a JSP page.
- The code-behind event handlers used to act as controllers in a standard ASP.NET web application. In Struts, an Action class acts as a controller which means that any submit action on a page is associated with an Action class. ASP.NET MVC is following the Struts Action controller approach now.
- ASP.NET MVC takes very good advantage of LinQ-SQL. VS 2008 is made so powerful that it eases the life of a developer by generating lot of useful code. On the other hand, although there are OR class libraries like Hibernate, the IDEs (the ones that I used so far) generate very little code and thus make you write a lot of code !
- ASP.NET MVC is convention based, meaning that it expects the controllers/view pages and the model to follow a consistent naming convention (although, this is not mandatory and not that restrictive too). In Struts, the key is Struts-config.xml that associates a view and a controller.
So far, these are some of my observations on Struts and ASP.NET MVC. Let me make my hands dirty with ASP.NET MVC and then talk more about it after I achieve a level of comfort :-)
