ASP.NET MVC design pattern

midrange

Senior Member
Joined
Apr 8, 2009
Messages
727
Reaction score
0
If largely new to .NET development, would be better to write a site using the normal "web forms" way rather than using the MVC framework in order to gain a better grasp of the language(C#) and platform?

I suppose it's akin to asking whether, if new to PHP, if it's 'better' to code without using Cake/CI/etc.
 
ASP.net is easy enough. Start with normal websforms and when you know what going on then move on the to more advanced MVC framework.
 
*cough* That depends on what you are bringing to the table, and what you are wanting to learn.

Webforms is sufficient (and quicker to code) for smaller projects, while MVC is more the corporate baby. If you come from WinForms, WebForms is the way to go. If you come from a Java environment, I dare say you may find MVC the easier route.

If you have no experience, you have nothing to lose choosing either side...

Oh, and I learned PHP by delving into Joomla, so I think your point may well be moot. :p I prefer CI for beginners too, just as I point novices in Javascript to jQuery.
 
Last edited:
...just as I point novices in Javascript to jQuery.

:eek: SERRIYAAS?! It took me quite some time to get used to jQuery... But that might be because I've been using JS for a good 6-7 years now. I still enjoy the flexibility and sense of achievement you get from doing a particularly complex piece of scripting that executes 100% on all browsers, in a millisecond.
 
Yeah - jQuery works wonders for designers that are used to CSS, but never touched Javascript...
 
I'll go the web forms route, then re-write in MVC. It's my own site so there's no deadline and will serve as good practice.
 
MVC is a Design pattern and Implementation Pattern for all applications but mainly used for web. you can follow the MVC design pattern in normal webforms as, well i am doing it. MS has just named new type of development tool MVC because it follows some aspects of the MVC, but the design pattern is not property of MS.
 
I know the design pattern is not property of Microsoft.

How are you using MVC if using "normal" webforms? Surely using the normal would be having, e.g., and aboutus.aspx with the code behind pulling some copy from the db?
 
Model View Controller.

you have your Model - with all your business domain classes, i use linq to entities.

then you have your View, where you have your .aspx pages.

then you have your controller, where use your actions, for example client actions, searchactions ect.

in your asps.cs code behind, in your button click event for example you can use SearchActions(x,y,z), then search actions will then use your model to run queries on,

it is similar to your 3 tier design principle, however because you are using linq to entities your classes are already created for you, you do not need the sql.

however because the MVC pattern allows the GUI (in some instances) to directly interface with the Model, you can call some models directly.

NOTE that i am using the Linq to entites capability here this would not work with the normal ADO.net without many helper classes.

this is my interpretation of it. because the MVC Capability from MS is not stable enough for large scale implementation IMO
 
Model View Controller.

you have your Model - with all your business domain classes, i use linq to entities.

then you have your View, where you have your .aspx pages.

then you have your controller, where use your actions, for example client actions, searchactions ect.

in your asps.cs code behind, in your button click event for example you can use SearchActions(x,y,z), then search actions will then use your model to run queries on,

it is similar to your 3 tier design principle, however because you are using linq to entities your classes are already created for you, you do not need the sql.

however because the MVC pattern allows the GUI (in some instances) to directly interface with the Model, you can call some models directly.

NOTE that i am using the Linq to entites capability here this would not work with the normal ADO.net without many helper classes.

this is my interpretation of it. because the MVC Capability from MS is not stable enough for large scale implementation IMO
Eh? :confused: Dude, I'm pretty sure everyone here knows what MVC is about. Did you even read the whole topic?
 
gboy, I think you are confusing MVC with MVP. The two, while similar (MVP is a derivative of MVC), are quite different where the view/presenter is concerned.

Web Forms cannot truly implement MVC due to the way it handles callbacks. In MVP the presenter handles events (like button clicks, etc.), which is how Web Forms works. In true MVC the button click event would not be handled by the view, but would be sent back to the controller.

What you are describing is MVP - your page is handling the event - even if it is only handing it off to a controller (which is best practice ;)).
 
gboy, I think you are confusing MVC with MVP. The two, while similar (MVP is a derivative of MVC), are quite different where the view/presenter is concerned.

Web Forms cannot truly implement MVC due to the way it handles callbacks. In MVP the presenter handles events (like button clicks, etc.), which is how Web Forms works. In true MVC the button click event would not be handled by the view, but would be sent back to the controller.

What you are describing is MVP - your page is handling the event - even if it is only handing it off to a controller (which is best practice ;)).

Yup - was thinking the same. I implement an MVP-derived scenario using Web Forms. Works well for me right now. I want to move over to "true" ASP.Net MVC for my next project...
 
Raithlin pretty much covered it (considerably more eloquently). :)
 
Top
Sign up to the MyBroadband newsletter
X