Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are we moving towards classic ASP using MVC framework in .Net 3.5?

Looking at MVC framework, it seems we require more of classic ASP knowledge then ASP.NET postbacks and Viewstates. Are we moving backwards to complex UI + code logic in the actual frontend HTML markup?

like image 470
Murtaza Mandvi Avatar asked Oct 13 '08 21:10

Murtaza Mandvi


4 Answers

We're moving back to not trying to abstract away fundamental concepts like HTML and HTTP Requests. On the UI end, that translates into the Views being more tightly integrated with the output, which isn't a bad thing. the classic ASP model translated into having everything tightly integrated with the output, which is a bad thing.

like image 128
Jimmy Avatar answered Nov 08 '22 09:11

Jimmy


One could argue that the MVC paradigm is a step backward if you consider the ASP.NET paradigm a step forward, I guess. Personally I always thought it was much easier to write clean separated code in classic ASP, rather than .NET where display output text usually got mashed into code blocks where it was impossible to access with a standard HTML editor. I always thought the ASP.NET architecture was more about pushing .NET than improving the overall structure of we application, so in that sense MVC is a step forward.

like image 22
Nick Avatar answered Nov 08 '22 07:11

Nick


This is funny that you mention this ... I was having the same conversation with a co-worker today.

Is it a step moving backwards? I don't think so ... while in classic asp you had a some complex logic in the UI, from what I can see with MVC, the complex logic should still be in your business objects, and any complex interaction with the object should be done via the Controller.

The goal, again, from what I can see, is to keep the UI trim and fit when it comes to actual business logic. Any additional bloat would be caused by making the UI more user friendly, with the likes of AJAX and JQuery.

This is just my initial observation regarding MVC. It is a very cool technology, especially with how it sits on top of REST, makes it very easy to work with from other technologies.

I'm looking forward to trying it out in a couple of future projects!

like image 21
mattruma Avatar answered Nov 08 '22 08:11

mattruma


If you are seeing complex code logic in the View relative to the Models and Controllers, than perhaps you are approaching it the wrong way.

In the pure sense, you should be able to switch out the view (XML instead of HTML let's say) with minimal work. That could only happen if the data logic is contained in the models and the business logic ins contain in the controllers.

So, if you were displaying a shopping cart, the view might only have code that writes out the product quantities and totals. The model class(es) would hold the product data and the controller would do all the processing such as adding products and checking out.

like image 28
Nick Messick Avatar answered Nov 08 '22 08:11

Nick Messick