官术网_书友最值得收藏!

Looking at MVVM

MVVM is a design approach to building software. The name is a little confusing, and it makes you wonder if they were trying to be clear or if they just liked the symmetry that the letters created. The design pattern was used extensively in Microsoft and Apple development products.

MVVM stands for Model View ViewModel.

Let's start with the View. It is where the HTML is converted to Document Object Model (DOM).

The View interacts with an object called a ViewModel. The ViewModel is where the presentation logic is stored. The Model is the part that stores the data and business logic. This is commonly passed to the browser as a JSON object.

Let's clear up a confusing point right now. When charted out, most people draw out the relationship as View-ViewModel-Model, which would be VVMM. Don't get caught up in the semantics; just take a look at the following diagram to understand what they mean by MVVM:

Looking at MVVM

Your data gets stored in the Model, but you do not interact with the data directly. You use the ViewModel to interact with the data. You should also note that you don't need to be an expert with the MVVM pattern, as the concepts in practice are very simple. The evidence of this is the simplicity of binding elements to the ViewModel.

主站蜘蛛池模板: 庄河市| 汝州市| 滦南县| 尉氏县| 镇沅| 都兰县| 青阳县| 石林| 高唐县| 沙田区| 闵行区| 连南| 武城县| 墨脱县| 龙州县| 石泉县| 新泰市| 筠连县| 大关县| 轮台县| 安达市| 昂仁县| 吉木乃县| 梨树县| 无为县| 龙山县| 常宁市| 兴仁县| 固原市| 芦山县| 天等县| 临湘市| 宜阳县| 临沧市| 泸溪县| 蓬莱市| 密云县| 米泉市| 新密市| 双江| 赫章县|