XAF Architecture XAF架构

 

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框架构建的应用程序由几个功能块组成。下图显示了基本块,指出了何时以及如何创建这些块,最后显示了可以扩展应用程序的领域。本主题后面将给出每个应用程序构建块的概述。

 

Architecture

#Storage

#ORM Layer

When 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层

在构建业务应用程序时,您最终必须处理数据。如果您正在使用eXpressApp框架,您实际上不必在DBMS中创建数据库、自定义表、字段等。您将不需要使用低级的ADO。NET结构来访问数据。相反,您将使用一个受支持的ORM工具——实体框架
(EF) 或XPO

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.


ORM工具允许您使用熟悉的代码结构(类、属性及其属性)来描述应用程序的数据。要创建数据表,需要声明一个类。它的公共属性将定义表中的数据字段。当然,您可以根据需要创建任意多的表,并使用专门设计的属性指定它们之间的关系。注意,在构建这些类时不需要做太多额外的工作。您只需要从适当的类中派生它们,并提供一些属性即可。为了帮助您入门,我们提供了下面部分中描述的业务类库。这个库包含几个现成的类(EF和XPO),您可以将它们集成到您的应用程序中。您还可以查看这些类的源代码,以获得有关正确数据声明的示例。

 

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 Library

The Business Class Library provides you with the following:

  • Classes that define some frequently used entities like Person, Note, Organization, etc. You can use these classes as is, or derive your own classes if you need to extend or change them. You can also review the source code of these classes to learn how to properly implement your data structures.
  • Interfaces that you may need to implement in your data classes. Some sub-systems of the eXpressApp Framework require data to conform to particular rules. For instance, the security sub-system requires the User class to implement the IUser interface. So, if you have decided to develop your own class to represent application users, you will also have to implement this interface.

The image below shows some classes you will find in the Business Class Library.

#业务类库
Business Class库为您提供了以下内容:
定义一些常用实体(如Person、Note、Organization等)的类。您可以按原样使用这些类,或者在需要扩展或更改它们时派生自己的类。您还可以查看这些类的源代码,以了解如何正确地实现数据结构。
您可能需要在数据类中实现的接口。eXpressApp框架的一些子系统需要数据符合特定的规则。例如,安全子系统需要User类来实现IUser接口。因此,如果您决定开发自己的类来表示应用程序用户,那么您还必须实现这个接口。
下图显示了您将在Business类库中找到的一些类。

Business Objects Library

#User Interface (UI)

#WinForms, ASP.NET Web and Mobile Applications

One 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)
# WinForms, ASP。NET Web和移动应用程序
eXpressApp框架的主要目标之一是将业务逻辑与应用程序的可视化表示分离。这使得基于相同的业务逻辑创建WinForms应用程序、Web站点和移动应用程序成为可能。当您在eXpressApp框架的帮助下创建一个新的应用程序解决方案时,将生成一个包含桌面、web和移动两个启动项目的解决方案。要了解有关应用程序解决方案组件的更多信息,请参阅应用程序解决方案结构主题。

#Views

One 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.

 

