1

I've been a .NET guy from the get go in my career, but within my work experience I have yet to venture out into the world of WCF or MVC. I think the difference is more framework / convention based with respect to WCF and MFC, correct me if I'm wrong.

But, what I'm really wondering is this: Is it correct to say that WCF is to MVC as the regular ASP.NET WebServices are to the regular ASP.NET Web Apps? As in, WCF and MVC should be used together and regular ASP.NET WebServices and regular ASP.NET Web Apps should be used together? Or is it ok to intermix any combination of the 4?

Also, why would one not want to upgrade to WCF and / or MVC?

Code Maverick
  • 20,171
  • 12
  • 62
  • 114
  • I think this question is bad because so much of the answer is based on the project you are developing and its requirements. I also think your individual questions are probably dupes such as diff between MVC and WCF and when you'd want to use them. – John Farrell Apr 21 '11 at 18:24
  • 3
    @jfar - Well, I disagree. Don't be an ass. It can be as general or as specific as one needs it to be. Who doesn't apply answers to their own situation. That's dumb logic in and of itself by you. – Code Maverick Apr 21 '11 at 18:46
  • Sigh. There are question guidelines. Check them out. Your question fails several of them and in my opinion it should be closed. http://stackoverflow.com/faq Your question is also numerous dupes mushed together. If you broke apart this question I think 99% of what you asked would be covered. – John Farrell Apr 21 '11 at 20:05
  • For example: http://stackoverflow.com/questions/351334/web-service-vs-wcf-service - http://www.google.com/search?q=when+should+i+use+wcf+site%3Astackoverflow.com - http://stackoverflow.com/questions/102558/biggest-advantage-to-using-asp-net-mvc-vs-web-forms – John Farrell Apr 21 '11 at 20:08
  • 1
    @jfar - First of all, your examples were 3 years old. One can hardly rely on articles or questions that are even a year old. Secondly, I did look at a few questions before posting, but I still felt the need to interact with knowledgeable people in my own terms. I'm getting sick and tired of you SO elitists getting in the way of positive feedback. If you want to troll around and be negative, that's your prerogative. If you want to discourage people from asking questions, keep it up. – Code Maverick Apr 21 '11 at 20:43
  • @Scott - Your question is not time sensitive. The answers here are equivalent to the answers of existing questions. - Interesting a person who calls another an ass and elitist starts ranting about how to make SO a better place. That kind of behavior is certainly not it. – John Farrell Apr 21 '11 at 21:02
  • 1
    @jfar - Since I stated that I hadn't gotten into either WCF or MVC yet, how would I know that the question wouldn't have changed or altered slightly between MVC 1.0 and 3.0. My point is that it should be ok for me to re-visit a topic, based on the fact that it was introduced 3 years ago, and that there could be new or varying opinions out there regarding the subject. Not to mention, it allows me direct interaction with people in the know. Reading questions 3 years old doesn't help me do that. – Code Maverick Apr 21 '11 at 21:16
  • @Scott - Discussion questions are discouraged in the FAQ. Considering the available information in the related sidebar ( some of which is slightly older than one year ), which also appears when you asked this question, a good question would have been "Has anything changed in WCF or MVC or asmx WebServices that would change my decision to pick one of the other?" Even that should probably be broken up into "Anything change in MVC 3 that makes it more useful?" But then again, once you break down your question you just get into duplicates again. – John Farrell Apr 21 '11 at 21:56
  • @jfar - If I had the privilege for community wiki, I would've done that. I understand the FAQ. If I would've asked your proposed question, it would assume that I already had a knowledge of the previous versions, which I do not. Ultimately my questions covered all versions. I don't want to keep arguing. I want the interaction with the community and their thoughts past, present, and future on this topic. That's what I'm getting, therefore I feel my question is a valid one. – Code Maverick Apr 21 '11 at 22:17

5 Answers5

2

That is wrong.

WCF is more than web services. ASP.NET MVC is primarily used for the web.

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
2

