
Recently, articles on 1C as
an application development environment have begun to appear more and more frequently on Habré. Articles are more conceptual than applied; The authors review the 1C: Enterprise 8 platform as a whole, try to understand whether the technology for creating business applications developed by 1C is good or bad.
I will not discuss whether each of the authors is right or not; platform 1C, like any technology, has its advantages and disadvantages. And there are some interesting features, their own achievements and mechanisms. That's about them and I want to talk. And yet - I want to write an article about 1C for people from 1C unfamiliar, an article that shows the place 1C occupies in a number of similar software products. I personally lacked such an introductory review article when I was not yet familiar with 1C, but was familiar with a number of other ERP products.
So, let's begin!
What does the company 1C?
I think the general public will answer this question: “1C: Accounting”. Someone will remember the tutorials or the famous series of games "IL-2 Sturmovik."
')
The Habr participants, of course, know that 1C is not only 1C: Accounting, that there is a whole system of 1C: Enterprise programs, including business application development tools and business applications created using these tools. And with the help of 1C development tools, both accounting and CRM and ERP (with thousands and tens of thousands of implementations) and much more are written.
ERP systems are the most interesting and functional business applications; let's look at their example, what place the “1C: Enterprise” technology occupies in the series of analogues.
What are ERP
What is the most valuable property of ERP systems (and any business applications)? In my opinion, this is flexibility, the ability to adapt to the end-user business processes at the lowest possible price.
It is clear that when programming the ERP system, it is impossible to foresee all variants of business processes. Parameterization comes to the rescue; By entering parameters into the system that a user (consultant, administrator) can change in the system settings, we increase the flexibility of the system at a relatively low price. The first ERP systems were parameter-driven, i.e. customizable with options.
Not all business cases can be provided in parameterized systems. When one setting of parameters is not enough - you need to change the source code. Here the ERP manufacturer faces the question - to change the code yourself for the needs of consumers and issue updates or supply the system in source codes so that users can rewrite the system to fit their needs (which, by the way, does not release the manufacturer from releasing updates - the system must develop, maintain a new functional to be competitive).
A separate question is the choice of a programming language for writing an ERP system. Most of the ERP systems are business logic for which conventional C ++ programming languages are not always the best fit. Ideally, business logic should be programmed in a high-level language capable of providing business programmers with maximum comfort when writing business logic, abstracting it from low-level details (features of working with databases, file input and output subsystem, window subsystem of user interface and etc.). Of course, in this case, you must also create a compiler / interpreter for this language and development environment.
We have a matrix of possible combinations:
- open or closed code of the application (here I mean not open source in its usual sense , but the ability to deliver the source code of the application, including for a fee).
- The business logic programming language is “normal” (C / Java / Perl / ...) or a specially designed, proprietary one.

