V
V
Vasya Pupkin2016-07-11 20:33:04
Programming
Vasya Pupkin, 2016-07-11 20:33:04

How to separate application logic?

Hello. Not so long ago I started learning web development. I learned how to make simple websites, like a guest book or a blog. The output was mostly done with html+css only. Generated the necessary pages on the server and gave them to the user.
The other day I got acquainted with js and I knew about its frameworks, as well as the miracle of ajax technology. Actually in what a question: how to divide application logic? Where is the line between back and front. Basically, it is clear that with the help of js you can’t approach the database, you need a server for this. But for example, the output itself can be generated on the server, or you can receive json with the necessary data from the server on the client and generate html based on the data. I understand that perhaps with a deeper understanding of the development, the question will disappear by itself, but still I would like to figure out where this golden mean is.
Thanks to all.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav, 2016-07-11
@peter_lyubko

The MVC pattern is here to help.

  • Each time, contact the database for 5-6 posts, and not immediately take everything, you can have tens of thousands of these posts in the database, and killing the server on one user is a dubious pleasure

X
xfg, 2016-07-11
@xfg

Where is the edge?
Just send data from the server in json/xml instead of html, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question