Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server-side Blazor vs MVC [closed]

From a developer's perspective (and not from an architectural one) I don't seem much of a difference developing between Asp.net MVC and Server-side Blazor apps.

In fact, the server-side Blazor feels almost identical to MVC excluding some of the convenient data-bindings you can do in the blazor views/pages.

Is there a major difference that I may not be aware of? Again, purely from a developer's perspective, not from the underlying technology perspective.

like image 798
AlvinfromDiaspar Avatar asked May 14 '19 03:05

AlvinfromDiaspar


People also ask

Does Blazor follow MVC?

As its name bespeaks, the Blazor MVC project seeks to wed the old Model-View-Controller (MVC) architectural pattern with Blazor. The idea is to provide kind of an on-ramp to Blazor for developers who are familiar with the old MVC pattern (dating to the '70s) and want to get in on the hot new web-dev action.

What is the difference between MVC and Blazor?

Blazor is an alternative to MVC and Razor Pages but with a twist: It's a single-page app framework (SPA) that just happens to use C# instead of JavaScript. Blazor applications can run on the server, or in the browser thanks to Web Assembly (https://www.telerik.com/blogs/goodbye-javascript-hello-webassembly).

Is Blazor server-side or client-side?

Blazor is a web framework for building web UI components (Razor components) that can be hosted in different ways. Razor components can run server-side in ASP.NET Core (Blazor Server) versus client-side in the browser on a WebAssembly-based . NET runtime (Blazor WebAssembly, Blazor WASM).

What is the benefit of using Blazor app over using Razor pages?

The biggest difference between Razor and Blazor is that Razor is a markup language with C#, while Blazor is the framework that lets you run C# code and use the Razor view engine in the browser.


1 Answers

The biggest advantage to server-side Blazor over MVC is that you will be getting the behavior of a single page application (SPA), i.e. rich feeling app with no full page postbacks.

Also in Blazor you are developing components and not Views. Now depending on how you structure you code this may not be of interest, but usually components lead to smaller reusable chunks of UI as opposed to views which tend to be whole pages.

There are potentially more things but they are very opinion based so I'm omitting them here. I hope this helps.

like image 193
Chris Sainty Avatar answered Oct 24 '22 10:10

Chris Sainty