View - Single Page Application

Asked

Viewed 118 times

1

When I discovered the SPA style I was very excited, but I went to research on some frameworks that do this, I saw that are mvc’s, but totally aimed at the client(front) and this did not like much, because my focus is to delve into the server side.

I understood that the back would only serve to serve data and persistence(basic) as a Rest and the others in the client.

I want to know if you can use one of these frameworks only the "view" part (single pages application)? To be able to create Spa interfaces and still be able to keep part of the responsibility in the back, middle to middle.

I have no knowledge about these frameworks as Angularjs and etc, someone more experienced could guide me.

Grateful.

  • The point is that the best-selling advantage of the SPA is to take the server side processing and put in the client! The acronym page is only reached because this processing is always in the client, if you submit something to the server will be rendered a new page based on the server response, understand? There is no way to leave the view alone because the view itself features decreased server-side processing.

  • What if it was in the case of Vue.JS that the focus is to be the MVC view? What I want is to be able to include SPA interfaces in my applications in a way that doesn’t drastically change the development. Leaving similar as it was, only with two technologies, see in the view taking care of the interface(spa) and the "some back-end technology" taking care of the model and controller, providing the data and business rules. Keeping my focus that is the back-end.

1 answer

2


By definition any framework SPA deals only with the aspect V of the solution (as frontend-based). Some internally implement MVC/MVVM/MV* to coordinate internal processes - for example Angularjs is MVC, in the sense that HTML represents View, Controllers are exactly that and Services/Factories (when used as data channels) are the model.

It is the responsibility of the developer backend implement persistence (C/VM). The development model and functional localization will necessarily depend on the distribution of responsibilities, and this has more to do with the process model than the choice of platform itself.

[...] can use one of these frameworks only the "view part"?"

Yes. In fact, this would be the only way.

(Your question is a little too wide. Perhaps it would be interesting if you set some specific questions that help you visualize the model.)

  • I ended up being very comprehensive because I was confused. He had a concept about MVC that separated the layers, and that by chance one of these frameworks would only enter the view and the rest would follow normally, but when he saw angular.JS bugged everything, creating the idea of having MVC on the client side (all back to him, up to the data) or that there is client-side and server-side MVC. I’m not front developer, I don’t want to go too deep, continuing my focus on the back, but I want to include performance and SPA interfaces so not too "drastic", that’s where I saw the Vue.JS, but continuous confusing.

  • @Martial think as follows - MV* describes a way processes are managed within a solution scope. An application can have multiple segments (and multiple MV* layers. ) The M* part of an Angular application (its data services) is completely independent of M* from the complete solution (for example the ORM interfaces for the backend).

  • I got it, I did some other research, and I saw that you can have MVC on both the Client side and the Server side, the difference is that the MVC on the client side handled the interface and manipulation of the data with the specifications of the mvc form, as if it were two applications, Interface and server application, each playing its part. What left me confused was the feeling that all responsibility would be passed on to the client, even the business rules, in fact it would be the processing of the data to be sent to the server. And when they say Vue.js is just "View," is that right? @Onosendai

  • @Martial Exactly that. Each layer (frontend, backend) can have its own MV implementation*.

  • Complementing: Being an application MVC(hybridity), with a front framework in "View" and Back with "Model", however both sides can be MVC internally, both on the back and on the front. Having the view that a certain technology (MVC for example) fits only in a context made me have this previous confusion, I believe I’m going to the right path now. Would the controller be independent of the two? In the case of a SPA application, would it be "Ajax"? Communicating on both sides. @Onosendai

  • @Exact Martial. Much of the confusion still comes from native development practices (Windows applications, for example) where the single layer - and hence the simplest model - makes viewing responsibilities easier. In a SPA application, the controller would be the party responsible for the coordination between data (services and Factories) and the interface (partials and views.)

  • In case they are the ones who will bridge between the sides, so is the ajax behind? This is quite opening my mind, thanks @Onesendai

Show 2 more comments

Browser other questions tagged

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