ZendFramework + Bitrix

Perhaps it was one of the most dreary challenge for me for the last time.

So. We are engaged in technically complex projects, the potentially high loads (highload). It so happened that among the content management systems while defeated Beatrix. His customers want. Judging by our experience at Bitrix highload — a very real challenge if you do it gently.



Usually in projects where many forms of private offices or some complex logic — we suggested to the client to choose the implementation for the Zend Framewok or Beatrix. ZendFramework minus was that it is necessary to write the admin panel. Minus Bitrix — he is ill-suited to projects with complex business logic: there really is no MVC and sometimes disgusting code and API. Marketing stories-balalaika about the core D7, which is already 2 years — we do not take into account:

"Talk is cheap. Show me the code" (Linus)

So, any idea on complex projects to use ZendFramework with data management in the admin panel of Bitrix. We have implemented the architecture in such a way that you can use a ViewHelper inside templates, Bitrix, and to cause the components inside View. For all typical things (catalogues, text pages, news, etc.) is responsible Bitrix. For complex forms, personal accounts, profiles — Zend. In the end we got a fast and extremely flexible, pleasant to work with code, spending about 3 days to integrate.

the

Introduction:


1. Pilot project. We decided to do Scrumban on Zend framework, because I wanted to have a structured code that would please. On this project we had the time to experiment and was able to work out the main points of integration:
the

    the Joint session. the

  • Joint connection with the base (ha ha, the old code of Bitrix does not know how to work with MySQLi, and uses deprecated MySQL driver. ZendFramework this junk does not support, so we had to Oprogramowanie).
  • the
  • Harness the infoblocks to work with models.
  • the
  • Routing.

2. To overcome the skepticism of the most skeptical. Because we had already a working prototype bundles — we can discuss the code. I met the fierce resistance of one guy for my company. For about an hour, he found fault with our implementation that in the end helped us find a few bugs and make some improvements. After that kicker left logical arguments and we can move on.

3. Experiments with performance. We were really afraid that the download framework Zend framework will cost a significant time of the system. After a series of optimizations we carefully carried the load in autoload. The difference between the start of net Bitrix and our ligaments are made up 0,033 sec, and this is pennies compared to the ability to quickly develop well-structured code.

4. Experimental commercial projects. there were two. We were able quite clearly to understand in what moment it is necessary to beat the hand for trying to rewrite the standard logic of Bitrix on ZF.

5. General meeting with a story co-cavo. we Have a regularly called HolyWarModeOn. Gathered is discussed. I was badly prepared, and therefore caught (except interest) and a pack of salt. But I already had several working systems on hand, code which I was pleased. Like their performance. So I was sure everything will turn out.

6. Root Cause Analysis. I have been asked to clearly explain what purpose should be integrated with ZF. I spent about half a day on root cause analysis and made the printout in half with a tree of causal relationships. Printout hanging for a couple of weeks on public display: a great example of banner blindness.

Most importantly, I want to receive:
the
    the
  • Structuring and standardization of the code on complex projects. MVC. ORM.
  • the
  • Accelerate development through collaborative practices (for example, we have excellent software and database changes that allows you to watch how changing the database since the last release).

7. Preparation clean build Bitrix. We use one clean build enabled NFR license, which integrated our experience. In principle, all the developers have a potential opportunity is something to commit. When you create a new project script creates a new repository and database on dev server. In the new repository takes place a copy of a clean build (triloka).

8. Training ZF. it's No secret that knowledge ZF requires more skills than riveting saytik purely on Bitrix. We spent a few holivarov, where studied the MVC architecture and implemented in the everyday life of the basic terminology. Thereafter, each of the developers received the test task and the time for her decision. It was necessary in practice to touch controllers, forms, helper, validators. In my opinion, it was driving ;) By the time 80% of the developers participated in commercial projects on ZF.

9. Formal exam I conducted in person. But not theory, but by examining together with the developers code with his latest project and giving feedback: what to tighten, what better things to do differently and so on. It took me almost a week time. It is on the exam, I realized that the implementation was successful, because skepticism was gone completely. On the contrary, felt desire to develop and pump yourself further.

10. Regular practice of code review. It is quite a complex practice. Requires perseverance and thoughtfulness. To find something more serious than outright bad code or extra spaces — you need to head to work. Sometimes it makes sense to conduct code review in pair with the developer. Especially if the system architecture is nontrivial. I think code review is important learning practices. The analysis of the real project code gives the developer feedback. And we all need to understand, we are growing or not.

I think we found a good balance between:
the
    the
  • does not demotivate the developers need to delve into the bydlokod Bitrix.
  • the
  • to make high-quality architecture.
  • the
  • not to invent a Bicycle, to the maximum using the capabilities of CMS and MVC framework.
  • the
  • to deliver to the customer high-tech products with crisp, clear and supported code.

More optimistic friends.
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

A Bunch Of MODx Revolution + LiveStreet

Monitoring PostgreSQL with Zabbix

PostgreSQL load testing using JMeter, Yandex.Tank and Overload