Dusty
Trying to understand MVVM and MVC. Blazor ASP.NET
It depends what you are talking about, you're mixing up a lot of frameworks and design patterns.
- MVVM (Model View Viewmodel) is a design pattern that is usually used in WPF (Windows Presentation Forms) apps, so Windows Desktop Apps
- MVC (Model View Controller) is an old design pattern that is often used in server side renderered web apps where you use controllers and views. ASP.NET Core has an Implementation for that
Now to blazor:
If you wanna build a modern web app, no matter if you have no interactivity, a lot of interactivity or just a little bit, you should use it.
However there are a few different versions of blazor:
- Blazor Server: Everything is computed on the server and the client needs an active websocket connection to the server. It has some drawbacks like delays under load e.g. if user x does action y the browser has to send the request to the server, the server has to compute it and send back HTML over the websocket
- Blazor WASM (Web Assembly): This is your usual SPA (Single Page Application) approach. It works like other JS frameworks (React, VueJS, Angular, Svelte etc.). It's entirely running on the browser via web assembly and gets rendered client side. If you want to get data from a database for example you need to build your own API (usually a RESTful API) for your resources/models which returns JSON responses of them. On the client you send requests to the API, parse the data and render it. You can do the same with Blazor Server, it also acts as an SPA but is implemented not like the other typical SPA frameworks.
- Blazor Web: This is the newest version of Blazor, which supports dynamic rendering on the server or client on a per component level. For new projects this is the one suggested to use. I've personally used it at my company but we've switched back to blazor WASM as we've encountered too many drawbacks/over complicated stuff for a production ready app. So depending on what you build I would suggest Blazor Web or Blazor WASM.
2 replies
❔ Markdown RegEx substituation
You can substitute with regex using capture groups.
So I basically wanna capture the first line (the html comment) and match the cosing language, so in the example above "js" or "html".
After that I want to capture everything that's intended
17 replies