You are previewing SignalR Blueprints.
O'Reilly logo
SignalR Blueprints

Book Description

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

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.

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

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. SignalR Blueprints
      1. Table of Contents
      2. SignalR Blueprints
      3. Credits
      4. About the Author
      5. Acknowledgments
      6. About the Reviewers
      7. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      8. Preface
        1. What is the state of the Web?
        2. Personal style
        3. What this book covers
        4. Who this book is for
        5. What you need for this book
        6. Conventions
        7. Reader feedback
        8. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      9. 1. The Primer
        1. Where are we coming from?
          1. The terminal
          2. Fast forwarding
          3. Completing the circle
          4. SignalR
        2. Terminology
          1. Messaging
          2. Publish/Subscribe
          3. Decoupling
        3. Patterns
          1. Model-View-Controller
          2. Model-View-ViewModel
          3. Command Query Responsibility Segregation
        4. Libraries and frameworks
          1. jQuery
          2. ASP.NET MVC 5
          3. KnockoutJS
          4. Bifrost
        5. Making it look good – using Twitter bootstrap
        6. Tools
          1. Visual Studio 2013
          2. NuGet
        7. Summary
      10. 2. Overheating the Discussion
        1. The goal – how to create a basic forum discussion site
          1. Hub
        2. Getting started – creating an MVC template
          1. Creating the landing page for our forum
          2. Setting up the packages
        3. Preparing our web application for SignalR
          1. Making your SignalR hubs available for the client
          2. How to add JavaScript references to views
          3. Creating a simple template mechanism
          4. Securing the forum
        4. How to create your UI for threads on your forum
          1. Creating the thread list – adding a table
          2. Adding a modal for creation of new threads
          3. Enabling the interaction for the view
          4. Creating threads
        5. Our first hub – threads
          1. Enabling the data access for threads
          2. Making the threads become visible
          3. Hooking up the user interaction
        6. The detail view – posts on specific threads
          1. Navigating to a thread to see the posts
          2. Adding the view content for a thread
          3. Adding the thread view logic
        7. Summary
      11. 3. Extra! Extra! Read All About It!
        1. The goal – how to bring to life an imagined news site
        2. Getting started – creating an MVC template
          1. Setting up the packages
            1. Making any SignalR hubs available for the client
        3. Creating the models
        4. Putting in place the Data Access Layer
        5. The look and feel
          1. Templating
          2. Hubs
          3. Layout
          4. The landing page
            1. The content
        6. The magic code
        7. The newsroom
        8. Finding the needle in the haystack
        9. Master/detail – navigation
        10. Summary
      12. 4. Can You Measure It?
        1. The goal – an imagined dashboard
        2. Decoupling it all
        3. Back to basics
          1. Setting up the packages
            1. Making any SignalR hubs available for the client
        4. Knocking it out of the park
        5. Our single page
        6. The server side of things
          1. The hub
          2. Naively dealing with requests
        7. Bringing it all back to the client
          1. ViewModel
          2. BindingHandler
          3. View
        8. Trying it all out
        9. Summary
      13. 5. What Line of Business Are You In?
        1. The goal – a simple line of business
        2. Decoupling – the next level
        3. Proxy generation
        4. Composing the UI
        5. Convention over configuration
        6. Getting assimilated
          1. Getting the packages
          2. The single page
        7. Composing
          1. Structure
          2. Feature
            1. The hub
            2. Register
            3. List
            4. Completing the composition
        8. Concurrency and staleness
        9. Summary
      14. 6. An Architectural Taste
        1. The goal – banking
        2. Where does it all start?
          1. Bounded context
          2. Core domain
          3. Supporting domain
          4. Generic domain
          5. Ubiquitous language
          6. Entity
          7. Value object
          8. Aggregate
          9. Repository
          10. Domain events
          11. Domain services
        3. Structure
        4. Command Query Responsibility Segregation
          1. Bifrost
          2. Command
          3. CommandHandler
          4. Validation
          5. Business rules
          6. Security
          7. Events
          8. EventSource
          9. AggregateRoot
          10. EventSubscriber
          11. ReadModel
          12. Query
          13. Proxies
          14. Getting started
          15. Getting the packages
          16. The page
          17. Structure
        5. Accounts overview
          1. Concepts
          2. Read model and queries
          3. Defaults
          4. View and ViewModel
          5. Domain
            1. Command
            2. Events
              1. AggregateRoot
            3. CommandHandler
          6. Back to the frontend
          7. Input validation
          8. Business rules
          9. EventSubscriber
        6. Summary
      15. 7. The Three Screens – Mobile First
        1. XAML
          1. Binding
        2. The goal – mobile banking
          1. Getting started
          2. Getting the packages
          3. Plumbing
          4. Bringing back the Web
          5. Extending the hub
          6. Pivoting
          7. Our first ViewModel
        3. Accounts
          1. Overview
          2. Transfer
          3. Putting it all into the composition
          4. What about that SignalR?
          5. Making it a bit more useable
          6. Grand finale – running it all
        4. Summary
      16. 8. Putting the X in .NET – Xamarin
        1. The goal – rinse and repeat
          1. Getting started
          2. Getting the packages
        2. Features
          1. Overview
          2. Bringing back the Web
          3. Running things
        3. Summary
      17. 9. Debugging or Troubleshooting
        1. Logging
          1. Server
          2. The JavaScript client
          3. The .NET client
          4. Windows Phone 8.x client
        2. Going deeper
          1. Fiddler
          2. Performance counters
          3. The browser
        3. Summary
      18. 10. Hosting and Deployment
        1. Self-hosting
          1. The packages
          2. The code
          3. The client
        2. Scaling out
          1. SQL Server
          2. Redis
          3. Azure
        3. Summary
      19. Index