Almost correct development on 1C, without revolutions

Do you know why it is so fashionable to implement Agile / Scrum / Kanban in development teams? To be completely and completely honest, the introduction of flexible development methods pursues only one goal - to bring the team closer to the users of the product. Make sure that every two weeks developers think not about design patterns, not about whether to choose a new, interesting LinkedList algorithm for implementation , or ArrayList will be enough anyway , and also not about what cool protobuf technology is or whether you into the ZeroMQ project ; and how it will benefit the warehouse operators, loaders and drivers, shop turners and cashier salespeople in the store. In SCRUM, this is usually called the two terms Minimal Valuable Product and Bussiness Value . By and large, it is not a matter of fashion, but of efficiency, without compromising the comfort of both parties - the business and the IT team.

Theoretical introduction


Before you start telling your “1C failure stories”, I’ll try to talk a bit about DSL languages. Or rather - about the concept of "problem-oriented languages."

Domain Specific language, DSL (“domain-specific language”) - a programming language that is specialized for a particular application, is a key concept of language-oriented programming.
There is no problem, there is an object
In fact, I'm a little tricky, giving you the definition from the Russian-language Wikipedia. Since adding the word “problem” I’m trying to send you to the original source, where the author Martin Ward formulated the basics of language-oriented programming


Any new language in the world (be it PHP, ruby, python, Erlang, LISP, Closure or 1C) was originally created as an answer to the problem. That is, if you are seriously going to learn any language or “framework”, you need to remember “for what” the author created it, remember what the author “did not like” on other platforms. In this sense, for example, the story is interesting, as the same Node.JS appeared . Initially, I wanted to make an easy way to create scalable network servers, what it degenerated in the end, dear habrasociety, I think, already knows.

Therefore, I will talk about the problem of "automation of business processes" and the emergence of Business DSL .

Enterprise DSL (eDSL) or Business DSL (bDSL)


The main problem that had to be solved in the language of the developer from the 90s sounded like this:

Many people who form many wishes - everyone wants automation
select * from * as requirements
. You leave to write in C | C ++ for three months, and they always require something and do not allow you to work calmly. At the same time, most of the business requirements are firstly known for a long time, secondly they operate with a finite number of objects: “Enter background information, fix something, calculate something, display a report on the results of calculating something” and more not necessary.


If, according to TRIZ , an ideal system is a system that does not exist, and its functions are fulfilled , then an ideal DSL language for this seemed something like this:





Why in Russian, you ask? Yes, because the user formulates this (and most of our users live on exUSSR territory). As a result, we do not lose time on the formulation of requirements and their conversion to development standards, where development is conducted in English. A single dictionary - low adaptation costs. Effectively the same?

It is possible by the way in Ukrainian, if the user wants

// thrown offhand, I could have made a mistake in writing
System = Install System Automation ();

System.LaunchIntroductionDovidkovoІInformatsії ();
System.StartOblica Attributes of their Invoice ();
System. Create Treasures Dani For Razrahunku ();
System.CreateZvіtiForPeregladu ();

System.StartOperatorInStock ();



As you understand, in the end, even the user himself can automate himself a little if he studied Basic at school. It was with this message that the platform we were discussing was created, although as it was in reality, only its authors know. Further in the text I will call this platform, sometimes 1C, and sometimes eDSL. so that you get used to both concepts and understand that I mean the platform, and not legal entities.

Improving development quality and developer level


But as you already understood, you have to pay for everything - the presence of a fast platform for business automation leads us to the fact that from the phrase “fast, cheap, good - choose any two” , the eDSL platform makes us choose quickly and cheaply. This is its competitive advantage. And if you play "short" - it gives a quick effect, or vice versa a quick understanding of the error of the process (something was automated, it didn’t work, it was done differently). But in any case, further development will be required - and it’s almost impossible to develop good products.

