Contents tagged with pubsub

  • Real-World PubSub Messaging with RabbitMQ

    In my previous post I discussed using RabbitMQ with ASP.NET Web Api subscribers. Now I'd like to expand on that a bit by using a more interesting real-world message along with a message processor on the client side. Continue reading...

  • PubSub Using RabbitMQ with ASP.NET Web API Subscribers

    A long time ago a colleague of mine, Bhaskar Apparajuvenkata, and I used WCF to implement a publish-subscribe system on our local network. (That was blogged here.) Ok it was less than 5 years ago but given the pace of change since then it feels very antiquated. At the time we were having a hard time convincing our infrastructure team to stand up MSMQ for us. This was before the software-as-a-service movement took hold. Back in those days something like a messaging or service bus framework was seen as an enterprise project. You had to have a project sponsor, huge timelines, and of course a big budget. We were a small development team and our needs were modest so at the time we rolled our own. Continue reading...

  • Ales Holecek: Windows 8 Unplugged

    Ales Holecek opened the day at the p&p symposium this morning with a keynote address on Windows 8. Here are my live blogging notes that contain a mixture of his comments and my own commentary as he went along. Holecek is in charge of WinOS 8. He said that mobility was the primary driver for them when they started thinking about WinOS 8 back in 2009. Given that they promoted touch to a first-class citizen. Future releases will be optimized around touch. The holy grail for a future OS is speech but we're not there yet. Continue reading...

  • Greg Young on CQRS

    When Greg Young's talk on CQRS began I was prepared for a long look at patterns, reliability, transactions, MQs with Azure, WCF, and interface contracts and how Microsoft products were the best way to get you from Point A to Point B. But I was wrong. He showed no code. He didn't mention Azure once. In fact, he didn't talk about specific tooling or tech stacks at all. Continue reading...

  • ScheduleWidget Is Now Open Source

    I had no idea that in the few short months since ScheduleWidget went live on NuGet it would be so popular. That tells me that other devs have a real need for the tool just like I did in my own project. That's the good news. The bad news is the feature requests are coming in and I can't support it alone. So she's going open source! I've created a repo and done the initial commit into GitHub. The repo on github.com is here. When I have time there are two features that I want to add: Continue reading...

  • JQuery Mobile Madness with MVC 4 Web API

    In my last post I introduced MVC 4 Web API. In keeping with the spirit of things I'd like to throw a little JQuery Mobile into the mix for fun. As in my previous blog post fire up Visual Studio 11 Beta and create a new MVC 4 Web API project. Last time we posted a plain old string value back to the ValuesController. Now let's post a Widget class back. Go ahead and add this model to the project: Continue reading...

  • Seismic Shifts in Web Development

    Not really. But then again really. What I mean is the role of the web developer is changing fast and it's only been in recent months that I've looked up from my keyboard to see how the ground has shifted substantially. Some developer friends and I have often joked that the back end -- the database, object-relational mapping, domain model, business logic, and the controllers for the UI -- take us about a fraction of the time it takes us to get the UI right. We will sit for hours just to get the HTML right, float div tags, give up and go with the table tag, try again, move on, and so on and on. And now with awesome tools like EF and LINQ it's a breeze to do the sort of plumbing work that used to take weeks.  Continue reading...

  • Pattern Toolkit Builder (VSPAT)

    A few days ago Jezz Santos at Microsoft Consulting announced the release of Pattern Toolkit Builder (VSPAT) for Visual Studio 2010. Why not VSPTB? I think PA originally stood for "pattern automation" and the marketing folks just haven't nailed this down yet. Anyway, this promises to be the sort of game changer I've been looking for in my organization. I remember the software factory idea that the P&P team worked on a few years ago. It sort of died on the vine. The idea with pattern automation or "software factories" is that a very senior developer can create interactive, prescriptive (or merely helpful), project templates that junior developers can use to get started on a new project. The toolkit lets you create guidance and proven patterns in the actual code that gets unpacked from the project template so that junior developers aren't faced with the "blank slate how-do-I-get-started" problem.  Continue reading...

  • Polling with Knockout, JQuery, AJAX, and MVC

    Some colleagues and I have been taking a close look at Knockout, the javascript library that implements the MVVM pattern for rich client UI. Knockout takes advantage of the new custom data attributes (data-*) in HTML 5 to bind declaratively a javascript view model to UI elements. That's pretty cool. But even better, Knockout will update your UI automatically whenever the underlying view model changes. It does this when you declare your model as an observable: Continue reading...

  • ChannelFactory, IDisposable and Handling Faults

    In my last post (Poor Man's Publish-Subscribe WCF Service) I used the ChannelFactory to build a communication channel that I could use to call a WCF service. There's something about that implementation that I wanted to explain in more detail. Notice the try-catch block surrounding the using statement: Continue reading...

  • Poor Man's Publish-Subscribe WCF Service

    I'm going to describe a WCF implementation of a publish-subscribe pattern that is used here at a medium-sized organization where I'm a lead developer. For reasons I won't go into MSMQ and the cloud were not options for us. Yet we needed durability, reliability, and all of the goodness that comes with a service bus. So we rolled our own "poor man's" pub sub (or observer pattern) service a simplified version of which I'll describe here. Continue reading...

  • Simple and Custom Validation in MVC 3

    This is the first of a series on validation and business rules in MVC 3. I'll start out simple and we'll work out way up to the more complex. I'm going to build on the solution created in the previous blog post (Delete Like a Rock Star) so go there and get set up. Continue reading...

  • Delete Like a Rock Star with MVC3, Ajax and jQuery

    Sure you can be a chump and use the out-of-the-box delete functionality that the MvcScaffolding gives you. Or you can use a little jQuery and delete like a rock star. Get your project set up first. Create a new MVC3 web app in Visual Studio 2010. If you have SP1 you have a choice now: internet or intranet. I'll assume we're creating an internet app but it doesn't matter really. Next add a new model called Widget: Continue reading...

  • Render HTML for Menu in MVC 3 Using SiteMapProvider

    There are several good jQuery menu plugins but I like the old skool ASP.NET SiteMapProvider because I can declare my app roles in there and get security trimming for free. Add and configure the default XmlSiteMapProvider or customize one to override the IsAccessibleToUser method. Your choice. Then add this MenuHelper static class to your project:  public static class MenuHelper { public static MvcHtmlString Menu(this HtmlHelper helper) { var sb = new StringBuilder();  sb.Append("<ul id='nav'>");  // Render each top level node var topLevelNodes = SiteMap.RootNode.ChildNodes; foreach (SiteMapNode node in topLevelNodes) { sb.AppendLine("<li>");  sb.AppendFormat("<a href='{0}'>{1}</a>", node.Url, helper.Encode(node.Title)); if (node.HasChildNodes) { sb.AppendLine("<ul>"); foreach (SiteMapNode childNode in node.ChildNodes) { sb.AppendLine("<li>"); sb.AppendFormat("<a href='{0}'>{1}</a>", childNode.Url, helper.Encode(childNode.Title)); sb.AppendLine("</li>"); } sb.AppendLine("</ul>"); }  sb.AppendLine("</li>"); }  // Close unordered list tag sb.Append("</ul>");  return new MvcHtmlString(sb.ToString()); } } If this is the first helper for the project then add the namespace where your MenuHelper class lives to your Views Web.config file: <system.web.webPages.razor> <host factoryType="System.Web.Mvc. … Continue reading...

  • More Awesomeness: Post JSON to an Action Method

    Fortunately I came late to the party and didn't develop MVC 2 web apps. I understand that back in those ancient days (about 6 months ago) you had to walk uphill both ways to post JSON data back to an action method. Phil Haack has a great blog post on the topic. Basically, you had to write a custom filter, register a JsonValueProviderFactory in application startup, and decorate your action method with the JSON serializer attributes. What a pain. In MVC 3 it's super easy to use AJAX to post JSON back to an action method. Here are the steps. Continue reading...