Book Image

SignalR Blueprints

By : Einar Ingerbrigsten
Book Image

SignalR Blueprints

By: Einar Ingerbrigsten

Overview of this book

Table of Contents (18 chapters)
SignalR Blueprints
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
9
Debugging or Troubleshooting
Index

Libraries and frameworks


We will not be doing much from scratch in this book as it does not serve our purpose. Instead, we will be relying on third-party libraries and frameworks to do things for us that don't have anything to do with the particular thing we will perform. The range of libraries will be big and some of these represent architectural patterns and decisions sitting behind them. Some of these are in direct conflict with each other and for consistency in your code base, you should be picking one over the other and stick to it. The chapters in this book will make it clear what I consider as conflict and why and what libraries are right for you, whereas your architecture is something you will have to decide for yourself. This book will just show a few of the possibilities.

jQuery

Browsing the Web for JavaScript-related topics often yields results with jQuery mentioned in the subject or in the article itself. At one point, I was almost convinced that JavaScript started with $, followed by a dot, and then a function to perform. It turns out that this is not true. jQuery just happens to be one of the most popular libraries out there when performing web development. It puts in place abstractions for parts that are different between the browsers, but most importantly, it gives you a powerful way to query the Document Object Model (DOM) as well as modify it as your application runs. A lot of the things jQuery has historically solved are now being solved by the browser vendors themselves by being true to the specifications of the standards, along with the standards. Its demand has been decreasing over the years, but you will find it useful if you need to target all browsers and not just the modern ones. Personally, I would highly recommend not using jQuery as it will most likely lead you down the path of breaking the SOLID principles and mixing up your concerns.

Note

SignalR has a dependency on jQuery directly, meaning that all the web projects in this book will have jQuery in them as a result.

ASP.NET MVC 5

Microsoft's web story consists of two major and different stories at the root level. One of these is the story related to web forms that came with the first version of the .NET Framework back in 2002. Since then, it has been iteratively developed and improved with each new version of the framework. The other is the MVC story, which was started in 2007 with the version 1 release in 2009 that represents something very different and built from the ground up from different concepts than found in the web forms story. In 2014, we saw the release of version 5 with quite a few new ideas, making it even simpler to do the type of decoupling one aims for and also making it easier to bring in things (such as SignalR). We will use ASP.NET MVC for the first samples, not taking full advantage of its potential, but enough to be able to show the integration with SignalR and how you can benefit from it.

KnockoutJS

It seems that over the last couple of years, you can pretty much take any noun or verb and throw a JS behind it, Google it, and you will find a framework at the other end of it. KnockoutJS (http://www.knockoutjs.com) represents a solution to MVVM for JavaScript in the web browser. It's a focused library with the aim of solving the case of having views that are able to observe your ViewModel. It also takes advantage of any behavior being exposed.

Bifrost

In some of the chapters, a platform called Bifrost (which you can access at http://bifrost.dolittle.com/) will be used. It's an end-to-end opinionated platform that focuses on CQRS and MVVM. It also shows a few other things, such as convention over configuration (http://www.techopedia.com/definition/27478/convention-over-configuration), along with a few ways of decoupling your software. The platform is open sourced and it's worth mentioning that I am the lead developer, visionary, and initiator of the project. The project got started in 2008 as a means to solve business cases while working on different projects.

Note

Within Bifrost, you will only find things that are based on real business value, rather than imagined solutions to problems that have never been experienced.

When Bifrost is applied, there are other dependencies it pulls in as well, which will be discussed when they are being used. A few of these dependencies introduce a couple of other aspects of software development and will be explained once they are used.