文档介绍:ExtJS 4 官方指南: MVC 架构富客户端应用程序一直很难编写,维护整理也很难进行。随着功能的增加和开发者的增多, 程序很快变得难以控制。 Ext JS 4 拥有一套新的应用结构,能够帮助你有效组织程序,并减少编写代码数量。 Large client side applications have always been hard to write, hard anize and hard to maintain. They tend to quickly grow out of control as you add more functionality and developers toa project. Ext JS es with a new application architecture that not anizes your code but reduces the amount you have to write. 我们的应用结构首次引用了 MVC 模式。现在市面上存在许多 MVC 构架,彼此或多或少都有一些差别。现在介绍我们是如何定义 MVC 的: Our application architecture follows an MVC-like pattern with Models and Controllers being introduced for the first time. There are many MVC architectures, most of which are slightly different from one another. Here's how we define ours: 模型(Model) 是一个包含了一些字段和字段下数据的集合(例如用户模型包含了用户名和密码字段)。模型了解怎样处理数据包, 能和其他模型建立连接。模型的工作模式和 Ext JS 3 下的 Record 类很相似,通常配合 Stores 向网格(grid) 和其他组件提供数据。视图(View) 任何组件都属于视图——网格、树和面板都属于视图的范畴。控制器(Controllers) 控制器是放置所有保持应用正常运行的代码的地方——渲染视图、初始化模型或者其他的逻辑成分。? Model isa collection of fields and their data (. a User model with username and password fields). Models know how to persist themselves through the data package, and can be linked to other models through associations. Models work a lot like the Ext JS 3 Record class, and are normally used with Stores to present data into grids and ponents ? View is any type ponent - grids, trees and panels are all views. ? Controllers are special places to put all of the code that makes your app work - whether that's rendering views, instantiating Models, or any other app logic. 在本教程中我们会创建一个简单的用户数据管理系统。教程结束后你会学习到怎样使用新的 Ext JS 4 应用构架创建应用程序。 In this guide we'll be creating a very simple application that manages User data. By the end you will know how to put simple applications together using the new Ext JS 4 application architecture. 应用程序架构作为实际的类和框架代码, 应提供结构和一致性。按照约定编写代码有以下几点好处: The application architecture is as much about providing structure and consistency as it is about actual classes and framework code. Following the conventio