欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

XAF Architecture XAF架构

程序员文章站 2022-03-03 09:29:29
使用eXpressApp框架构建的应用程序由几个功能块组成。下图显示了基本块,指出了何时以及如何创建这些块,最后显示了可以扩展应用程序的领域。本主题后面将给出每个应用程序构建块的概述。 ......

 

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

 

XAF Architecture  XAF架构

#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类库中找到的一些类。

XAF Architecture  XAF架构

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

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

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

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

  • XAF Architecture  XAF架构

  • 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中支持。网络应用程序)。

    XAF Architecture  XAF架构

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框架教程的这一部分将演示如何使用应用程序模型来更改应用程序用户界面的某些方面。
    概念|应用程序模型
    本帮助小节详细介绍如何加载应用程序模型,以及如何使用它来定制应用程序用户界面。