36.1.2. Brief feature description
The main purpose of the configuration extension is to customize an application during implementation (or in the "cloud") to the client needs. At the same time, support for the configuration being finalized does not need to be disabled. As a result, updating a typical supported application remains simple, with the need to make improvements. When developing an extension, you should understand some features of the configuration extension functioning. Thus, you can change an extended configuration at any time, for example, as a result of an update. In this case, the extension developer cannot affect the possibility or impossibility of updating in any way. You should also consider the fact that more than one extension can be running in the system and the author of each extension (in general) does not know how another extension functions.
Objects placed in a configuration extension can change the behavior of existing objects of an extended configuration without changing the structure of the data stored in the infobase. At the same time, objects located in a configuration extension can supplement (add attributes) the storage structure of configuration objects to extend. Also, they can create native extension objects that will store their data in the extended configuration infobase.
Extended configuration objects and extensions are mapped by object names. It means that a change in the object name in the extended configuration will result in the impossibility to attach the extension to such configuration. A similar situation (impossibility to attach the extension) arises when an adopted object name changes in the extension, while the extended object name in the extended configuration remains unchanged. However, the platform offers tools to make it easier to search for such problems, which will be described later in this chapter.
Each extension has its own purpose (the Configuration extension purpose extension property). The configuration extension purpose describes the purpose for which this extension is created. An extension can have one of the following purposes:
- Patch. This extension corrects application errors. Such extensions are supposed to use potentially “dangerous” extension features, for example, applying a method extension using the Around annotation. Patch is intended for a specific application version. When the next version of this solution is released, the author of the extension must analyze the applicability of the created extensions in the new version. Multiple extensions with this purpose are allowed, but it is necessary to ensure that there are no conflicts between such extensions, for example, several such extensions must not extend the same method with different purposes. Such extensions may not consider the availability of extensions for other purposes.
- Adaptation. This extension is designed to adapt an application to the requirements of a particular client. In such extensions, it is recommended that you do not use potentially “dangerous” features, that is, those features that can result in conflict of extensions when they function together or that depend on the order in which extensions are attached. However, careful use of “dangerous” features is allowed, provided that the author of the extension takes full responsibility for ensuring the correct operation of the resulting configuration in new application versions, and taking into account extensions that have the Patch purpose. It is assumed that, at each moment, there is a minimum number of such extensions in the infobase. If it is impossible to include the entire set of changes in one extension, then it is recommended that you divide extensions with the Customization purpose into the largest blocks of the extended application.
- Add-on. This extension is intended to implement new features of applications that are minimally bound to a specific application version. An example of this extension is the creation of a new set of reports that is absent in an extended application. It is assumed that such extensions should work correctly in case of updating an extended application. At the same time, an extension with with the Add-on purpose must not consider the possible presence of extensions with a different purpose in its operation. It is assumed that there can be an arbitrary number of such extensions.
If an extension is applied to a distributed infobase, you can specify its scope: the entire infobase or a data area.
The extension is created in Designer, stored in the infobase, and can be saved to a file. To add (apply) an extension saved to a file to the application of a specific client, there is no need to use Designer. You can apply an extension using a special standard function: Functions for technician ‑ Standard ‑ Manage configuration extensions. You can also to apply an extension using the application toolkit, which uses the API provided by the platform. You can apply an extension (interactively or from 1C:Enterprise language) in the following cases:
- In unsafe mode.
- If the security profile under which the session is running allows access to the extension being applied.