IMZRH的日志

努力成为一个有用的人

导航

XAF框架学习之XAF简介

Posted on 2008-11-04 17:12  张荣华  阅读(15634)  评论(4编辑  收藏  举报

1 XAF的适用范围:

These are the applications described at the beginning of this overview - those designed to enter, store, browse, analyze, print data, or if needed, organize an organization's workflow. If you are trying to build an application of another type - a game, a graphic editor, a word processor, etc. - the eXpressApp Framework won't help you.XAF的比较适合用来创建基于数据库的应用程序(比如mis),这些应用程序的特点是主要由用户管理、数据CRUD操作、数据分析、报表打印、可能还有工作流等功能组成。如果你的应用程序是游戏、图形处理、文字处理这样的程序,则不适合用XAF创建。】

2 XAF的功能:

·               Easily re-use the same business logic in applications designed for different platforms (Windows Forms and ASP.NET). 【应用程序设计时在不同的平台间(如winformwebform)重用相同的业务逻辑。】

·               Provide data-to-UI construction algorithms. This means that you don't need to manually create a lot of similar forms for data browsing and editing. This also makes it easy to maintain applications, since if you change data, you don't have to modify numerous forms and/or web pages - it is done automatically. 【提供一个“数据界面”创建算法,从而将你从繁杂的数据操作间解脱出来。这意味着你不用为了数据的CRUD操作而去创建大量的页面,一切都由XAF自动来完成。】

·               Hide data management details. You will not have to deal with any DBMS or use ADO.NET to access data. The eXpressApp Framework gives you a higher-level tool for data management. This tool make it easy to store your data using any popular DBMS, without having to be familiar with it in detail. It is also easy to change the target database management system. 【隐藏数据管理细节。XAF Framework提供了一个高层次的工具将你从具体的数据库操作中解脱出来,这不仅减轻了你的工作量,也使得目标数据库类型的更换更为简单。】

·               Makes it extremely easy to create business applications designed to store and view data. 【可以很方便的创建基于数据库的商业应用程序。】

·               Allows applications to be created using any .NET language. 【可以利用任何.NET程序创建基于XAF的应用程序。】

3 XAF的组成图


 1 XPO(eXpressPresistent Ojbect library):developer express公司于2004初推出的ORM(Object-Realtional Mappipng)框架。

 2 Business Class Library:BCL提供了一些基础的常用的类,如(PresonNoteOrganization等),这些类的作用之一是减少了你编码的工作量,作用二是它们是XAF子系统运行不可缺少的类(比如安全子系统需要用到User类)。你可以从这些基础类中派生子类,以扩展或是改变它们,你也可以不用这些基础类,自己重新设计类,但你要实现相应的接口,否则XAF的子系统不能正常工作。

3 Views:XAF的一个亮点就是可以依据应用数据自动生成UI控件,比如你定义了一个Person类,XAF就会自动为你生成ListViewDetailView控件,ListView用来显示person清单,DetailView用来显示单个Person的详情。当然你可以为Person类指定用来显示清单和详情的控件,怎么指定,我们以后再说。

4 Controller LibraryControllers是决定应用工作流程的对象,它们处理最终用户的指令。

5 Reports:除了数据CRUD外,你的程序可能还需要数据分析、数据打印,基于XtraReports SuiteReports模块就是干这些工作的。它们可以方便的将数据导出为rtf/pdf/html/xls等格式,另外winform下还支持运行时报表设计,这样你就可以让你的最终用户在产品中设计自己的报表。

6 Windows Forms and ASP.NET Web applicationsXAF的目标之一是分离业务逻辑和表现层。当你创建一个基于XAF的程序后,5个项目被自动生成:

·               Application Module
This is a Class Library project that contains the basic business objects, and any other code that is not specific for a Windows or Web UI. In the ideal case, this is the only place where you need to write code. The UI section will be built automatically.

·               Windows Forms Application Project
Contains code specific to the Windows Forms version of your application.

·               Web Application Project
Contains code specific to a browser-based interface.

·               Windows Forms Application Module
Used to implement application elements for the Windows Forms application version.

·               ASP.NET Application Module
Used to implement application elements for the ASP.NET Web application version.

7 Application Model: XAF生成的所有信息都来自application model,application model的定义格式为xml格式,所以你可以用任何文本编辑器编辑它,但为了方便使用,XAF自带了”model editor”,它可以可视化的编辑application model,并且它是与microsoft visual studio集成的。

4 参考资料:

 http://www.devexpress.com/

 eXpressApplication Framework帮助文档