#观点
eXpressApp框架中的一个关键特性是基于应用程序数据自动生成UI。假设您已经声明了一个描述人的ORM类。这是所有你需要得到一个存储联系信息的应用程序。您可以启动应用程序,它将使用网格控件显示人员列表。您可以添加新的条目或修改现有的条目。这些操作是使用自动生成的单个编辑器集来执行的;每个都绑定到一个特定的字段。
用于显示和管理数据的自动生成的UI元素称为视图。在XAF中,有三种类型的视图。

  • List View

    List Views are root modules of your application. Usually, these are grids that display collections that you work with (data tables). You see one of them when you start your project, and you can switch between them using the Navigation System.

  • 列表视图
    列表视图是应用程序的根模块。通常,这些网格显示您使用的集合(数据表)。当你开始你的项目时,你会看到其中一个,你可以使用导航系统在它们之间切换。
  • Architecture-ListViews

  • Detail View

    This View type deals with a single object (data record) and presents property values using standalone editors. You see these views when adding a new record or when modifying an existing one.

  • 详细信息视图
    此视图类型处理单个对象(数据记录),并使用独立编辑器显示属性值。在添加新记录或修改现有记录时,您将看到这些视图。

  • Architecture-DetailViews

  • Dashboard View

    This is a special View type that allows you to display several Views side-by-side on a single screen (supported in WinForms and ASP.NET applications only).

  • 仪表板视图
    这是一种特殊的视图类型,它允许您在单个屏幕上并排显示多个视图(在WinForms和ASP中支持。网络应用程序)。

    Architecture-DashboardViews

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构建的
控制,ASP。净WebForms
控件和DevExtreme小部件。当然,您可以使用任何需要的控件来表示列表视图或详细视图中的编辑器。要了解如何将自己的控件提供给应用程序,请参阅使用默认主题未集成的自定义控件。有关构成用户界面的视图和其他元素的信息,请查看UI构造帮助部分的文档。

#Reports

Business 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.

  • Concepts - Extra Modules
  • Comprehensive Tutorial - Extra Modules
  • #报告
    业务应用程序不仅仅用于管理数据。分析趋势、问题领域和资源瓶颈通常是有用的。而且,您可能不仅需要将数据报告显示在屏幕上,还需要将其显示在纸上。您可以使用内置的全功能报告引擎——XtraReports套件来实现这一点。在它的帮助下,您可以自由地构建任何您需要的报告,在WinForms和ASP中查看它们。NET Web应用程序,当然,打印出来。
    所有使用eXpressAppFramework构建的应用程序都可以包含报表模块。终端用户可以使用集成的终端用户设计器在WinForms和ASP中添加新的报告并在运行时定制其内容。网络应用程序。在设计时,您可以为最终用户创建预定义的报告。移动应用程序也支持报表功能,但您只能下载预定义的报表或在WinForms或ASP中创建的报表。网络应用程序。
    打印控件或执行报告生成的输出可以以多种格式导出,包括RTF、HTML和PDF。
    除了Reports特性之外,eXpressApp框架还提供了可以在XAF应用程序中使用的额外特性。有关详细信息,请参阅以下主题。
    概念-额外模块
    综合教程-额外的模块

#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:

  • Basic Tutorial | Define Custom Logic and UI Elements
  • Comprehensive Tutorial | Extend Functionality

    This tutorial section shows you how to extend your application's user interface with the help of Controllers. You will create Controllers with different Action types and Controllers without a single Action.

  • Concepts | Controllers and Actions

    This section details the eXpressApp Framework's Controllers-Actions technique for extending applications with new features.

  • 有关执行你自己的控制器及行动的资料,请参阅以下文件:
    基本教程|定义自定义逻辑和UI元素
    综合教程|扩展功能
    本教程将向您展示如何在控制器的帮助下扩展应用程序的用户界面。您将创建具有不同操作类型的控制器,而不创建单个操作的控制器。
    概念|控制器和动作
    本节详细介绍了eXpressApp框架的controller - actions技术,用于扩展带有新特性的应用程序。

#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:

  • Basic Tutorial | Customize the Application UI Metadata
  • Comprehensive Tutorial | UI Customization

    Lessons in this section of the eXpressApp Framework tutorial demonstrate how you can use the Application Model to change some aspects of the application user interface.

  • Concepts | Application Model

    This help section details how the Application Model is loaded, and how you can use it to customize the application user interface.

    有关应用模式的详细资料,请参阅以下主题:
    基本教程|自定义应用程序UI元数据
    综合教程|用户界面定制
    eXpressApp框架教程的这一部分将演示如何使用应用程序模型来更改应用程序用户界面的某些方面。
    概念|应用程序模型
    本帮助小节详细介绍如何加载应用程序模型,以及如何使用它来定制应用程序用户界面。
posted @ 2019-12-11 10:53  code first life  阅读(657)  评论(0编辑  收藏  举报