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

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.

主站蜘蛛池模板: 六安市| 鹿邑县| 河北区| 黑河市| 桓台县| 南京市| 龙南县| 和顺县| 志丹县| 罗甸县| 阆中市| 中卫市| 公主岭市| 叙永县| 禹城市| 神农架林区| 宣武区| 乐陵市| 周口市| 内黄县| 阿尔山市| 昌江| 祁连县| 盘锦市| 竹溪县| 理塘县| 乃东县| 定州市| 凤城市| 监利县| 方正县| 镇江市| 天全县| 新乐市| 五大连池市| 大丰市| 阿鲁科尔沁旗| 玛纳斯县| 东城区| 高碑店市| 兰坪|