RE: WCF service best practises
What about the death of WCF as everything else in the modern technological landscape seems to be dying? Is WCF another one? Sorry to butt in, but I figure why waste your time? Or are you wasting it? Is WCF still common and worth learning? From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg Keogh Sent: Wednesday, January 30, 2013 5:08 PM To: ozDotNet Subject: WCF service best practises Folks, I have created the stub of a WCF service that I've sanity checked is working okay when hosted in IIS, Azure, a Windows Service and even the command promt. It will be consumed by desktop apps and Silverlight. The initial code came out of the VS2012 new project template and I just started adding methods. It mostly moves plain POCO and DTO classes back-and-forth to manipulate a database. Before I go any further, I just wanted to check here that I'm not missing any recent advances in techniques for writing WCF services that will future proof it, follow best practises and make life easier for myself. So I'm just fishing for general comments from anyone who was written some serious services. Web searches produce these links, but I haven't had time to digest them yet: http://bloggingabout.net/blogs/gerben/archive/2010/02/01/wcf-best-practices.aspx http://www.codeproject.com/Articles/317232/How-to-Build-Flexible-and-Reusable-WCF-Services http://www.devproconnections.com/article/windows-communication-foundation-wcf2/Implementing-SOA-Patterns-with-WCF-and-NET-4-0-125163 (and many more) Greg
Re: WCF service best practises
What about the death of WCF as everything else in the modern technological landscape seems to be dying? Is WCF another one? Everything that dies has to be replaced in some form or another. If WCF is dying, what's its replacement? If I want to publicly expose my .NET service over the wire, what else can I use? SOAP, Sockets, Remoting, REST, two tin cans and a string? I'm I missing some gossip about sweeping changes in this area? If anyone knows, please speak up. Greg
Re: WCF service best practises
ASP.NET WebAPI seems to be the new hotness. I don't have much experience with WCF, but everyone I talk to says it is too heavy and complicated. WebAPI tries to simplify things. On Fri, Feb 1, 2013 at 7:50 AM, Greg Keogh g...@mira.net wrote: What about the death of WCF as everything else in the modern technological landscape seems to be dying? Is WCF another one? Everything that dies has to be replaced in some form or another. If WCF is dying, what's its replacement? If I want to publicly expose my .NET service over the wire, what else can I use? SOAP, Sockets, Remoting, REST, two tin cans and a string? I'm I missing some gossip about sweeping changes in this area? If anyone knows, please speak up. Greg
RE: WCF service best practises
http://xkcd.com/927/ Cheers Ken From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg Keogh Sent: Friday, 1 February 2013 8:53 AM To: ozDotNet Subject: Re: WCF service best practises They've been flogging WebAPI in recent MSDN magazines, but I got the impression that it's just REST more formalised with contracts. Perhaps this makes sense from the hints I've been reading. WCF is heavy and complicated and over-engineered to be general purpose (which is fine and I've benefited from that). REST is consumable by everyone, but it's a typeless mess. Putting some structure over REST and giving it a name sounds like a typical progression. Oh well, I'd better start converting my brand new code to yet another standard. You can't have too many standards I reckon. Greg
RE: New Web API project
Thank you for the clarification, guys. My thing, since I'm planning to become an open source developer, still, I think that even if I am developing for open source, if I am happy, then I'll keep one project in one technology if it is working for me, and then I'll offer a port of it in the other platform or something like that so that people can choose which project they feel more comfortable using. Or I'll just choose whichever one works. I feel that there is no reason to change a project that is working just for the heck of it, but that's me. But, the good news is that it doesn't look like YAF will be moving since there is now a rival forum written in ASP.net MVC right now. So it would be stupid for them to do that. And considering they are commercial as well. And speaking of ASP.net MVC though, I have noticed that not many people use the standard ASPX view, do they? I mean, what's so special about razor if razor is sort of backtracking to the ASP days? I mean, C# within HTML tags? Come on, people. Go back to VBScript if you're going to do that. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Heinrich B Sent: Thursday, January 31, 2013 11:25 PM To: ozDotNet Subject: Re: New Web API project this might help: http://www.west-wind.com/weblog/posts/2012/Aug/07/Where-does-ASPNET-Web-API-Fit On Fri, Feb 1, 2013 at 12:35 PM, Katherine Moss katherine.m...@gordon.edumailto:katherine.m...@gordon.edu wrote: Yes, WebAPI is wrapped inside of MVC4. And there's another thing that just makes me mad; when people want to rewrite their application for the heck of it just so that they can be deployed under the latest fad. The folks from Yet Another Forum are now saying that their project could be moved and rewritten as ASP.net MVC too, and for what? To look cool? Apparently, and what's wrong with a project that is written in Web Forms and doing fine? I'm sorry, but I don't get it. And once that changes, if it does, other folks who use YAF will be screwed including those at Sueetie, who make a great product all based on Web Forms. Though web forms and MVC can work together, though it's not as simple as one would think. If you want MVC, then use Web Forms MVP. And who said WCF is pointless middleware? Isn't it a good way to create web services? And if not for WCF, what's next? Back to ASMX from 2006? Come on! Anyway, guys, I'm sorry for the rant, but I had to get it out somewhere, right? From: ozdotnet-boun...@ozdotnet.commailto:ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.commailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg Keogh Sent: Thursday, January 31, 2013 7:50 PM To: ozDotNet Subject: Re: New Web API project Thanks, glad to know I'm not alone, that link looks sensible and will save a lot of suffering -- Greg -- Heinrich Breedt Do not wait to strike till the iron is hot; but make it hot by striking. - William B. Sprague
Re: New Web API project
I think you have the wrong idea about MVC. Razor Views specifically: It all gets executed server side. You certainly dont have to use it. These days I do a lot of knockout pages with hardly any razor in them, sometimes not at all. It can look a lot like old asp i guess, and with all things it can lead to spaghetti code. But I much prefer to be close to the metal with my html. Much better than serverside controls and writing html inside page response. And if i never have to deal with the page lifecycle it will be too soon. On Fri, Feb 1, 2013 at 3:19 PM, Katherine Moss katherine.m...@gordon.eduwrote: Thank you for the clarification, guys. My thing, since I’m planning to become an open source developer, still, I think that even if I am developing for open source, if I am happy, then I’ll keep one project in one technology if it is working for me, and then I’ll offer a port of it in the other platform or something like that so that people can choose which project they feel more comfortable using. Or I’ll just choose whichever one works. I feel that there is no reason to change a project that is working just for the heck of it, but that’s me. But, the good news is that it doesn’t look like YAF will be moving since there is now a rival forum written in ASP.net MVC right now. So it would be stupid for them to do that. And considering they are commercial as well. And speaking of ASP.net MVC though, I have noticed that not many people use the standard ASPX view, do they? I mean, what’s so special about razor if razor is sort of backtracking to the ASP days? I mean, C# within HTML tags? Come on, people. Go back to VBScript if you’re going to do that. ** ** *From:* ozdotnet-boun...@ozdotnet.com [mailto: ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Heinrich B *Sent:* Thursday, January 31, 2013 11:25 PM *To:* ozDotNet *Subject:* Re: New Web API project ** ** this might help: http://www.west-wind.com/weblog/posts/2012/Aug/07/Where-does-ASPNET-Web-API-Fit ** ** On Fri, Feb 1, 2013 at 12:35 PM, Katherine Moss katherine.m...@gordon.edu wrote: Yes, WebAPI is wrapped inside of MVC4. And there’s another thing that just makes me mad; when people want to rewrite their application for the heck of it just so that they can be deployed under the latest fad. The folks from Yet Another Forum are now saying that their project could be moved and rewritten as ASP.net MVC too, and for what? To look cool? Apparently, and what’s wrong with a project that is written in Web Forms and doing fine? I’m sorry, but I don’t get it. And once that changes, if it does, other folks who use YAF will be screwed including those at Sueetie, who make a great product all based on Web Forms. Though web forms and MVC can work together, though it’s not as simple as one would think. If you want MVC, then use Web Forms MVP. And who said WCF is pointless middleware? Isn’t it a good way to create web services? And if not for WCF, what’s next? Back to ASMX from 2006? Come on! Anyway, guys, I’m sorry for the rant, but I had to get it out somewhere, right? *From:* ozdotnet-boun...@ozdotnet.com [mailto: ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Greg Keogh *Sent:* Thursday, January 31, 2013 7:50 PM *To:* ozDotNet *Subject:* Re: New Web API project Thanks, glad to know I'm not alone, that link looks sensible and will save a lot of suffering -- Greg ** ** -- Heinrich Breedt “Do not wait to strike till the iron is hot; but make it hot by striking.” - William B. Sprague -- Heinrich Breedt “Do not wait to strike till the iron is hot; but make it hot by striking.” - William B. Sprague
Web api
Hey all, While we are on the subject of MVC, I was looking about for an example or walkthrough of how you might call a Rest Web API from an MVC app. Not found much so far. I found a console C# app that uses the Asp.Net Web API Client libraries to call one. I've also found some examples of how to write the Web API's using MVC. So am scratching my head.. what httpX namespace is the right one to use? HttpClient? something else? cheers, Stephen
RE: Web api
You might like to try something like RestSharp ( http://restsharp.org/ ) - it has some very nice helpers for adding request parameters and additional headers. I haven't used it extensively, but for the times I have used it, it made the whole process pretty painless. Regards, Mark. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Stephen Price Sent: Friday, 1 February 2013 4:38 PM To: ozDotNet Subject: Web api Hey all, While we are on the subject of MVC, I was looking about for an example or walkthrough of how you might call a Rest Web API from an MVC app. Not found much so far. I found a console C# app that uses the Asp.Net Web API Client libraries to call one. I've also found some examples of how to write the Web API's using MVC. So am scratching my head.. what httpX namespace is the right one to use? HttpClient? something else? cheers, Stephen
Re: New Web API project
There are advantages of using MVC for open-source software: - You don't have to deal with the web-forms 'generated' naming conventions of rendered HTML which can make it hard to integrate with JavaScript frameworks - You have greater control over the HTML, which means it's easier to implement open-source HTML frameworks such as HTML5 Boiler Plate, or Foundation 3. - You're not reliant on ASP's rendering of server controls, so it's easier to write standards compliant HTML - There is better separation of concerns between the view code and logic, which leads to better transparency - always helpful when working in disparate teams like in the Open Source community. - Testability: Unlike Web-Forms that are difficult to automatically test; MVC makes testing frameworks first-class citizens, and the boon from this cannot be understated: . You can regression test at the click of a button - almost essential when others are poking around with your code. . It can also be used as a 'contract' when working with other developers - you know what is implemented and working, and what is not. . I find Testable code is also better designed code: you think about separation of concerns and dependencies much more . There's nothing like getting to 'code freeze' and finding you have to do a re-design due to uncovering a fundamental flaw. With a test suite to back you up, re-factoring your design is far less scary. On 1 February 2013 13:47, Heinrich Breedt heinrichbre...@gmail.com wrote: I think you have the wrong idea about MVC. Razor Views specifically: It all gets executed server side. You certainly dont have to use it. These days I do a lot of knockout pages with hardly any razor in them, sometimes not at all. It can look a lot like old asp i guess, and with all things it can lead to spaghetti code. But I much prefer to be close to the metal with my html. Much better than serverside controls and writing html inside page response. And if i never have to deal with the page lifecycle it will be too soon. On Fri, Feb 1, 2013 at 3:19 PM, Katherine Moss katherine.m...@gordon.edu wrote: Thank you for the clarification, guys. My thing, since I’m planning to become an open source developer, still, I think that even if I am developing for open source, if I am happy, then I’ll keep one project in one technology if it is working for me, and then I’ll offer a port of it in the other platform or something like that so that people can choose which project they feel more comfortable using. Or I’ll just choose whichever one works. I feel that there is no reason to change a project that is working just for the heck of it, but that’s me. But, the good news is that it doesn’t look like YAF will be moving since there is now a rival forum written in ASP.net MVC right now. So it would be stupid for them to do that. And considering they are commercial as well. And speaking of ASP.net MVC though, I have noticed that not many people use the standard ASPX view, do they? I mean, what’s so special about razor if razor is sort of backtracking to the ASP days? I mean, C# within HTML tags? Come on, people. Go back to VBScript if you’re going to do that. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Heinrich B Sent: Thursday, January 31, 2013 11:25 PM To: ozDotNet Subject: Re: New Web API project this might help: http://www.west-wind.com/weblog/posts/2012/Aug/07/Where-does-ASPNET-Web-API-Fit On Fri, Feb 1, 2013 at 12:35 PM, Katherine Moss katherine.m...@gordon.edu wrote: Yes, WebAPI is wrapped inside of MVC4. And there’s another thing that just makes me mad; when people want to rewrite their application for the heck of it just so that they can be deployed under the latest fad. The folks from Yet Another Forum are now saying that their project could be moved and rewritten as ASP.net MVC too, and for what? To look cool? Apparently, and what’s wrong with a project that is written in Web Forms and doing fine? I’m sorry, but I don’t get it. And once that changes, if it does, other folks who use YAF will be screwed including those at Sueetie, who make a great product all based on Web Forms. Though web forms and MVC can work together, though it’s not as simple as one would think. If you want MVC, then use Web Forms MVP. And who said WCF is pointless middleware? Isn’t it a good way to create web services? And if not for WCF, what’s next? Back to ASMX from 2006? Come on! Anyway, guys, I’m sorry for the rant, but I had to get it out somewhere, right? From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg Keogh Sent: Thursday, January 31, 2013 7:50 PM To: ozDotNet Subject: Re: New Web API project Thanks, glad to know I'm not alone, that link looks sensible and will save a lot of suffering -- Greg -- Heinrich Breedt “Do not wait to strike till the iron is hot; but