📜 ⬆️ ⬇️

From noodles to ingredients or Listen to the parents!

Parents always teach their children (for that they are parents). Children always seem parental advice stupid and unnecessary, and only then, already having their own, we understand that the parents were actually right.

For example, my mother always told me three things:

1. Do not overeat at night
2. Do not play gambling
3. Do not write your php frameworks

And now I understand that I did not listen to her in vain. And then ... How was it a long time ago ... Although not so long ago, only a year and a half ago.

A young team of former students decided to develop web-services. Web 2.0, Ajax, Rich Client, Mashup, Tag cloud - these words did not descend from my tongue, and the surrounding people thought that it was insulting curses and were often beaten. Therefore, it was decided to immediately begin to develop new super startups, which finally show these losers from Google their place. Immediately the question arose: on what to write our "netlenki"? As for the language, we did not even doubt - of course, PHP. Why? Because the whole team knew PHP, and in fact Joel himself wrote that it was necessary to develop in the language that you know. The second question was: how to write? The selection was small:
')
1. Write in pure PHP, without thinking about anything (that is, writing on "noodles").
2. Take some third-party framework.
3. Write your own engine.

The first offer was rejected immediately. We are supporters of OOP, patterns and other crap, we are used to seeing noodles only on the ears of the authorities, but not in the code. We did not find third-party frameworks that matched our requests, although we tried very hard (there was such a time). Therefore, for starters, we created a framework framework in SVN and sat down to invent its name and architecture. After numerous disputes, swearing and fighting, it was decided to name the project Adept.
Adept
The name was approved immediately, because unlike other proposals, none of the team members could come up with any curses to the name.

With architecture, the situation was also not easy. At first we went along the trodden MVC path. However, we soon realized that the classic MVC architecture does not facilitate development. The programmer continues to perform many boring, repetitive, routine operations. And the most annoying thing was that the code reuseability was very small. That is, if you made, for example, a tree for one project, then in order to use it in another project, you need to copy-paste HTML and make many small corrections with your hands. Moreover, Html is not particularly suitable for programming complex UI components (after all, it is a text markup language), so for the implementation of all menus, tabs, etc. It takes a lot of time and effort of programmers.

We decided to make the development of the interface part as simple as in desktop applications. We abandoned the classic MVC, replacing it with a component architecture. That is, we decided to create a set of standard UI components (buttons, checkboxes, radio buttons, text fields, tables), as in desktop applications, and simply build the interface from these components.

We also decided to implement an event / listener model. By arranging for UI components to generate events (for example: clicking a button, selecting a specific item from the list, etc.), programmers could register listeners to process event data. That is, to make such a framework so that programmers deal with coding only business logic (which they like to do very much), without even thinking about “how can I make a calendar ?”. Finding our own, ummm, head for such a task, we began to work. Something worked out easily, but sometimes for the sake of implementing the component, it was necessary to sell the soul to the devil (unfortunately, the devil could not force IE to follow the standards).

And just recently the thought came to us: “Maybe it’s interesting to someone else? Maybe you should show it to other people? ” However, this turned out to be a rather difficult task (more difficult than development). It is necessary to write documentation, clean the code, “lick” the hierarchy of objects, make a support site, etc. And then the question arises: “Is it necessary? Does the php community need such a framework? ”(Looking at discussions here or here , you start thinking about the opposite). Not finding the answer at home, we decided to ask you, habradyudi. Well, what do you say?

I, perhaps, will attach the link:
http://adept-project.com

Source: https://habr.com/ru/post/20097/


All Articles