19 CEO Dashboard Examples for Business Leaders
Let's rewind to the 1990s. Data used to be stored on servers and CEOs relied on basic tools to make optimal decisions. No dashboards, nothing. When you use Power BI with a solid...
Kapil Panchal - December 18, 2020
Listening is fun too.
Straighten your back and cherish with coffee - PLAY !
The SPA stands for single-page applications is web applications that load a single HTML page and dynamically update that page as the user interacts with the application.
SPA used AJAX and HTML5 to create fluid and responsive web applications, without constantly reloading the page. However, this means that most of the work is done on the client-side in JavaScript. For a traditional ASP.NET developer, it can be difficult to leap. Fortunately, many open-source JavaScript frameworks make it easy to create a SPA.
Single page application (SPA) is a popular type of web application due to its rich user experience. Incorporating client-side SPA frameworks or libraries, such as Angular or React, with server-side frameworks such as ASP.NET Core can be strenuous. JavaScript services were developed to reduce friction in the integration process. It enables seamless operation between different client and server technology stacks.
In a traditional web application, every time the application makes a call to the server, the server presents a new HTML page. Refreshes a page in this browser. If youever wrote a PHP application or a Web forms application, this page must look amicable with the life cycle.
In SPA, after the first page is loaded, all interaction with the server happens through AJAX calls. This is called Ajax return data - not markup - usually in JSON format. The application uses JSON data to dynamically update the page without reloading the page.
One advantage of SPA is obvious: the app is more fluid and responsive-without the jarringeffect of reloading and re-rendering the page. The second advantage may be less obvious and it worries how you architects a web application.Sharing application data as JSON builds a separationbetween presentation and app logic.
Figure 1: The Traditional Page Lifecycle vs. the SPA Lifecycle
This separationmakes it easy to design and evolve each level. In a well-designed SPA, you can change the HTML markup without touching the code that applies the application logic (at least, that's ideal). You will see it in action when we will discuss data binding.
In pure SPA, all UI interactions occur on the client-side, via JavaScript and CSS. After the initial page load, the server acts purely as a service level. The client only requires to realize what HTTP requests to send. It doesn't matter how the server applies things to the back end.
You can change the entire backend that runs the service, and you won't break the client unless you change the API. The reverse is also true - you can change the entire client application without changing the level of service. For example, you can write to a local mobile client that consumes the service.
MVC pattern dates back to the 1980 and early graphical UIs. The goal of MVC is to factorthe code into three different responsibilities, as shown in Figure2. Here's what they do:
Figure 2: MVC Pattern
A more recent type of MVC is the MVVM pattern (see Figure 3). In MVVM:
Figure 3: MVVM Pattern
In the JavaScript MVVM framework, the view is markup and view model code.
There are many types of MVC, and the literature on MVC is often confusing and contradictory. It is not surprising for the design pattern that began with Smalltalk-76 and is still used in modern web applications. So, it is good to know the theory, the main thing is to understand the particular MVC framework you are using.
Spa Services was developedfor ASP.NET Core as the developer is elevated server-side platform for developing SPA. The services are not required to develop a SPA with ASP.NET core, and it does not lock developers into specific client frameworks.
SPA services provide useful infrastructure such as:
These infrastructure components enhance both development workflow and runtime experience. The components can be adapted individually.
If you want to work with SPA services, install the following:
Node.js with npm (version 6 or later)
To verify that these components are installed and can be found, run the following from the command line:
node -v && npm -v
If deploying to the Azure web site, no action is required - Node.js is installed and available in the server environment.
.NET Core SDK 2.0 or later
On Windows using Visual Studio 2017, SDK is installed by selecting .NET Core Cross-Platform Development Workload
Microsoft.AspNetCore.SpaServices NuGet package
Universal (also known as isomorphic) application is a JavaScript application capable of running both server and client. Angular, React and other admiredframeworks offer a universal platform for this application development method. The idea is to first render the framework components on the server through Node.js, and then delegate further execution to the client.
The Webpack Dev Middleware introduces a streamlined development workflow in which Webpack builds resources on demand. An alternative approach when changing third-party dependencies or custom code is to use the Webpack via the project's npm build script.
build: npm run build:vendor&&npm run build:custom;
Think of Webpack is Hot Module Replacement (HMR) feature as the development of Webpack Dev Middleware. HMR introduces all the same advantages, but it further streamlines the development workflow by automatically updating the page content after integrating the changes. Do not confuse this with browser refresh, which would interfere with the current in-memory status and debugging session of the SPA. Webpack Dev is a live link between the middleware service and the browser, which means browsers change.
In most ASP.NET Core-based SPAs, in addition to server-side routing, client-side routing is always desired. SPA and MVC routing systems can operate independently without interference. However, there is one edge case posing challenges: Identifying 404 HTTP responses.
Consider the scenario in which an extension less root of /some/ page is used. Assume that the request does not pattern-match the server-side route, but its pattern does not match the client-side route. Now consider the incoming request for /images/user-512.webp, which is expected to find the image file on the server. If the requested resource path does not match any server-side route or static file, it is unlikely that the client-side application would handle it - generally returning a 404 HTTP status code is desired.
In this article, we have portrayed about Single page applications in ASP.NET Core.We also introduced some of MVC and MVVM Patterns for example,SPA Services,Server-side prerendering,Webpack Dev Middleware,Hot Module Replacement, and Routing helpers,etc.
Build Your Agile Team
Let's rewind to the 1990s. Data used to be stored on servers and CEOs relied on basic tools to make optimal decisions. No dashboards, nothing. When you use Power BI with a solid...
Imagine walking into a meeting where critical decisions need to be made—fast. You need clear, flexible data that you can analyze on the spot. But what if your insights are locked inside...
Clear insights mean smarter decisions, and this is what data storytelling does. It helps you speak a language that you quickly understand. Like for example, you are a CTO dealing with...