In order not to lose the speed of developing final business systems in any way, and to make it better (it’s good), the only thing we can do is to start doing NOT cheaply. But there is no money, as you understand, more precisely no one will allocate until it is to improve the quality of a “certain” platform, which, as it were, implies that it is “all of high quality” (according to marketing materials). Therefore, the only way we can increase costs is either in the area of ​​developing tools for the 1C platform, or in the area of ​​developing the skills of 1C specialists. Actually, as soon as we begin to think about the quality of solutions, we begin, like all IT specialists, to try to speed up / simplify our development process, while not losing efficiency for the business. As you understand
To the question that there will be no functional
And again, I’m cunning. In fact, we can say that "not yet." But there is movement in this direction. Usually, for everyone who is interested, I advise you to read Notes from couloirs at your leisure (read in the order “from last to first” record


Well, now more in detail about the toolkit, the one that was created and published, and the one that will be presented in the future.

Source Assistants Collection


v83unpack (v8unpack-console) - upload in a convenient format of the current development configuration

When you have more than one 1C developer and more than one configuration source code repository for business , the first 2 quality problems that you will want to solve are:

  • binding code changes to tasks for the subsequent analysis of problem situations;
  • the ability to quickly code review to identify bottlenecks, before the deployment phase at the client / customer / etc.

about task management systems
It is foolish to assume that in the environment of 1C specialists there are no task management systems. At the moment, I know that there are precedents for industrial use:
1. Jira (Stash, Confluence), TFS2013
2. OpenProject, Redmine
3. Bitbucket, Github, Taiga.io
even DevProm, and much more.


How it works?

C:\Program Files\1cv82\8.2.15.319\bin\1cv8.exe ENTERPRISE /F"C:\Users\admin\.jenkins\workspace\runTest1C\build\ibService" /Nadmin /P1 /DisableStartupMessages /Execute"C:\Users\admin\temp\ВыгрузкаКонфигураций.epf" /C"decompile;pathToCF;C:\1cv8.cf;pathOut;C:\repo\git\src;auto;out;C:\Users\admin\.jenkins\workspace\runTest1C\outExport.txt;"


Using the Jenkins assembly server plugin as a means of monitoring the source repository file, we get a complete replica of the configuration development history in the form of a git repository.

Now "senior comrades" always see low-quality code or do not take into account approaches to proper development



why by the way git
firstly, only Git can withstand the volume of ERP 2.0 source codes
and secondly, only Git has a convenient concept of working together on a variety of “contexts” of GitFlow tasks, which is critical for a 1C specialist, since it allows you to control the “chaos of requirements from the user "Without introducing chaos into the code.


precommit1c - fixing external tools in the git repository as sources

It is wrong to assume that the work of an ordinary developer goes only with the 1C repository, the quality problem also arises from the fact that most developers write a very large number of small utilities in the form of external files designed to run in the platform environment. When you have one developer, then Dropbox / YandexDisk / GoogleDrive / etc saves you for versioning , but when you work in a team, git and the internal or external git repository save us again.

The work goes through git client hooks and “suddenly” requires Python (although it can be done on bash):

git clone ssh://git@dev.example.org/operational-managment/goods-trade ./my-goods-trade
git submodule add https://github.com/xDrivenDevelopment/precommit1c ./my-goods-trade/vendors/precommit1c
cd ./my-goods-trade/vendors/precommit1c
exec copy-to-hook.cmd
cd ../../
mkdir utils && cp /cygdrive/d/epfs/ТолькоЧтоСозданнаяОбработка.epf ./utils
git commit ТолькоЧтоСозданнаяОбработка.epf -m ‘это очень важная обработка’
git push --all

what's going on here
By default, I believe that the habrasociety is able to read the command line, for the rest I
’ll explain: 0. We get the current configuration source "for automation of trade in goods" from our git source server (obtained using v83unpack);
1. We take the tool from the project on github where it is being developed and connect it as an additional git module;
2. Copy the necessary utilities to the service directory .git / hooks ;
3. Copy the processing developed in 1C: Configurator to the directory with utilities;
4. We put it in the repository and send it to the server;
5. The utility source code is also automatically placed in the repository .


It is with the help of this tool from the usual utility for 1C that this can become a whole project on github

Tool1CD - utility for working with platform repositories without the platform itself

One of the most popular utilities in the 1C world, along with v8unpack-console , allows you to work with data storages as a database, without a platform, including in console mode. On HabreDlya1Snikov - this development is included in the Top-20

The range of applications of this utility is wide:
  • novice specialists use it to repair and view damaged databases in the platform’s internal format;
  • and also, if you know that the platform also stores a lot of data in temp directories in the internal format, then for the study of temporary platform data.


Wow - their bases are being destroyed
destruction and problematic situations are most often associated not with platform problems, but with an attempt not to invest in hardware resources. That is - when, instead of setting up the infrastructure for the solution on 1C, the database continues to be located on a computer of the format “under the table” of the developer. Usually, for an analogy, I try to give an example from the sqlite world - imagine how many problems you will encounter if you start using sqlite as a means of storing data in a system with the number of simultaneously working users, say 10 and a database size of 1 Gb or more. For those who want to learn this useful, but painful experience, start with the fact that competitive access in this case is highly desirable in the format"Many readers - one writer . "


As for improving the quality of development and the developer, there is a synergy effect , due to the fact that the source code storage of the 1C platform is also a data store, it is using Tool1CD that replication to the git repository occurs.

So, now we have a full history of the work of all 1C developers in the git repository, and, mind you, without negative impact on the process of the usual "coding" on the platform.

We process the development process without losing the speed of releasing new functionality


Further only necessary in the following cases:

  • The configuration of the 1C solution will exist in your area of ​​responsibility for a long time - from a month or more;
  • You are trying to implement automated testing in your home before submitting your work / system to an internal or external customer;
  • You are just an IT perfectionist.


DevOps engineers are very fond of Chef, puppet , but absolutely do not like 1C, so we begin to automate our own activities.

1Script - already known project on Habré. In order not to repeat the EvilBeaver article , I can only say that the current result in the form of a DSL language for automating the work of “ordinary” 1C specialists looks like this:



xUnitFor1C- development through testing on 1C. The most interesting project from the point of view of improving quality is that it gives the maximum effect. In fact, it is an implementation of the xUnit specification, taking into account the specifics of 1C, and requires a separate publication (which will be next after the current one). The key thing here is that the introduction of development through testing (TDD at 1C) requires the highest costs in the first stage: the effect is observed no earlier than after 1.5 months.

Snegopat is your ReShaper and more.
subtleties of the project
Here I am forced to say that at the moment "temporarily" the development of the project has stopped. So to speak, it “stood still” in anticipation - including due to the architectural problems of the first version .


But in order to start the practice of using the above tools, most 1C specialists start with simpler projects:

v8Reader - a merger assistant for resolving conflicts in a collective development
v8Viewer - a helper built in including in TortoiseGIT, for comparing versions of 1C configuration located in git repository

Such he, the “eDSL world”, where the main thing is automation of business processes, and everything else is microservices and micro-utilities , released under the Apache License 2.0 license

So that life "does not seem raspberry"


Let's expand our horizons in terms of heterogeneous development:

1C + OpenStack - treating 1C as a “package” for the


1C + Docker cloud platform — treating 1C as a “collection of containers . "


And of course 1C + logstash / kibana / elasticsearch - besides just logging, it is also used for BI.


where is php?
I draw your attention to the fact that I have a biased attitude towards PHP, so I can’t give you links to products that work with PHP in the same style, taking into account the capabilities of 1C and PHP, combining the advantages of both platforms: my personal opinion is that PHP is P ersonal H ome P age tools and don’t assure me otherwise.


In conclusion


In the world of 1C developers - I beg you to pay attention to the word "development", as an alternative to the words "consultation and implementation" - there have long been no pure 1C specialists. This is, let’s say, a myth from the 2000s. Most programmers who professionally create solutions on the 1C platform “already have” one of the older languages ​​“in their base”: Java, C # or ruby, python is a business requirement and there is no getting away from it, including due to the huge internal market of projects CIS countries. Well, and, of course, due to the very dynamic development of the platform itself. On the other hand, the problems of NOT high-quality developers are present everywhere, regardless of language / platform, and this already leads us to the field of psychology and the answer to the question “why people do not develop and why people for the most part do not understand their place in the IT world” .

At the same time, as usual, given the openness of licenses, the github.com/xDrivenDevelopment community is open to new ideas and utilities within the framework of the concept of a balanced approach to eDSL platforms - just without the very revolutions mentioned in the header.

FAQ


Q: And what about Agile?
A: eDSL due to the concept in principle “Agile by itself” (RAD platform), nothing about QA (product quality management) is embedded in its concept - therefore, when introducing flexibility on 1C, key attention should not be paid to “demonstrating to the customer” , and more on the implementation of engineering practices.

Q: How to start using all this? And then “our 1C” specialists @ cencored @
A: Download, install the assembly server (Jenkins | Teamcity), start compilation of the solution at night (“syntax code control”) using 1Script scripts. Share best practices with the team. Configure replication of 1C source codes in git. Come to AgileDays2015 - see how to use static code analyzers .

Q: How much money does it cost?
A: Better think about how much this saves on long 1C projects.

Q: But it does not meet the standards of 1C?
A: These tools automate standards and extend them. In most projects on github you will find direct links to information technology support and the 1C knowledge base .

Q: Why is all this necessary?
A: Fast, cheap and good - choose any two and the second thesis. Life is too short to do something manually .

Also popular now: