Business Components Overview
This topic provides brief information on major features which are supplied in the Business Components group.
Hierarchical Data is a comprehensive solution intended to ensure the processing of hierarchical objects. In comparison with the classical ITreeNode or TreeListEditor, the main advantage of the presented solution is the number of additional features for hierarchical structures and high performance. A significant performance gain is achieved on large volumes of data (when the number of objects exceeds 1000).
All business objects that participate in the hierarchical relationships should be defined using the IHierarchyNode interface. There is a special Hierarchy Manager service to help define hierarchical data, it also supports hierarchies at runtime.
The framework includes special Hierarchy List Editors that efficiently process large amounts of data and support multiple hierarchies, providing the user with an opportunity to drag and drop objects in the hierarchy.
It is possible to implement multiple hierarchies in a single class, i.e. the same objects can be present in several independent hierarchies simultaneously. List Editors allow to switch the current hierarchy at runtime.
You can specify the children nodes behavior when the current parent node is being removed: delete all children, put all children to the parent level, or send all children to the root level.
There are three methods to determine whether there are child nodes. It can be performed by a direct «Exists()» request to the database. The other variant is via counting the number of elements in the child elements collection. The third way is to adapt to the current state of the objects: if no objects are edited, the DB request is used; otherwise, the elements will be counted.
It's an abstract mechanism that optimizes the manipulations with multiple selected objects. The main purpose of this solution is to make efficient queries for data filtering based on multiple selection.
All various selections are stored in a single table. It is a universal approach with a fixed structure of the database, allowing to avoid unnecessary complications of the application data model.
The main features are persistent objects that store references to the selected objects; a special ObjectSet object to implement a set of selected objects; a Property Editor for interaction with the ObjectSet objects; CustomFunction to build efficient database queries containing one or more filters of the occurrence in a set.
Xafari security system is based on the same principles as the security system of the DevExpress XAF. The users belong to one or more Roles, and the Roles use the Permission sets to determine the level of User access to the system.
New roles and user types are enriched with advanced features; for instance, Xafari.Security.SystemRole provides two new types of permissions: Action Access Permissions and Navigation Items Access Permissions.
Important innovation is the support of two data access technologies: both XPO and DC objects. DC based security is much easier to use in the applications utilizing the DC approach to describe the data model. Attractive DC opportunities become available for security objects.
A new authentication mechanism is to support both Windows and a standard login-password authentication. The user specifies the preferred authentication type manually when logging into the application.
This technology provides a convenient and natural way to extend the business objects in the process of constant evolution and complexity increase of a business system. It is suitable only for those systems based on Domain Components.
The Extensions Framework uses the "business entity" term and expands its functionality through extensions. The conceptual idea is to implement new fields in a separate extension and add the association with the extension to the entity. Domain Components avoid any additional manipulations; it is allowed to include the extensions into the entity object entirely. The described approach does not require having many intermediate classes, in contrast to the classical inheritance.
It combines very well with the modular strategies used when designing an XAF-application. It is possible to make different combinations of the extensions. It is important that the user and all external processes should always interact with the same entity, regardless of its extension.
The status of an object characterizes its current state, the degree of suitability for further use. Over time, this state changes under the influence of various factors. In real world business systems it is very often required to display such object property, and the application, in turn, must handle the status correctly to provide the appropriate infrastructure for the further processing.
The Xafari.BC.IStatusSupport interface is a sign of the objects with the status. This interface requires a special CurrentStatus field. An object can have one of the following statuses: Draft, Published, and Archive. The set of statuses is extensible.
When displaying a list of objects with the status, the functionality of the List View expands with more Actions. Show draft and Show archive can filter the List View with the specified status. The Status Action allows to assign a new status for one or more objects. When modifying the status, the author and the date will be updated with the latest info.
It is a special panel intended to enable simultaneous group editing of the objects on the List View. The user activates the bulk edit panel, selects all desired records, and edits the values.
DevExpress XAF can use a single List View to display the objects of both the fixed parent class and its various descendants. In such situations, there are two modes for bulk editing. In the "Intersect" mode, the editor displays only the properties that are present in each of the types. In the "Union" mode, all properties of all objects are displayed.
Another important feature is a complete support of Dynamic Properties (see below), i.e. when different instances possess various sets of fields assigned at runtime.
The purpose of this component is to generate string values based on a specified template. Moreover, the service calculates a special integer index that is inserted into the template. The index is a member of the number sequence defined for a certain numerator. Thus, it is possible to automatically populate the fields with the values that are tied to the defined numbers sequence.
It is possible to apply the numbering at any moment via the UI or in code. You can apply the numerator to either a single object or a whole set of them at once.
The template description is based on the capabilities of the Object Formatter and Expressions, allowing to access the metadata, use context and formulas, etc.
The standard settings for the index are the start value and the step value. Other features are to define the numbering context and to start the numbering again in each new context; to store the numbers of the remote objects in the database and reuse them; to apply the members of the same sequence to the objects of different types.
A custom numerator allows the user to implement their own algorithms for computing indexes.
Managed Operations provide the developer with a shell to wrap any prolonged computational algorithm; it is called a process (in terms of Managed Operations).
Synchronous and asynchronous operations are available, they perform processes in separate threads. The process can include a number of sub-processes, each being a managed operation itself. The information about the launches and the progress can be stored in a database or only in the own application memory. If the operation has a flag of uniqueness, the system will not allow to run multiple unique operations in parallel.
The end user is provided with all means required to monitor and control the entire process execution progress. It is possible to start the process, cancel or suspend it, see the status and the progress, examine the log, etc.
The Dynamic Properties technology allows extending business objects with the sets of additional specific properties at runtime; the recompilation of the project is not required. There is also another tool for extending the existing business model without intervention into the code. It is a Custom Field supplied by the DevExpress XAF platform. In contrast to the Custom Field, Dynamic Properties exist only for a particular instance of the object. Such approach allows two objects of the same type having different sets of the Dynamic Properties.
The user can add custom new properties in the runtime. There is a special Dynamic Properties Editor to modify any dynamic value on the Detail View. Of course, the developer has the access to the appropriate API in order to manipulate Dynamic Properties in code.
The setting is a parameter that affects the business logic of the application, e.g. the discount rate applied on a product. The peculiar fact about it is that the different departments of the company can use their own values for the same business parameter. Application Settings is a module to manage the sets of these parameters.
A typical use case is to provide each user with a unique set of values. A similar structure is formed by Windows settings for different users. Since the user's population is dynamic, then the quantity of the sets is also impermanent, so the system adjusts the number automatically to match the currently existing users count. In addition, there is a so-called "root level" of the administrator settings where the default values are stored, and each user can override them at personal discretion. Thus, the users instances entail a complete dynamic slice of setting.
The presented solution considers all of these specifics to supply an abstract mechanism that can adapt to any number of instances of arbitrarily count of different types, i.e. the settings structure is multi-sliced. A special service allows accessing any particular value from code. Application Settings supply a number of out of the box scenarios that implement most common use cases.
Work Places is an additional intermediate layer of the Application Model that stores the model's configuration for the user groups.
By default, XAF provides a layer for the XafML file of the application project; this layer collects all data from the referenced modules, and also the changes made in the application's project. At runtime, there is a layer with end-user customizations, stored in the Model.User.xafml files (in the Windows Forms application) or in a session (in the ASP.NET application).
In case the number of the users (employees) exceeds several dozens, there are usually quite enough users with similar or identical functions. The idea is to create and configure so-called Work Places that correspond to these functions.
The Work Places module adds a new layer to the Application Model in order to customize the Application Model for each user role from the security system. Work Places can be created and configured by the application administrator. When the application starts, the system loads the list of all Work Places available for the particular user and prompts to choose the most suitable option for the current task.
The Xafari.Data module is a special solution to import/export data from/to any XAF application. These operations are required in the following situations:
Such situations often arise at the stage of deployment and adapting the applications at the customer's side
The described module provides the operations of import/export referring to the data source declared by the IDataSource interface. There is a number of predefined data sources, such as Access, XML, CSV, Excel, etc. Extensible architecture provides the possibility to implement any custom data source.
This out of the box tool is to implement complex business logic. The developer can concentrate efforts entirely on the algorithm, its input parameters, and results, and not on the infrastructure itself.
An important feature is to implement several algorithms for a single operation and then replace them in the Application Model with no need to recompile the code. To run a Business Operation from the UI, the system automatically generates a special navigation element; the standard Action is also presented. Any Business Operation can be processed in a separate thread; another available method is to use a special console application. The capability to perform a rollback is also there.
Business Operations can be performed independently and based on the context of a particular object. Moreover, the context can be either a single instance or a list of entities. The developer or administrator can define the strategy of binding Business Operations to the contextual business objects.
Business Operations provide a powerful tool for configuration and administration. It is a special List View available at runtime, or a special extension of the Application Model.
The XAS mission is to unify all administrative tasks in a separate Windows app.
A very profitable side of the DevExpress XAF platform is its openness, i.e. any system-specific business function can be implemented in a third party module and successfully integrated into an XAF application. Large-scale enterprise systems require serious effort to establish and administer complex business functions; it is usually a separate stage to customize and adapt the component to the needs of the customer. Common functions of this kind include reports or audit.
Another important aspect is the development of Web applications. In the vast majority of cases, it does not require a Web interface to administer the system business functions; more convenient and safer way of implementing it is a separate Win app that is only available to the technical department of the company.
Since Xafari framework specializes in these components, it is quite natural that, at a certain stage of evolution, there was a need for a centralized mechanism for the deployment and administration of many different solutions.
The final functionality of XAS considerably varies depending on the composition of the existing modules. Many functional units from Xafari are designed with the ability to use XAS; however, the principle of tolerance is observed, i.e. any component can be configured either using XAS or via the target application in a standard manner.
XAS can also support any third party feature. The developers should just follow several simple agreements in design and development.
It is a technology intended to create any business function with global characteristics; such functions operate at the level of the entire application. One of the most popular scenarios is that Xafari Services provides a convenient wrapper for a quick implementation of the batch data processing algorithms.
Within the framework, Xafari Services are utilized very actively and effectively. Here are just some of the components implemented by Xafari Services: App Settings, Business Operations, Numerators, Data Accessor, Object Space Factory, etc. The framework provides all base classes, interfaces, and infrastructure required to implement your own custom services.
The core of the solution ensures effective data protection when working in a multi-user environment. It isolates the results obtained from business functions to prevent premature interference with other users.