4 ms·
A lot of the people who oppose this technique don't understand context: The right solution to your problem often involves understanding the problem you're tryin
by gwbas1c 2mo ago
A lot of the people who oppose this technique don't understand context: The right solution to your problem often involves understanding the problem you're trying to solve!
In my case, I work on two Blazor websites: One is standard in-browser WASM with Restful JSON (and some CSV) over http; the other is server-side Blazor that uses the websocket technique that this article describes.
The server-side Blazor approach is for an internal web application that has a lot of quick-and-dirty pages that replace what used to be ad-hoc database queries and ad-hoc scripts. It's not an "industrial strength" web application that requires high scalability, because it's only a handful of employees who use it. It's also a joy to work with. To be specific, we don't need to go through the exercise of designing an API, making sure that contracts serialize, ect, ect, just to slap a UI around what used to be a script.
The WASM page that uses Restful JSON (and csv) is our customer-facing web application: JSON (and CSV) help with debugging; but the cost of making an API is very high. Development on the customer-facing web site moves much more slowly, but it's "worth it" for an industrial-strength site.
Would I build a highly scalable website using HTML over a websocket? Maybe. The issue is time to market: Because you don't have to build an API, you can move faster; but I don't know if scalability issues will arise.
- avgDev 2mo agoI also use blazor server for internal web apps. It is fun to work with and development is quick for a C# dev.
- pjmlp 2mo agoWhich kind of proves the point I made elsewhere about ASP.NET Ajax, as Blazor in spirit is a kind of WebForms 2.0/Silverlight.
- gwbas1c 2mo agoHonestly, I didn't do much with webforms other than a "Hello World" project. I hated it; fortunately at the time my paid gig was Winforms. (C# Desktop.) Webforms just hid too much of "the web" to be useful, IMO. Silverlight required a proprietary browser plugin. I wouldn't touch it with a 10-foot pole. Blazor (server-side) doesn't hide the web; although if you need to do things that are "close to the wire"; you should either use the WASM variant or a different stack. Remember, I use server-side Blazor for things that would be ad-hoc queries or scripts, and it's for a website that only a handful of employees use. I'm not sure how it would handle an "industrial strength" massively-scalable application. (At least in that situation, most of the code will port nicely to WASM so you do have an exit strategy that doesn't require a whole rewrite.)