Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rendering in context of web development

Tags:

rendering

I don't quite understand the meaning of rendering in context of web development. When I read about browsers architecture,rendering is something about displaying fetched content from the internet. On the other hand, there are definitions of client and server rendering (with no browsers mentioned). For example in Backbone.View class we have render method that is responsible for connecting data with markup.

Outside of web-development context, there is a Wiki definition:

Rendering is the process of generating an image from a model (or models in what collectively could be called a scene file), by means of computer programs. Also, the results of such a model can be called a rendering

How to properly understand this concept ?

Thanks.

like image 492
Miroslav Trninic Avatar asked May 13 '13 09:05

Miroslav Trninic


People also ask

What does rendering mean in programming?

What Does Rendering Mean? Rendering is the process involved in the generation of a two-dimensional or three-dimensional image from a model by means of application programs. Rendering is mostly used in architectural designs, video games, and animated movies, simulators, TV special effects and design visualization.

What is content rendering?

Rendering is the process of merging templates with content. It generates a meaningful stream of HTML that can be displayed in a browser. This is the step where content becomes visible to the end user in page context.

How does web rendering work?

A basic HTML page rendered. A simple text and image are rendered on the screen. From previous explanations, the browser reads raw bytes of the HTML file from the disk (or network) and transforms that into characters. The characters are further parsed into tokens.


1 Answers

Rendering is the process of gathering data (if any) and load the associated templates (or just send the output directly). Then apply the gathered data to the associated templates. The final output is sent to the user.

This concept is quite the same for both client and server. In client, when using Backbone.View, the render method is more like a conventional method where you can put your rendering logic in it. You can call it draw, it is totally ok. The main concept of Backbone.View is that you get your data from somewhere (mostly from this.model) and then load the associated templates (from the DOM using $('#template-id').html() or using the text plugin of requirejs to load templates using AJAX requests). After you have the data and template, you can use your own template engine and "make" the final output then append it to the DOM so that users can see it

The server will probably do the same thing, and then send back the final output so that the browser can "render" it. There are some minor differences, though. In client side, you load your templates through ajax requests or from the DOM, in server side, you will probably load your templates from hard drive. As for the data, in client side, you get your data by using ajax requests or the data is already embedded to the response by the server (by inline javascript objects). In server side, you will get your data from the database (or cache) or from some 3rd party services

like image 58
Tan Nguyen Avatar answered Sep 21 '22 13:09

Tan Nguyen