Applications built with the eXpressApp Framework are comprised of several functional blocks. The diagram below shows the basic blocks, indicates when and how these blocks are created and last, shows you the areas where you can extend your applications. An overview for each application building block is given later in this topic. 使用eXpressApp框架构建的应用程序由几个功能块组成。下图显示了基本块,指出了何时以及如何创建这些块,最后显示了可以扩展应用程序的领域。本主题后面将给出每个应用程序构建块的概述。
#Storage#ORM LayerWhen building a business application, you will ultimately have to deal with data. If you are using the eXpressApp Framework, you do not actually have to create a database in a DBMS, customize tables, fields, etc. And you will not need to use low-level ADO.NET constructs to access your data. Instead, you will use one of the supported ORM tools - Entity Framework or eXpressPersistent Objects。
#存储 ORM tools allow you to describe data for your application using familiar code structures - classes, properties and their attributes. To create a data table, you need to declare a class. Its public properties will define data fields in your table. Of course, you can create as many tables as you need, and specify relations between them using specially designed attributes. Note that you do not have to do much extra work when building these classes. You will only need to derive them from proper classes and supply a couple of attributes - that's all. To help you get started, we provide the Business Class Library described in the following section. This library contains several ready-to-use classes (both for EF and XPO) which you can integrate into your applications. You can also review the source code of these classes for examples on proper data declaration.
Since a data table is described by a class, the actual data is represented by a collection of class instances. So, to modify a field in a particular record, you need to get the desired object from the collection and change its property. That's a much simpler and more natural method of handling data. It hides all implementation details, letting you concentrate on your application's business logic. 由于数据表是由一个类来描述的,所以实际的数据是由一个类实例集合来表示的。因此,要修改特定记录中的字段,需要从集合中获取所需的对象并更改其属性。这是一种更简单、更自然的数据处理方法。它隐藏了所有的实现细节,让您专注于应用程序的业务逻辑。
Generally, you do not need to think about actual databases, except when you want to change the DBMS used by your application. Microsoft SQL Server is the default option. All you need to do to change a target DBMS is to provide an appropriate connection string. This is described in detail in the Connect an XAF Application to a Database Provider topic. 通常,您不需要考虑实际的数据库,除非您希望更改应用程序使用的DBMS。Microsoft SQL Server是默认选项。要更改目标DBMS所需要做的就是提供适当的连接字符串。将XAF应用程序连接到数据库提供者主题中对此进行了详细描述。 #Business Class LibraryThe Business Class Library provides you with the following:
The image below shows some classes you will find in the Business Class Library. #业务类库 #User Interface (UI)#WinForms, ASP.NET Web and Mobile ApplicationsOne of the main goals of the eXpressApp Framework is to separate business logic from the application's visual representation. This makes it possible to create a WinForms application, Web site and Mobile application based on the same business logic. When you create a new application solution with the help of the eXpressApp Framework, a solution that includes two startup projects for desktop, web and mobile is generated. To learn more about application solution components, refer to the Application Solution Structure topic.
#用户界面(UI) #ViewsOne of the key features in the eXpressApp Framework is automatic UI generation based on application data. Assume you have declared an ORM class that describes a person. This is all you need to get an application for storing contact information. You can start the application and it will display a person list using a grid control. You can add new entries or modify existing ones. These operations are performed using the automatically generated set of individual editors; each bound to a particular field.The automatically generated UI elements used to display and manage data are called Views. In XAF, there are three types of Views.
#观点
Views are typically built with DevExpress WinForms controls, ASP.NET WebForms controls and DevExtreme widgets. Of course, you can use any control you require to represent a List View or an editor within a Detail View. To learn how to supply your own control to an application, refer to the Using a Custom Control that is not Integrated by Default topic. For information on Views and other elements that form a user interface, please review documents from the UI Construction help section.
视图通常是用DevExpress WinForms构建的 #ReportsBusiness applications are not just used to manage data. It is often useful to analyze trends, problem areas, and resource bottlenecks. And, you might need to have your data report not only on-screen, but also on paper. You can do this using the built-in, fully-functional reporting engine - the XtraReports Suite. With its help, you are free to build any reports you need, view them in both WinForms and ASP.NET Web applications, and of course, print them out. All applications built with the eXpressAppFramework can include the Reports module. An end user can add a new report and customize its contents at runtime using the integrated End-User Designer in WinForms and ASP.NET applications. At design time, you can create predefined reports for end-users. Mobile applications support the report functionality as well, but you can only download a predefined report or report created in a WinForms or ASP.NET application. The output produced by printing a control or executing a report can be exported in a number of formats, including RTF, HTML and PDF. In addition to the Reports feature, the eXpressApp Framework supplies extra features that can be used in XAF applications. Refer to the following topics for details.
#Behavior#Built-in Controllers#行为 Controllers are objects that manage your application's flow. They are also responsible for end-user interaction. Even the simplest applications built with the eXpressApp Framework use a number of built-in Controllers supplied with the System Module and Extra Modules. These default Controllers are mostly responsible for data management. With their help, you can add new records, delete existing ones, perform full text search, etc. 控制器是管理应用程序流的对象。他们还负责终端用户的交互。即使是使用eXpressApp框架构建的最简单的应用程序,也会使用系统模块和额外模块提供的许多内置控制器。这些默认控制器主要负责数据管理。在他们的帮助下,您可以添加新记录、删除现有记录、执行全文搜索等。 For the most part, Controllers serve as containers for Actions. Like ORM classes are abstractions of data tables, Actions are abstractions of end-user interaction elements - buttons, menus, etc. An Action specifies the visual representation of a UI element and its associated code. So, you do not have to deal with low-level implementation details of particular editors, toolbar systems, context menus or anything else. And at the same time, this higher-level of abstraction allows the same Action to be used in WinForms, ASP.NET Web and Mobile applications. 在大多数情况下,控制器充当动作的容器。像ORM类是数据表的抽象,操作是终端用户交互元素(按钮、菜单等)的抽象。操作指定UI元素及其关联代码的可视表示形式。因此,您不必处理特定编辑器、工具栏系统、上下文菜单或其他任何东西的底层实现细节。同时,这种更高层次的抽象允许在WinForms、ASP中使用相同的操作。NET Web和移动应用程序。 For information on implementing your own Controllers and Actions, please review the following documents:
#Application Model#应用模型 All the information that the eXpressApp Framework uses to build user interfaces comes from the Application Model. For example, this information includes editor classes used for particular data types, or labels associated with particular fields. The Application Model is automatically filled with metadata queried from application components - like business objects or Controllers. eXpressApp框架用于构建用户界面的所有信息都来自于应用程序模型。例如,此信息包括用于特定数据类型或与特定字段关联的标签的编辑器类。应用程序模型自动填充从应用程序组件(如业务对象或控制器)查询的元数据。 Application Model definition files are stored in XML format, and can therefore be easily edited manually. But the eXpressApp Framework provides even an easier way - the Model Editor, which is integrated with Microsoft Visual Studio. You can use it for both design time and runtime customization. To run it at design time, double-click a .xafml file from any module or application project located in the Solution Explorer. 应用程序模型定义文件以XML格式存储,因此可以轻松地手动编辑。但是eXpressApp框架甚至提供了一种更简单的方法—Model Editor,它集成了Microsoft Visual Studio。您可以将其用于设计时和运行时自定义。要在设计时运行它,请双击位于解决方案资源管理器中的任何模块或应用程序项目中的.xafml文件。 For more information about the Application Model, please refer to the following topics:
|
|