Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Built-in Business Classes & Interfaces

  • 4 minutes to read

The XAF features the Business Class Library with interfaces for XAF modules and the interface implementations for supported ORMs (XPO and EF Core).

The Business Class Library consists of the following assemblies:

DevExpress.Persistent.BaseImpl.Xpo.v24.2.dll
Contains ready-to-use XPO persistent classes.
DevExpress.Persistent.BaseImpl.EFCore.v24.2.dll
Contains ready-to-use Entity Framework Core classes.
DevExpress.Persistent.Base.v24.2.dll
Contains interfaces and helper classes used in XAF Additional Modules. Classes implementing these interfaces are available in the DevExpress.Persistent.BaseImpl.* assemblies listed above.

The DevExpress.Persistent.BaseImpl namespace (inside the DevExpress.Persistent.BaseImpl.Xpo.v24.2.dll and DevExpress.Persistent.BaseImpl.EFCore.v24.2.dll libraries) includes business classes useful for our demos and tutorials. For instance, Person, Address, Organization, PhoneNumber, Task, and so on. We do not recommend that you reuse these demo classes in your applications as is, or derive and extend them. Use our implementations for inspiration to create your own classes.

You can still use XAF module-specific or service business classes that implement XAF module interfaces as is, like ReportDataV2, FileData, and DashboardData.

#Interfaces for XAF Modules

Assembly: DevExpress.Persistent.Base.v24.2.dll

Use service interfaces from the DevExpress.Persistent.Base.v24.2.dll assembly to integrate your business classes to XAF modules like Security System.

Examples:

#Interface Implementations for Supported ORMs

Assemblies:

  • DevExpress.Persistent.BaseImpl.Xpo.v24.2.dll
  • DevExpress.Persistent.BaseImpl.EFCore.v24.2.dll

The Business Class Library allows you to do the following:

  • Use classes from the DevExpress.Persistent.BaseImpl***.24.2.dll assemblies.
  • Extend persistent classes from the DevExpress.Persistent.BaseImpl***.24.2.dll assemblies to add custom functionality.
  • Use the DevExpress.Persistent.BaseImpl***.24.2.dll assembly sources (shipped with the XAF installation) as an example when developing your own business class library.
  • The Business Class Library assemblies do not have references to other XAF assemblies. This allows you to use services defined there (like validation, audit trail, etc.) in non-XAF applications.

To add a class from the Business Class Library to the UI construction process, use the ModuleBase.AdditionalExportedTypes property, or use the Exported Types section of the Module Designer.

Use the Business Class Library Customization Module to change the UI settings of the Business Class Library classes.

#Business Class Library Customization Module

The Business Class Library Customization module includes UI settings (Application Model differences) for XPO and Entity Framework Core classes from the Business Class Library. It specifies class icons, List View column arrangements, and Detail View layouts. To apply settings from this module, invoke the Application Designer and drag the BusinessClassLibraryCustomizationModule item from the toolbox to the Required Modules pane.

BusinessClassLibraryCustomizationModule

The Model Editor can override Business Class Library Customization module settings.

Note

#Create Custom Classes with Class Names that Business Class Library Contains

If your custom business classes are named the same way as classes from the Business Class Library (for example, Person, Address, Organization, PhoneNumber), you receive the following errors:

  • DuplicateModelNodeIdException at runtime or in the Model Editor.
  • View layout collisions in the Model Editor.

To avoid these errors, use the ModelNodesGeneratorSettings.SetIdPrefix method as follows:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.Updating;
using DevExpress.ExpressApp.Model.NodeGenerators;

namespace MySolution.Module {
    public sealed partial class SolutionNameModule : ModuleBase {
        public override void CustomizeTypesInfo(ITypesInfo typesInfo) {
            base.CustomizeTypesInfo(typesInfo);
            ModelNodesGeneratorSettings.SetIdPrefix(
                typeof(MySolution.Module.BusinessObjects.Address),
                "AddressEx"
            );
        }
    }
}
See Also