MVC is a convention based approach to ASP.NET web apps. I think you are correct there.

That analogy does not hold between ASP.NET web services and WCF, IMO.

Both ASP.NET web services and WCF are convention based programming paradigms. For e.g. both frameworks will match your SOAP call to a method implementation based on the name. Both will serialize data in the payload to your object model based on structure and field names, etc.

WCF provides a unified programming model for different transport types - TCP, named pipes, MSMQ, HTTP etc. It gives you more control over how your service is hosted. It gives you more control over how the payload is encoded.

I think it would be more accurate to say that WCF is a unification of .NET Remoting and ASP.NET WebServices, with great improvements in extension points.

Hope this helps.

Naraen
  • 3,240
  • 2
  • 22
  • 20
2

No, that analogy isn't correct, and yes, you can mix and match the technologies.

WCF vs. Web Services

Windows Communication Foundation is a framework for building service oriented applications, that handles a lot of plumbing for you out of the box (security, transactions, reliability, interop, etc). It's much more than just web services, though it does web services very well. So there really is very little comparison to web services, WCF is far superior.

MVC vs. Webforms

Both are viable options, both have relative strengths and relative weaknesses. They also are not mutually exclusive. You would NOT want to "upgrade" (it's not upgrading, it's changing) to MVC if your application is working perfectly fine on webforms, and your development team is productive on that platform. In this case there isn't any real world benefit to changing.

If however you are starting a new project, then you have to look at your development team and make a decision based on their skill set. Personally, if my development team has MVC experience, I choose MVC, but that does not mean that there is anything wrong with webforms.

BrandonZeider
  • 8,014
  • 2
  • 23
  • 20
  • @Brandon - Great points. Kind of what I was thinking in terms of MVC. Not really upgrade more so than a lateral move that forces developers into a convention based methodology. – Code Maverick Apr 21 '11 at 18:14
  • 1
    yep - MVC definitely has benefits over webforms, but RAD is not really one of them (yet anyways). Your team will likely be more productive on webforms, at least initially. Some other benefits of MVC are separation of concerns, TDD, no ViewState and no PostBack events. – BrandonZeider Apr 21 '11 at 18:20
  • 1
    MVC != RAD is a myth and completely un-true. – John Farrell Apr 21 '11 at 18:27
  • @jfar - So you are saying MVC is a RAD methodology? – Code Maverick Apr 21 '11 at 18:58
  • 1
    Also, not really sure I grasp what the downvote was for on this answer? Does the down-voter want to leave a comment as to why? – Code Maverick Apr 21 '11 at 18:59
  • @jfar - take a look at this thread, and re-read my answer and responses...I prefer MVC, but I'm also realistic. http://stackoverflow.com/questions/102558/biggest-advantage-to-using-asp-net-mvc-vs-web-forms – BrandonZeider Apr 21 '11 at 19:09
  • @BradonZeider - WebForms RAD comes at a huge code quality cost and the quintessential drag a gridview example doesn't hold up well compared to the tooling already in MVC3. With WebForms to get RAD you also have to throw away any good coding practices. With MVC the RAD features always give you a clean separation of concerns regardless if you use the quick tooling. WebForms is also not very intuitive for any experienced web developer. MVC makes sense especially if you've came from a previous PHP/RoR/Django background. MVC makes it simple to get data into HTML. WebForms, not so much. – John Farrell Apr 21 '11 at 19:59
  • @jfar - I couldn't disagree more. You don't have to throw away good coding practices if you want to use webforms, come on man. No good coding practices existed/exist today in webforms applications? That's a bit ridiculous. Sounds like you just need more experience/expose to well written applications. Not all webforms apps are crap. I understand the MVC fanboyism, I really do...I love MVC! But if your team already knows webforms and not MVC, and/or you have an existing webforms app, then it doesn't make sense to switch. So really you voted me down because of the RAD COMMENT, not my answer huh? – BrandonZeider Apr 21 '11 at 20:11
  • @jfar - And PHP/RoR/Django have nothing to do with @Scott's question. – BrandonZeider Apr 21 '11 at 20:13
  • @BradeonZeider - You are missing the point. RAD webforms is using drag and drop from the toolbox with those clunky dataobject control. Outside of the drag and drop coding technique WebForms is not faster than MVC at all. Your !IsPostBack code is remarkable similar to your [HttpPost] controller code. Normal WebForm usage is also very hard to unit test if you are not using the MVP pattern which is wordy and clunky by itself. And just an FYI, I work with WebForms everyday. – John Farrell Apr 21 '11 at 20:17
  • @jfar - you're missing the point. We can disagree on which platform offers the greatest level of RAD, that's fine...but you voted my answer down because you disagreed with my comment. Your comments about "drag and drop" with "clunky dataobject control" and "throwing away good coding practices" show your ignorance on the subject. – BrandonZeider Apr 21 '11 at 20:26
  • My independent opinion is this a good, perhaps the best, answer to a fairly open-ended question. To downvote it is nonsensical. – Lisa Apr 22 '11 at 05:25
