
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 :-)

2 comments:
ASP.NET MVC is more like Rails, the Ruby-language based MVC. Rails, in turn, may be like Struts... but that is why we call it design patterns, right?
Actually they are going through the pains the early Struts developers are going through. For example, many are realizing that the "out of box" ASP.NET MVC approach yields controllers that are way too big. Read "The ASP.NET MVC ActionController – The controllerless action, or actionless controller".
I had worked on Struts and now when I look at MVC, it sounded as if it is an attempt to teach HTTP/HTML basics to .NET developers after having worked on a sophisticated programming model like "Web Forms". Besides, getting the standard server controls (like user controls, custom controls) along with the plain HTML (MVC) controls is proving to be a challenge !!
Post a Comment