Business applications created with the help of “1C: Enterprise” technologies are open source application systems written in a
proprietary language that does not have a short name; it is officially called the “Built-in 1C: Enterprise Programming Language”, informally and briefly, the “1C Language”.
Most of the leaders of the modern ERP market are open source systems. The ability to modify the source code “on the ground” provides tremendous flexibility and competitive advantage. Products with a closed code are forced to use other methods; The most common move is an analogue of CallBacks, the ability to hang custom code on predefined events, such as visual (opening-closing a form, choosing from a list of values, ...), and a business event (order processing, entering a sales account, ...). Some systems have the ability to write their own handlers in C # (or other common languages), others have Visual Basic for Applications licensed from Microsoft, etc.
How are ERP
ERP systems with open source applications consist of the actual source code that implements the business logic, and the execution environment of this business code (the so-called platform).
The platform is usually written in a low-level language (C, C ++), often the source code of the platform is closed to end users. The task of the platform is to allow the programmer to abstract from low-level details (features of the OS and DBMS, etc.) and focus on writing the actual business logic. The platform also often includes business application development tools and system administration tools (and I agree with this approach). By the way, they don’t do without a platform and a system where business logic is written in “ordinary” programming languages. There is no need to interpret the application code there, but the need for platform functionality remains (for example, "wrappers" around the database or unified access to the list of users and their rights).
The platform as a business application execution environment can be described as a virtual machine. As a rule, the platform should emulate three basic things for ERP:
- Business logic runtime.
- Database.
- Graphic subsystem to display the client application. The client application can be a graphic, rendered by standard OS facilities (including a mobile OS), or it can be a web application. In the case of a web application, the platform either implements its web server, or provides support for standard web servers (IIS, Apache, etc.)
In principle, modifying the platform, you can force ERP, written in a proprietary language, run under any operating system and store data in almost any DBMS. Typically, ERP vendors are limited to one or two OS and one or two DBMS. Support for additional operating systems and databases - an increase in the cost of development and testing; Often, ERP manufacturers in new versions of products announce the termination of support for any DBMS.
Platform 1C in terms of operating system and database management offers the following:
- Business logic runtime: a load-balanced failover cluster of application servers; OS - Windows or Linux
- Database: own file DBMS (recommended for development and small installations), MS SQL, Oracle, IBM DB2, PostgreSQL
- Customer:
- thin client (only display and input information on the client) - Windows and Linux. It can work with an application server via a local network or via web services (in this case, Microsoft IIS or Apache should be deployed on the server side)
- Web client - on the server side of Microsoft IIS or Apache, on the client side - any of four browsers - Internet Explorer, Chrome, Firefox, Safari
- thick client (with the ability to execute part of business logic on the client) - Windows and Linux. It has a number of restrictions (for example, it can work only within one local network with an application server). It is considered obsolete, the company 1C does not plan to further develop it.
- Mobile offline client (with the possibility of periodic synchronization) - iOS and Android.
If we use the
technology of a managed application (available since 2008) when writing the 1C program, then we get from a single application code both a thin client for Windows / Linux and a web client.
ERP Application Language
A separate topic is the language in which business logic is written. For a business programmer to work effectively, this language should be as close as possible to the subject area of the business (ideally DSL,
Domain Specific Language ) and away from the technical details of the OS and DBMS.
Let's take a typical business task: we need to add in the system the possibility of introducing and processing a new type of documents (for example, work order). In a system written in an "ordinary" programming language, this requires:
- Create tables in the database where the document information will be stored.
- Write a class (or classes) that implement the business logic of working with the document. In addition to business logic, classes must also implement interaction with the database - reading and writing document data.
- Create a user interface for editing a new document type. Often you need to create another form that displays a list of documents that can be searched by different fields, etc.
If we are working on C # in Visual Studio - all steps can be done within one development environment (including database design).
In a number of ERP systems using proprietary languages, it is also necessary to go through all three steps described above, as a rule, within the same development environment.
These 3 steps will provide the necessary minimum; but you still need to create a user interface for working with the document, make it available in reports, be able to register changes made by users in documents of the new type, in the system log (log), etc.
In 1C, it is necessary to describe in the graphic designer the fields of a new type of document and write code that implements document-specific business logic (for example, on which accounts to write the amount of money going through the document). Everything else needed to complete the work with the document in the system will be made by the platform:
- Will create structures in a DBMS for data storage.
- It will create forms for editing a document, displaying a list of documents of this type, etc. If the automatically created forms do not suit us with something - you can make your own by expanding and / or changing the standard ones.
- The document will be available in the reports.
- The document and its fields will be available for distribution of read / write permissions in the security system of the application.
- Fields of the document will be available for full-text search throughout the system (including synonyms, support for transliteration, fuzzy search, etc.).
- All changes in the new type of documents will be recorded in the application log .
- Methods will be automatically created for saving and reading the document to / from XML and JSON.
- The document will be available on the REST interface (via the OData protocol).
- And much more
A feature of development in 1C is that there are about 20 built-in object types in the system, and all new objects that the developer creates should belong to one of these types. Most of these types describe objects from the scope of the accounting activity of the enterprise - reference books, documents, plans of accounts, etc. Another part of the object types is technological, for example, Web and HTTP services; they allow 1C programs to communicate with the outside world.
Configurator 1C - application solutions are created in it. On the left - a tree of built-in types 1C; under each branch - applied objects of this type.Development of application solutions is done in the Configurator (Designer in the English version). Recently, a
trial version of the 1C: Enterprise Development Tools tool was released, which allows you to develop 1C solutions in the popular
Eclipse environment . Industrial development in the “1C: Enterprise Development Tools” is not yet possible, but it is quite possible to understand where the company is moving from a technological point of view. In particular, collaborative development is supported using popular version control systems (Git, SVN, and any others for which there are Eclipse plug-ins); There is also an opportunity to write your own plug-ins to the Eclipse IDE, extending the capabilities of the development environment for working with 1C.
Enterprise Development Tools - 1C application development in IDE EclipseActually, the 1C programming language syntax most closely resembles JavaScript. Language, strictly speaking, is not object-oriented. There is no inheritance; but, since all the objects of the 1C programs belong to one of the built-in object types - this can be called simplified inheritance: the built-in object types implement predefined functionality that an application programmer can redefine in his inheritance objects. Such inheritance is single-level; it is no longer possible to inherit from application objects; a similar approach to inheritance is adopted in the concept of
prototype programming (prototype-based programming); One of the most popular representatives of this concept is just JavaScript.
Such an approach consciously restricts the freedom of the developer of applied solutions, forcing him to choose his type of object from a reasonably limited palette of built-in types to accomplish his tasks. In return, the developer gets rich functionality implemented by the platform, and really fast development. The advantages of this approach are obvious - accounting systems on 1C can be created easily and quickly. There are also disadvantages - if you need to implement something for which there are no built-in types in the platform (for example, working with SFTP), then you need to either wait for a new version of the platform in which this functionality will be implemented, or write your own implementation in “normal” language and call it from 1C through the
technology of external components .
A few facts about the integrated programming language 1C:
- English (if ... then) and Russian (if ... then) syntax are supported.
- The language has Turing completeness .
- This is a language with dynamic typing. The variable is associated with the type at the time of assigning the value, and not at the time of declaring the variable. When declaring a variable, you cannot specify its type.
It is possible so:var ; = 1;
:var a as Int; a = 1;
- 1 , SQL. , SQL 1.
1 ? ?
, 1.
1 . – , , ERP; , -. 1 , , , (, ..), .. . ( ) 1 ( – ).
; , . .
1:
- – , 1 (MS SQL, Oracle, IBM DB2, PostgreSQL). 1 1 — ; , – MS SQL, ERP – Oracle.
- – . « 1» ( ). , «1». Windows Linux, .
- : Windows Linux, (1cv8c.exe/1cv8) 1 (1Cv8.exe Windows, 1cv8 – Linux).
- 1. , . , , . , .
- , 1C , . : «» 1 . , .
- - – IIS Apache. 1 – -.
- - – : Internet Explorer, Chrome, Firefox, Safari.
- : iOS Android 1. 1 ; Web- HTTP-.
1 — , - — ( TCP), http.
1
«1: »? ( ) «1: » : - .
— , . ( , - ) «1:» -. , UI .. – -. - ( – ) – , , , (, ) .
« » (, , ..), ; . () , -.
«1:» . – (
Metadata-driven development) (
Model-driven development).
- , . , .., . «1: » , - (, , , …).
, . - , .
, , , , , . . , , , , . , ( , . .). «1: » : « , , ».
«1: » . . , , , -, , .
- , . , , , . , (!) , — , , , , .
. , . () , . , , , .
(), (, ERP), – DSL (Domain Specific Language, - ). ( , , ) .
- : . IT- , - . , , .
, - « » , , . , ( ) . , , ; – .
, (merge) . , . ERP , .
, , , , .
– - . , , . «1» ( ) – , , .
1
( «1: »), , (, ..) , – , .. .
, — , , . , , «» ( ) , .
, « » . , . 1 , .
—
. «» , . , . «App Store»,
, , .
, –
. , , , . , , , ( , ). – . ( ) , ( ) .
?
/ 1? – , ( ):
- 1cFresh — « », 1 ( -) (SaaS). SaaS – , , .. 1 1cFresh (http://1cfresh.com), 1cFresh , «1: ».
- 1 ( ), (iOS, Android) , (), «» 1.
- . – -; ERP , .. – . 1 (), ; () – . 1 – , , « », , .
- , , , . «1: », «1: » .
«1:» —, 1 - – 1, . ; — .
- 1 1990-. - – 1 1000 1 , .
, . . «1» , .
Comments are welcome:)