1

I don't really think there is an analogical relationship between the respective pairs of technologies.

Windows Communication Foundation is a framework for sending and receiving data across a network channel that supports multiple transport and application protocols. Contrast this to ASP.NET Web Services, which really only supports RPC over HTTP(S).

ASP.NET MVC is a web application framework that represents Microsoft's implementation of the Model-View-Controller design pattern. So, really, it's sort of a specialized type of ASP.NET Web Application, and not a replacement for (or analog to) ASP.NET Web Apps.

Brian Driscoll
  • 19,373
  • 3
  • 46
  • 65
  • So basically, there's no benefit to use MVC other than the design/convention pattern that forces you into a tiered system? – Code Maverick Apr 21 '11 at 17:52
  • @Scott That's one way of putting it. I'd say that like any technology, you should use ASP.NET MVC when it's appropriate and don't use it when it isn't, and just leave it there. MS developed the framework because the vast majority of n-tier web-based information systems could/should follow that pattern. – Brian Driscoll Apr 21 '11 at 17:56
  • I'm just thinking in terms of my company, if it would be wise to move to MVC. We currently use a n-tiered system of sorts. We use CodeSmith to generate our Data objects from SQL 2008 into a Data project. We have a Business project that houses all of our organizational rules/logic/workflows. For the most part our presentation layer is as it should be, just for presenting data, although it's really hard to keep it that way. We have more layers, but you get the point. – Code Maverick Apr 21 '11 at 18:10
  • @Scott - Saying that using MVC because you get tiers is the only reason is a bad answer. Here are some more reasons. MVC is easily customizable to handle new conventions, the various RAD DisplayFor and EditorFor templates, the inherent testability, the ease at which you can support XML/JSON alongside HTML, the improved Razor view engine, the DI friendlyness and the lack of ViewState... etc... – John Farrell Apr 21 '11 at 21:59
  • Agree MVC is a specialised framework for ASP.NET webapps but I think it is publicly perceived as the next step or a "step up". As jfar says, the inherent testability (separation of view and view controller logic) is a really important improvement from plain ASP.NET. I would also point out that for newcomers to ASP.NET, being able to work primarily with plain HTML/JS instead of ASPX markup is also an advantage. – Lisa Apr 22 '11 at 05:31
0

No not really, only in the sense that WCF and MVC are newer technologies.

WCF is a comprehensive communication framework that includes and supersedes old ASP.NET web services. It has no direct relationship with MVC. If you're building a service application from scratch tomorrow, you'd use WCF.

ASP.NET MVC and ASP.NET Web Forms are two different approaches to building web applications. MVC "goes with the grain" of the web, being URI oriented, whilst Web Forms attempts to hide the nature of the web by creating a stateful, WinForms like, programming model. Which you choose to use will come down to the nature of your application and the skills of your developers.

MalcomTucker
  • 7,407
  • 14
  • 72
  • 93