SignalR Blueprints

SignalR Blueprints

Language: English

Pages: 250

ISBN: 1783983124

Format: PDF / Kindle (mobi) / ePub

Build real-time ASP.NET web applications with SignalR and create various interesting projects to improve your user experience

About This Book

  • Learn how to apply real-time communications to your application
  • Understand high-level concepts such as high frequency messaging with SignalR
  • A step-by-step guide with real-world examples to help you develop applications

Who This Book Is For

This book is designed for software developers, primarily those with knowledge of C#, .NET, and JavaScript. Good knowledge and understanding of SignalR is assumed to allow efficient programming of core elements and applications in SignalR.

What You Will Learn

  • Discover how to use SignalR with ASP.NET MVC 5
  • Learn how to apply security to your applications
  • Understand the significance of publish and subscribe models
  • Discover the wonders of Model-View-ViewModel as a frontend pattern
  • Learn how to decouple your applications and really apply the SOLID principles
  • Deploy SignalR and real-time thinking to the mobile space through Windows Phone 8.1 RT
  • Apply Domain Driven Design through Command Query Responsibility Segregation

In Detail

SignalR is an ASP.NET library that enables web developers to add real-time web functionality to ASP.NET applications.

In this book, you'll learn the technical aspects of SignalR and understand why and when you should use SignalR in different use cases. The focus on quality combined with clear, real-world examples will enable you to successfully create your own maintainable software in no time. The book starts by covering the need for SignalR before moving on to its architecture. We'll then take you through the building of a forum that benefits from SignalR. You will also see how to connect your phone as a frontend for SignalR. We will then cover some of the out-of-the-box techniques that you can apply to find out why hosting your solution is vital.

By the end of this book, you will understand the sweet spots of SignalR, and more importantly, how it can be part of improving the user experience.



















using NuGet, as described in Chapter 1, The Primer. Right-click on the References in Solution Explorer, select Manage NuGet Packages, and then type EntityFramework in the search box. Select it and click on install. We'll need a second package, which is the most important one: SignalR. Add a NuGet package reference as shown in the previous step, but this time, type SignalR in the search box. You should now find a package called Microsoft ASP.NET SignalR, select it, and click on Install. This will

later; we'll return to it. However now, let's make sure that the INotifyPropertyChanged interface gets implemented at build time. Add the following using statement at the top of the file: using PropertyChanged; Now, adorn the class with the following attribute: [ImplementPropertyChanged] Make the class look like this: [ImplementPropertyChanged] public class MainPageViewModel { public int SelectedPageIndex { get; set; } } This should now make it possible for the view to observe changes to

the map.MapSignalR() method if that's all we wanted to achieve. However, we want to enable cross-domain access for our server. Although this is not going to be used here, it's important to know if you want to enable any clients from any domain connected to your solution. The first thing we do is enable it through the .UseCors() method. Then, we tell the hub configuration that allows JavaScript clients to connect using a technique called JSONP. This allows web browsers to do cross-domain

increase user experience. Users today are expecting more of our systems, they've grown accustomed to a certain experience they find in solutions such as Facebook and Twitter, and data is delivered almost instantly to them. Through advances in the mobile space, users have raised the bar of expectations in general. This is something even line of business apps should do their best to accommodate. SignalR is not the only implementation. For platforms other than .NET, there are other options as well.

and how you should focus on capturing them while not focusing on technical things. Often, we find ourselves not really modeling the business processes accurately, leading to monster domain models that potentially could bring the entire database into memory. Instead of this, focus on the commands or tasks, if you will, which the user is performing. From this, you will reach different conclusions for things (such as transactional boundaries).Bounded contexts, another huge aspect of DDD, is the idea

Download sample