Z
Z
zakharkang2017-08-21 12:32:32
JavaScript
zakharkang, 2017-08-21 12:32:32

What architecture is used to create a SPA in 2017?

What architecture is currently (in 2017) being used in SPA applications?
I know that MVC was abandoned a long time ago, but I can’t understand what is better now? MVVM?
PS Requirements? Something simple and easily extensible...
The back-end is something other than a fat Font-end. Alas.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg Drapeza, 2017-08-21
@zakharkang

I know that MVC was abandoned a long time ago
- it's not like that at all.
The architecture of a SPA application is set by the framework you use, and in the case of small libraries (React), the architecture is built to your taste and color, there are also some standards, for example, create-react-app.
A separate important point is the management of the state of your application, in complex cases this management requires a special architecture, like a pattern over a pattern. And here the main options are Flux or MV * patterns.
For example, angular gives you controllers whose property changes automatically update the view, and singleton services that are convenient to use as models. You can come up with your own ways to automatically update controllers depending on changes in data in the service, or use a pattern, such as MVVM:
If you represent the html template as a view, the controller as a view-model, and the service as a model, you need to implement a view-model subscription to model changes, and for model, notification of subscribers about changes. And already angular itself will update your view when the view-model changes.
React is often used in conjunction with Redux - this is a library that implements the Flux pattern.
Redrawing react components depending on their properties is implemented in the library, you just have to create a redux store for all data, and pass the data they need from the store to the components, and to change the store, the corresponding actions that you will call, for example, by entering data into the input.
The bottom line is that the SPA framework gives you data binding to a template (aka View + Controller or View + View-Model), and some goodies. You must decide how to store and update important data (aka Model + business logic), and all elements dependent on them.

E
Evgeny Kulakov, 2017-08-21
@kulakoff

As a rule, they use ready-made libraries / frameworks like React / Angular / Vue.

A
Alexander, 2017-08-21
@boratsagdiev

Now it is better to proceed from your tasks and requirements [of the customer].

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question