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

Models

Unlike the other MVVM components, the Model constituent comprises of a number of elements. It encompasses the business data model along with its related validation logic and also the Data Access Layer (DAL), or data repositories, that provide the application with data access and persistence.

The data model represents the classes that hold the data in the application. They typically mirror the columns in the database more or less, although it is common that they are hierarchical in form, and so may require joins to be performed in the data source in order to fully populate them.

One alternative would be to design the data model classes to fit the requirements in the UI, but either way, the business logic or validation rules will typically reside in the same project as the data model.

The code that is used to interface with whatever data persistence technology is used in our application is also included within the Models component of the pattern. Care should be taken when it comes to organizing this component in the code base, as there are a number of issues to take into consideration. We'll investigate this further in a while, but for now, let's continue to find out more about the components in this pattern.

主站蜘蛛池模板: 乐陵市| 灵武市| 玛多县| 科尔| 兰州市| 云南省| 雅江县| 荣成市| 手游| 类乌齐县| 蕲春县| 肇东市| 凤山县| 临汾市| 安龙县| 南汇区| 黄平县| 栾城县| 信宜市| 中方县| 禄劝| 汝阳县| 拉孜县| 休宁县| 宜章县| 满洲里市| 姚安县| 峨边| 涿鹿县| 镇江市| 铜山县| 彩票| 西畴县| 日土县| 金昌市| 资溪县| 平湖市| 上饶县| 灵宝市| 勃利县| 蓝田县|