MVC or SPA app

Asked

Viewed 2,251 times

2

I have been working with MVC for the last two years, but lately I have been following the growth of SPA applications. After reading several articles on this subject I had a question, if I want to develop an application to be published both on the web and mobile the SPA would be the best indication or should make a mix between MVC and SPA?

1 answer

8


What is best for you in each case only you can say.

The two technologies do not compete with each other, so there is no dichotomy. If you want to use both. ASP.NET MVC is a server technology. SPA is a client technology.

It is true that the use ASP.NET MVC has views and the SPA hardly needs it (but needs it a little), it is the view. It is more common to use the ASP.NET Webapi in this case. But that for luck in the ASP.NET Core is now integrated.

If you use the SPA you are using a web technology, that is, you can use it on any device that has a standard web browser. The question talks about mobile. There are even technologies that use the web as a basis for applications, but it’s still web. Usually either you use this technology or you make the application with the native API of the mobile device operating system. Then obviously the SPA is not possible. On the server you can continue to use the ASP.NET Webapi (now most likely with ASP.NET Core).

A lot of people like to use the web for everything, which is usually a mistake. It has numerous drawbacks and the only real advantage is taking advantage of customer code for all devices (and it’s not that simple). Server code can be used more easily. Even so some prefer something more specific when the access is from the client is done natively.

Note that SPA is usually only useful for applications. For common websites it is best to use the normal web presentation, even for SEO reasons. Of course, in some points it may even fit the use of the SPA, but you should only adopt this, even if punctually, in some specific pages when you have full control of the consequences. You can not study superficially and go out doing following cake recipes. So today a lot of the sites are made wrong.

Some questions on the site that may help

There are things that the layman usually likes, when he gains experience he discovers that it sucks. Others never get seasoned and think it’s good forever, even if it’s horrible.

But keep in mind that there is no magic solution. If things were easier in computing, 90% of programmers would have nothing to do. This is not why we should not try to simplify. But simplification is not the only one, much less the main characteristic that an application should have. In addition, what may appear to be simplification is often complication.

Today you can do SPA with C#: What is ASP.NET Core Blazor?.

  • Bigown, your answer was a lot more than I expected! Vlw even for the tips and mainly for the links, thank you very much.

  • So you don’t think it would be right to create a 100% spa system? I even made a topic about: http://answall.com/questions/154739/web-moderna-spa-rest?noredirect=1#comment319468_154739 @bigown

  • @Martial Correct is something that depends on context. The problem is precisely that people think there is a unique answer to everything. What my experience indicates is what is in the answer. I don’t know if I would have anything to add. But if you have specific ones that don’t depend on opinion you can ask a question on the site. The answer there is a little naive. Despite the good will, she sins in some things perhaps because she has little experience.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.