In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the example analysis of drupal comparing thinkphp to the domestic open source environment. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Comparing ThinkPHP and Drupal to see the present situation of Chinese and Foreign Software Industry
Putting ThinkPHP and Drupal together will make many developers curious, but from the point of view of the ecological development of Chinese and foreign software, this is really a good starting point for discussion. This paper makes some comparisons between these two systems in various aspects, but the comparison is not the main purpose of writing this article, but mainly to share the differences between Chinese and foreign software industries and some thoughts caused by it. Help developers plan their careers and provide decision-making basis for IT decision makers.
Both systems are open source and free PHP applications, so let's start with a brief introduction:
ThinkPHP:
Product positioning: PHP development framework, based on which developers continue to develop and build their own application systems.
Development organization: developed by Shanghai Dingxiang Information Technology Co., Ltd.
Founder: Liu Chen, not much information, Baidu query for open source software senior consultant, senior PHP programmer, look at cloud CEO, more than 15 years of Internet product development and management experience, the main research areas include Web application architecture and development, product user experience design, committed to the domestic open source cause
Time of development: first born in early 2006
Open source protocol: Apache 2
Official website address: http://www.thinkyisu.com/
User group: China's domestic small and micro enterprises are well-known in the domestic developer circle, and their website describes itself as "the most influential PHP framework and pioneer in China!"
Famous cases: 56 group, Lenovo ask bar, CYTS Happy Travel, Bao Mineral Lishui, Starbucks, Metersbonwe's Bang Shopping Mall, TCL's online Mall, Sina Weitan, Australia Star, China Auto Friends Technology, etc.
Team size: there is no official data, but each file of the framework has author information, according to which there are a total of 7 people, including two major developers (contributing more than 90% of the code). These data do not include developers who contribute to the community ecosphere. According to the query results of Dingxiang Company on the inspection platform, the size of the company is less than 50, and the number of participants is 3.
System files: according to the current version 6.0.7, the number of initial files is 569, occupying space 2.41MB
Drupal:
Product positioning: complete backend system (backend data and control center) for back-end development of APP, Mini Program, website, Internet of things, etc.
Developer: a non-profit open source community co-built in more than 200 countries around the world and organized by the Drupal Foundation
Founder: originally initiated by Dr. Dries Buytaert of Belgium, Dries's 2008 doctoral thesis is "Java Application performance Analysis and Optimization Analysis Technology". James Gosling (James Gosling), the inventor of Java, is a member of its doctoral defense committee at Dries's home page at https://dri.es/about.
Time of development: first born in 2000
Open source protocol: GPL 2.0
Official website address: https://www.Drupal.org/
User groups: enterprises, government agencies, universities and individuals from all over the world, among which the market share of the top 500 enterprises in the world is more than 80%. The famous IDE:phpstorm directly integrates the new Drupal project.
Famous cases: Huawei, JD.com, Baidu, Tencent, Tsinghua University, Peking University, Guizhou Municipal Government Station Group, True Kung Fu, abroad: Tesla, Google, Honda, Qualcomm, United Nations, European Union, Harvard University, Massachusetts Institute of Technology, Disney, NASA, Pfizer, etc.
Team size:
It has the largest and most active open source community in the world, with more than 1800 core developers and more than 120000 active contributors (code, documentation, designers, etc.), including more than 2, 000 people in different communities in China, mainly driving the company's Acquia employees to more than 1100 people. Currently, an average of about 1300 code submissions are generated per week.
System files: according to the current version 9.1.7, the number of newly installed files is 18770, occupying space 71.2MB
Why ThinkPHP and Drupal:
One is the domestic popular framework in China, and the other is the internationally popular complete back-end system (which is also the most powerful and flexible system in the world, without one). From their volume, this is not a heavyweight at all, and from their market positioning, there is no comparative significance, but exploring them is of great significance to understanding the software ecology at home and abroad. in addition, if you directly tell you what ThinkPHP can do, Drupal can do it. And more elegant and concise? Things get interesting. Go on.
Usually, domestic developers who use Drupal are experienced developers with many years of experience, and they come out of various systems step by step with the times. They must know or know more about ThinkPHP, but developers who use ThinkPHP do not necessarily know Drupal. Developers who use ThinkPHP generally choose ThinkPHP because the framework provides a more common foundation, flexibility and freedom than the underlying PHP, compared with the secondary development of systems like Imperial CMS. Unrestricted, you can implement your own functions at will, but things are different in the face of Drupal, which may make developers feel as if they are treasured. Here, you need to briefly introduce the system architecture of Drupal. The entire Drupal system is built in layers:
At the bottom:
Is the framework layer, based on the popular Symfony framework, Symfony is the industry standard of PHP and the most famous framework in the world. Another famous PHP framework, Laravel itself, is based on or comes from Symfony. The author Fabian, who understands that developers of Symfony frameworks can quickly start developing Drupal,Symfony frameworks, is a legend. Another well-known work is the Twig template engine, which is also used in Drupal. Drupal is the most famous case of Symfony. Its website lists Drupal as the top one, and the Drupal community is also involved in Symfony's code contribution.
The second floor:
The data layer, represented by entities, provides all kinds of data upward, and database encapsulation belongs to this layer. The concept of ORM and the concept of model in ThinkPHP are similar to what the concept of entity looked like in the early days.
The third floor:
Application layer, where developers deal with all kinds of business logic
It should be noted that when using Drupal, developers do not have to call down layer by layer, but can cross over and directly face a certain layer, so when developing directly for the framework layer, they can use the whole system as a framework, just like ThinkPHP developers directly use the ThinkPHP framework. This is why ThinkPHP can do Drupal. The difference is that Drupal uses the Symfony framework, and ThinkPHP is deeply influenced by Symfony. Even directly adopt some of its components, many aspects highly draw lessons from the Symfony framework (any creator is worthy of respect, so do not use the word "plagiarism", but use "reference"), the backbone process is almost the same, but very different in maturity and details, this gap is illustrated by an example:
When human ancestors were in the era of rope counting, a fruit was a fruit, and a fish was a fish. when the number "1" behind it was abstracted from concrete things, mankind was faced with a great leap. At this moment, the significance is no less than the use of fire, and then invented numbers, mathematics and so on. In time and space, human beings have been in the constant exploration and abstraction of the world. It has accumulated countless times to have today's civilization, it can be said that the higher the degree of abstraction, the stronger, the more direct to the essence.
Many great works require a lot of manpower and time to accumulate, so how big is the gap between ThinkPHP and Symfony, or between ThinkPHP and Drupal? Here can tell you directly and decisively the gap between primary school and university, between junior high school and senior high school, mainly because of the size, ecology and time of the community. ThinkPHP and Symfony are both frameworks and are the most direct competitors. ThinkPHP needs a way of independent innovation if it is necessary to exist, but it is very embarrassing to learn a lot from Symfony. As a developer, why not use Symfony directly? The same level of CI framework (CodeIgniter) is completely independent development, in many global rankings can not see the shadow of ThinkPHP, but in China, you can see the shadow of ThinkPHP in a lot of recruitment information, this is a very strange phenomenon, because ThinkPHP is a completely local product, even the annotated documents are in Chinese, this article is precisely based on this choice of ThinkPHP to study the status of Chinese and foreign software starting point.
What is a good system? What do we need?
As the saying goes, you must sharpen your tools if you want to do good work. Here are a few points to illustrate what characteristics a good system should have. Below we will compare ThinkPHP and Drupal:
Completeness:
The so-called completeness you can think of is that a tool or component has been designed to fully take into account all the situations. For example, the string truncation function provided by PHP will truncate UTF-8 characters and produce garbled code, while you design an intercepting function, which not only won't do so, but also won't truncate English words, but also consider not truncating tags in HTML, so your tool is more complete than PHP native function. Once it is found that there are usage columns that can not be met, it needs to be improved to improve completeness. The design of Drupal is "complete" in many places. Although Drupal continues to explore and evolve, it is far more complete than ThinkPHP. For example, Drupal's routing system can naturally support routing based on domain names, protocols, HTTP methods, data formats, options, etc., and there is priority classification in the case of matching, which ThinkPHP does not fully have. The completeness of this kind of component design depends on the depth of understanding of the nature of transactions and a great deal of development experience. Completeness allows human beings to continue to move forward on the basis of their predecessors.
Standardization:
Standardization is the premise of large-scale collaboration, system hierarchical structure, cross-system communication, decoupling components are inseparable from standardization, Drupal is completely oriented to RFC documents, rather than its own system, in comments or discussion often see the reference to RFC, RFC documents are the cornerstone of IT Internet, similar to the common national standards on products, often ignored by users, but extremely important.
Integrity:
Cooperative division of labor, when the development of sufficiently well-developed components together, everyone to use them, which constitutes integrity, and then people do not have to re-build their own wheels, break through the inner volume, integrity will in turn promote the improvement of completeness, Symfony and Drupal solve the integrity problem in the way of components and modules.
Low coupling:
The components of the system design need to be decoupled as much as possible, so that it can give each component more room for development and improvement, and the bad components are also easy to replace. Drupal adopts modular design, and even the core is modular, and users can replace any core files in user space without direct modification to avoid insufficient functions and hinder upgrading. Relatively speaking, ThinkPHP coupling is tight.
Master boundaries:
A good system is bound to be a well-balanced system, but it is really a bit difficult, and different people have different opinions. Generally speaking, the general direction or backbone system must be simple. Here is an example. In ThinkPHP, routing controllers are supported according to routing parameters, namely: Route::get (': action/blog/:id', 'Blog/:action'). While Drupal does not allow this, the proxy controller is usually used to implement similar functions. In short, the effect should not be achieved at the routing level, but at the controller level, which makes the routing system more concise and the system architecture clearer. This idea runs through the Drupal, making the backbone of the Drupal system very simple and clean, when you want some detailed function. First enter the corresponding large tributaries and then into different fine tributaries, is it like a tree? But which way do you prefer?
Simplicity:
From main road to simple, the system needs clear flow, uniform call, consistent rules, no other, or try to avoid another, this advantage is easy for newcomers to learn, and tracking, troubleshooting are very convenient.
Vitality:
The vitality of the system also lies in sustainability, and the ecosystem and developers are the nourishment of the system, which we will skip here.
Compare ThinkPHP with Drupal:
ThinkPHP and Drupal generally speaking, lies in the lack of abstraction and accumulation of ThinkPHP, which is a fundamental deficiency. It is like a child. Drupal is an adult who has experienced years. He knows more, knows the general truth behind things, and goes a step further. Suppose we are building a building. ThinkPHP provides concrete, bricks, steel and other building basic materials. Developers need to explore how to build it. How to design and other architectural issues, and Drupal not only provides the basic materials, but also comes with the construction team and design institute, most of the time you just need to say what kind of feeling and function of the building (the needs you encounter, usually someone has encountered, formed a large number of contribution modules, installation can be), of course, if you are interested, you can also participate in the construction process to get your custom results.
This chapter compares the two in terms of technical architecture. If you are not a developer or are not interested in specific technologies, you can skip this chapter and move on to the next chapter, both of which are based on the latest versions of ThinkPHP 6.0.7 and Drupal 9.1.7. Due to limited space, only some important contents are selected for comparison:
Events:
By positioning the event as a substitute for the original behavior and Hook mechanism in ThinkPHP, it can be seen that the author does not realize the essential difference between the event and the hook, and the similarities are all involved in the current logic processing with third-party code, but under this premise, hook re-participation and event re-notification are very different in quantity and nature. ThinkPHP confuses it, while Drupal's understanding is more essential. Due to ThinkPHP's lack of understanding of the concept of "event", it also leads to loose and complex implementation and significant functional deficiencies, for example, ThinkPHP events do not have the concept of priority, which is very important when there is a sequence requirement, and there is no event propagation termination mechanism. For example, ThinkPHP does not require the implementation of event classes, in fact, it is usually necessary to pass parameters to handle events, and the processing results need to be fed back to the source of the event. Therefore, the event class is necessary, ThinkPHP is very shallow, and Drupal uniformly uses the event dispatcher service to handle all events, and there are no special restrictions on subscribers and listeners. To deal with event-related logic anywhere in the system, you only need to face the event dispatcher service.
Middleware:
There is a concept of "middleware" in both ThinkPHP and Drupal, but the positioning of the two is very different. The function of middleware in ThinkPHP is responsible for by event dispatchers in Drupal. For example, the ThinkPHP document mentions that middleware is mainly used to intercept or filter application HTTP requests, which is what dispatching request events do in Drupal, as well as routing middleware and controller middleware, which correspond to routing events and controller events. The main function of the middleware in Drupal is to change the HTTP processing core from one to several. In terms of logical architecture, Drupal is much more elegant and clear than ThinkPHP, which is also caused by ThinkPHP's lack of understanding of the event mechanism, which makes the system structure messy and lays a burden for future upgrades.
Entry file:
The entry files of both are very simple and the logic is similar. There are three main differences:
1. Drupal injects request objects directly into the processing core in the entry file, which literally embodies the idea that "any web system is a system that converts requests into responses". Although the run method of ThinkPHP's HTTP service is OK, it is not reflected at the entrance, but there is no essential difference. The big difference is that ThinkPHP lacks support for "sub-request" function. That is, the ability to re-submit a request to itself for processing during the operation of the system, which does not need to jump out of the system and come back. This function has a great impact on the system architecture (throughout the system, sub-requests should also consider performance in addition to affecting the environmental state of the main request). This best shows that the system architecture of Drupal is much more powerful and more complete than ThinkPHP, and Drupal is better able to cope with complex business logic.
2. The real road is simple. Drupal has only one entry file globally, no matter whether it is multiple applications or the front and background of a single application, there is only one entry. Although users can set more than one, it is not recommended, which reduces complexity and keeps it simple and lays the foundation for URL alias system. While ThinkPHP has a complex multi-entry mechanism, especially in multiple applications, it will be difficult to support URL aliases.
3. Drupal passes the class loader to the processing core in the initial state, which naturally supports replacing or modifying the class loader, but ThinkPHP does not support it, it just loads, and cannot be obtained when you need to modify the class loader, which leads to a great reduction in flexibility. For example, many classes cannot be replaced by the user's own, for example, it is more troublesome for you to replace the "\ think\ Http" class.
Multiple applications:
Both support multiple applications, that is, multiple systems reuse the same set of code, but Drupal is much simpler in practice.
Interface oriented programming:
In many implementations of ThinkPHP, no interfaces are extracted for classes, and even some important classes do not have interfaces, such as:
\ think\ App
\ think\ Request
They are so core and important, but none of them have their own independent interface. ThinkPHP is not programmed strictly according to the interface and is greatly reduced in flexibility. For example, if I want to implement my own app class to replace\ think\ App, I can only modify the core, so every upgrade is a problem, while in Drupal it is strictly according to the interface, the architecture is completely interface-oriented, and the parameter type constraints are all interfaces. We can replace any class provided by the core without having to modify the core, including the most important HTTP core class: DrupalKernel, which is similar to ThinkPHP's app class.
Programming not strictly according to the interface not only affects scalability, but also has many other disadvantages, such as unfriendly to IDE, difficulty in automatic document extraction, no inheritance of code comments, inconvenient collaborative discussion, and so on.
Routing system:
Quote an original sentence from the official ThinkPHP tutorial:
"ThinkPHP does not enforce the use of routing. If no route is defined, it can be accessed directly using the" controller / operation "mode."
It can be seen that the framework author is lack of understanding of the nature of routing, as mentioned earlier, the number 1 has not been abstracted, and the way of "controller / operation" should also belong to the default route or internal path route, rather than not routing. the seemingly innocuous point is actually very important, involving essential cognition, which leads to very different behavior.
Routing is a fork in the road after entering the system, it must exist, and a lot of business logic needs to be handled here, such as permission control, parameter conversion, path alias processing, language processing and so on. In ThinkPHP, it is considered that there can be no routing, which leads to another, such cognitive results are bound to make things loose and complex, such as code redundancy, non-uniform use and so on.
Ingress processing is only one of the two major functions of routing, and the other is egress processing, that is, the generation of system-wide URL, which is very important for URL alias processing, language negotiation, SEO, etc., but there is only a simple implementation in ThinkPHP, and the responsibility of the routing system has not been fully recognized. For example, a requirement is proposed here:
How do users add "target=" _ blank "" to the system-wide URL in a custom function?
Container and dependency injection:
The concept and term are derived from the Symfony framework, as detailed in:
Https://symfony.com/doc/current/components/dependency_injection.html
To put it simply, its main idea is to set up a central large object in the system, which can also be called the parent object, which is responsible for collecting, saving and automatically instantiating the objects we commonly use. In Symfony, this large object is called a container, and the saved object is called a service. The definition of the service can be provided statically by YAML or dynamically provided by the service provider. "definition" has a certain format, when we need a service. The container object will de-instantiate the service object according to the definition, and then save and return it. The definition involves the concepts of class, parameter, factory method, callback after instantiation, configurator, public and private attributes, feature inheritance, delayed instantiation and so on. Before the container is formed, there will also be a service compilation process to handle advanced functions such as service groups and parameter modification. Each service in the container has an ID, called service ID. The service object is obtained through the ID where it is used, and the container parameters and service aliases are also stored in the container in addition to the service.
The container concept of ThinkPHP has the shadow of Symfony, but it is still very young and rudimentary. Its implementation is far from being simple and confusing. For example, there is no clear concept of service ID. The service object in the Symfony container must have a corresponding service ID, while ThinkPHP calls a similar concept abstract, which can be an identifier or a class name, but some container methods use it as a class name, for example:
\ think\ App::register
\ think\ App::getService
It seems that the author wants to be as flexible as possible, but it leads to confusion caused by disunification. in ThinkPHP, the concept of "service" is defined separately (a bit like a service of the operating system), but it is essentially a Symfony service, only with special treatment. Putting a service into a container in Symfony is called "collecting" or "injecting" into the container, while ThinkPHP is called "binding" the service to the container. As the name implies, containers are used to hold things, so why is it called binding? This name is very mouthful, and there are many names that don't make sense, such as running the post-instantiation operation of objects in the container. ThinkPHP is called "post-execution" operation instead of "post-instantiation" operation. There is a famous saying in the computer world: "what is difficult? caching and naming". ThinkPHP needs to be improved in this area, and now some naming is not friendly to beginners.
In addition, services (in ThinkPHP, they should be called classes, objects, or callbacks bound to containers) can bind services to containers, which looks flexible, but it is very unfriendly to code tracking and debugging, making it more difficult for newcomers to take over the system, while Drupal benefits from modular design, which allows centralized declaration (because modules must know which services the service will rely on. You can also determine whether a service exists through the container compilation mechanism, so that it is as simple as possible to trace the code and debug, and it is convenient to export the service definition in the runtime container without actually instantiating each service.
Facade Fa ç ade:
This is just a concept in ThinkPHP, which is used to call the dynamic method of the wrapped class statically, that is, to proxy the class to the method level statically, which is only a formal adjustment, and the internal object still needs to be instantiated. In fact, this concept is not necessary. It is not only very unfriendly to IDE, but also goes against the original intention of PHP static method design. It just makes up for the lack of container function in ThinkPHP. There is no such concept in Drupal. The purpose of its function is to uniformly use the static method\ Drupal::service ($id) to obtain the service instance, and then let the developer invoke its dynamic method, and clone it if different instances are needed, which also avoids the trouble of introducing use into the proxy class.
Assistant function
There is a concept of helper function in ThinkPHP, which is mentioned in the document to enjoy the convenience of IDE automatic reminder, which is equivalent to the static methods or shortcut functions provided by the "\ Drupal" global class in Drupal, but Drupal is not because of IDE, but it is more convenient to get services, because PHP functions or static class methods are super-global available.
Controllers and models:
In ThinkPHP, it is considered that the controller is used to do the pre-processing logic, it must be a php class or closure, and the business logic is a "model" thing. In fact, this is a very rigid dogmatic point. First of all, the controller can be any form of php callback, including functions, container instance methods (defined by container ID), etc., and secondly, the boundary of business logic is not so clear in reality. It's hard to abstract the "pattern" and then give the name, again the controller should already be the beginning of the business process, and what the controller in the ThinkPHP concept does should be handled in the route, which ThinkPHP has recognized and mentioned in the documentation.
Multilingual processing:
In terms of implementation, both ThinkPHP and Drupal are based on English as the development meta-language. The translation implementation of ThinkPHP is very simple and can not meet the needs in reality, especially when developing international applications (this should be caused by insufficient application coverage). Drupal has a complete multilingual system and has fully dealt with the following concepts:
Language singular and plural problems (some languages are more than singular and plural) contextual questions ("may" is translated into "yes" or "May"? ) JS text translation interface, configuration and content language translation team translation cooperation mechanism to the left language processing and so on.
But these ThinkPHP do not have, only simply realize the translation of the text in the template and the replacement of the variables in the sentence. In addition, Drupal naturally has multi-language negotiation mechanisms, such as user settings, URL prefixes, session information, domain names, HTTP headers, user agent identifiers and so on. Custom language negotiation mechanisms are supported through plug-ins. By default, only URL, HTTP header variables, cookie and browsers are supported in ThinkPHP. Note that if you use Cookie to transmit language information, you may encounter legal problems when developing an international system. Many countries require the system to explicitly ask users whether they can use their Cookie. To sum up, when using ThinkPHP, developers need to solve most language problems on their own, but in fact, multilingual systems run through the whole system, which is very large and complex. As Drupal is an international co-built system, multilingualism is one of its highlights and is a natural multilingual system. This alone may be difficult for ThinkPHP developers.
Caching system:
A complete caching system has three elements: expiration time, expiration tag and context, which are fully implemented by Drupal, while ThinkPHP only implements time and label, without context, what is context? To put it simply, it indicates who the cached object belongs to and under what environmental conditions under the same cache key KEY, such as user permissions, login status, language, ip, protocol version, topic information, etc. all belong to the cache context. The same KEY needs to read different cache objects under different context conditions, which is very important for large-scale system design, and the system is very large. ThinkPHP requires developers to solve the problem of cache context on their own. In addition, ThinkPHP does not provide cache merging mechanism, which will not be able to achieve hierarchical cache processing. To achieve efficient caching, this function is essential.
Session Session:
Developers using ThinkPHP have to solve session-related problems on their own. Why? Today, with the development of IT, only small and micro systems use only one server, and most systems load balance to multiple servers, so applications must be stateless, so session data cannot be stored locally, and the usual solution is to store it in a database. Based on this, because ThinkPHP is an existing solution in which the database storage session cannot be provided by a framework, developers need to deal with it by themselves. While Drupal itself has taken into account load balancing, application statelessness and other things, the session has been stored in the database by default and can be used out of the box. Although ThinkPHP provides scalability, developers still have to pay a lot of manpower costs to achieve development.
There is a problem in the session implementation of ThinkPHP: the session is saved not after the end of the script, but in the script, so when the user calls die or exit, it cannot be saved. You should register the shutdown function. For more information, please see the php function:
Register_shutdown_function
Database:
Both ThinkPHP and Drupal support multiple databases, which is described by the concept of "distributed database" in ThinkPHP. Drupal has no special rendering concept and only uses business identification to distinguish different databases. Both of them also support master-slave configuration and read-write separation. But in the implementation, it is obvious that Drupal is much more elegant. For example, in the data structure of database configuration, Drupal uses a multi-dimensional array, the first key name is the business identity, the second key name is the master-slave identity, and its value is the connection configuration information. This structure is very simple. If you want to implement a database load scheduling subsystem, the interface of this structure is very simple, while in the configuration data structure of ThinkPHP Store all host addresses under one array key, store all passwords under another array key, and so on, and so on, and so on. This structure also needs to parse the configuration information again when generating connection information. Not only the reading modification is not intuitive, but also consumes the system performance, the interface of the database load scheduling subsystem is also more complex, very inelegant.
Both of them also support multiple types of databases. The Drupal core comes with support for mysql, pgsql and sqlite databases, and the community module supports almost all commonly used databases. At the bottom, Drupal calls the differences between different databases "dialects", and the processing of different dialects is completed at the driver layer, providing a unified interface to the upper layer. In other words, the upper database operation class is not aware of what database is used at the bottom. Using the standard SQL specification, it perfectly shields the differences and realizes the database decoupling, and the module developer does not have to consider what database the user uses. The table creation, query, modification and so on are all unified, and can be done with one click when switching different kinds of databases in the application layer.
With regard to database operation, because Drupal is a complete system, it has implemented a set of very advanced data storage structure by default, which provides support for the data layer of the system. When everyone is based on a unified data structure, wonderful things happen. People distributed all over the world can cooperate to implement rich upper-level applications. This structure has created the famous entity concept. As a result, Drupal also provides more operations about data, such as entity query, users can use it out of the box, Drupal is inclusive, and users can define their own data structures.
It is impossible to support ThinkPHP in the data layer. ThinkPHP uses models to handle data encapsulation and operations. Compared with entities, models are very early and young concepts. Entities it can do can do, and vice versa. For example, the model does not support field controls for input, formatters for output, display control for forms and views, and so on. The reason is that these require higher-level implementation.
Chinese and foreign open source ecology and links:
After full comparison, you will understand that ThinkPHP can do all the Drupal can do, and do better, but not vice versa, because Drupal is a complete back-end system, known as the WEB operating system, has helped to do more things, common needs are basically available, out of the box, ThinkPHP developers want those features, they need to go a long way on the basis of ThinkPHP, not to mention the quality issue. Time consumption alone is an astonishing number (for example, before the official release of Drupal 8, its various development versions were worked for five years by more than a thousand top international developers). In fact, many Drupal developers really disdain to learn ThinkPHP or other frameworks, but a very strange phenomenon can be found in China: why are there still so many small companies using ThinkPHP in China? (you can learn a thing or two about this by searching PHP recruitment information on various recruitment platforms.) there are two reasons to explain this:
Cultural exchanges are blocked:
The exchange of culture and life between China and foreign countries is still limited to a small number of people, and most of them have no foreign friends, mainly because of the well-known network barriers and language problems. Language barrier should be the main reason. China is developing too fast. at present, the main force of domestic developers is the post-70s to post-90s generation, and most of them have poor English communication skills, dumb English, or reading difficulties. They often instinctively do not have access to English materials, and the English proficiency of the post-00 or post-10 generation is much higher (thanks to early professors, the Internet, etc.). In the future, they will be more integrated into the international environment, fortunately, science and technology is now advanced, the level of translation software is getting higher and higher, and more and more people devote themselves to the introduction of technology. For example, Drupal has a large number of technical platforms in China, such as "Drupal China", "Love Code document Exchange", "Shuidi Jian", "Drupal University", "Think in Drupal", "Ning Hao net" and so on. These platforms or blogs provide a large number of almost complete Chinese documents, eliminating the language barrier. In Beijing, Guangzhou, Shenzhen, Chengdu, Nanning, Ningbo and other cities, there are development companies with Drupal as the core technology.
Fast food phenomenon caused by stress:
The Chinese are definitely one of the most industrious people in the world, and this diligence is largely related to stress. Housing, marriage, health care, education and old-age care are all a mountain, and "making money" must be a top priority. For most ordinary people, keeping ingenuity to do long-term accumulation is too risky, lack of sense of security, and the money you can get now will be done first. With the rapid development of society, who can know what it will be like in the future? this phenomenon does great harm to the field of basic science in our country, especially in the rapid development of IT industry. The burden on developers in our country is too heavy. 996 is even respected by big companies. After doing the work of programmers as simple as CURD for a long time, many developers simply do not have much time to study and spend a little time with their families, children and girlfriends. If you have little time to rest, it is even more difficult to study deeply. If you have spare time, you usually spend extra time on private work and extra money. In such an environment, people are accustomed to "eating fast food", using hoes first, learning excavators are not free, and it is even more expensive to develop excavators. Finally, it is difficult to develop China's open source cause, and a few open source projects have a strong commercial flavor. Among them, small companies rely on advertising subsidies. Rely on open source projects to divert commercial projects for profit (you can feel it on the home page of ThinkPHP), while large companies choose open source for training reserve talents, eliminating Bug for free, etc., with a strong "sphere of influence" color, generally speaking, pure love and interest account for very little, but this is not to blame Chinese developers, this is due to the stressful environment, and now there is a phenomenon of fleeing first-tier cities. Many people go to second-tier cities that are less busy and have some leisure time. Maybe they are a force of open source, and APP also predicts that China's innovation centers may move to second-tier cities with leisure.
On the contrary, the soil of international open source is much better, dominated by many developed countries, and these countries are usually welfare countries, compared with less pressure, people have a lot of room to do things by interest, and many people who participate in open source first consider the meaning of life. about this, there is a "Maslow demand model" readers can understand, "like" to ensure "quality", welfare allows developers not to consider age, work. At the annual DrupalCon conference, you can see that many developers are very old, and there are many people in their fifties and sixties who talk about technology with light in their eyes and inject their lifetime accumulation into Drupal.
Of course, international open source is not mainly participated by developed countries, and the underdeveloped countries of the English department are also key participants. they often earn foreign exchange through commercial projects derived from open source. The typical country is India, which is seriously polarized in India. It has been colonized by Britain, and its English popularization rate is very high among its high-end people, which makes India highly integrated into international open source. Accordingly, it has created a higher software development strength in India.
Developer career planning:
This section discusses the career planning of domestic developers. There has always been a voice in the domestic society: "programmers eat the bread of youth", which usually corresponds to the 35-year-old threshold. You may often see that so-and-so companies fire 35-year-old developers. Some companies require that the recruitment age should not be more than 35 years old. It is strange that 35 years old is the age that accumulates deeply in ability and is appropriate in many things. Why did this happen? Let's explore:
First of all, those news are highly suspected of being eye-catching, just like "female drivers". In fact, the accident rate of female drivers is less than that of male drivers. It is precisely because there is less that it is news that you can read, but if you have more news, you will form an illusion. Therefore, the 35-year-old threshold has been exaggerated to a certain extent, resulting in a bad impact, and even some people have no reason to follow the trend.
But there is some truth in the 35-year-old threshold, which should be selectively distinguished. If developers have been doing simple and repetitive manual work like CURD (real programmers), then when they reach the age of 35, compared with young people who have just left school for a year or two, their competitiveness can be imagined. At the age of 35, there will be a lot of pressure on children to go to school, parents' health, housing and so on, forcing developers to put forward higher pay requirements, family affairs, social communication and so on. Do not want to work overtime, usually the cumulative salary of long length of service is relatively higher, if young people can do what you do, who will the boss choose? At the same time, there are some problems of face when you are older. If your boss is a young man who is much younger than you, will you take care of it? It can be awkward for young people to manage someone who is much older than themselves. There is some truth to the existence of the visible 35-year-old threshold.
Time waits for no one, so how can developers avoid the 35-year-old threshold and plan their lives?
If you find that you don't really like technology, then you should transform as early as possible when you are still competitive in your age, follow your heart, find what you like, and start to accumulate competitiveness.
If you really like technology and are willing and ready to spend your life with it, then you need to accumulate efficiently, keep learning, and always pay attention to opening the technological gap with young people, who have the advantages of low pressure and strong physical strength. You need to make up for it with technological advantages. The road of great gods is not optional, but must be chosen. When you reach the age of 35, you must be a great god. Take up system positions that young people are not competent for.
We need to remind you that with the development of society, the threshold of technology is actually gradually rising. for example, you may have heard of "full stack engineer", but it only belongs to the early days of the Internet era, and now the social division of labor is too fine and deep. There is no longer a whole stack. If there is, it can be called "know everything, poor door", because the energy gap between people will not be too big, you choose to study all, others choose to study one place. The employer is employed according to the position, you need to consider who has the advantage, reason will let you choose to drill deep, the surrounding can understand, but in this way you will become a part of a large machine, your freedom of choice will be restricted, the subdivision threshold requirements will be very specialized, dabble, do not seek depth will face elimination.
Making such machine parts is not suitable for people with entrepreneurial ideals, so what will start-ups face? If you look at the development of Chinese society, you may not have a chance for all the general IT requirements. For example, websites are replaced by official accounts, and a few website markets are also occupied by SaaS platforms. To compete with such platforms, they only need to click the mouse to initialize, you have to write code, they charge by time can be very low, you have to charge an one-time fee, from the customer's point of view, of course, the primary consideration is the cost. General requirements also include e-commerce systems, live streaming systems, content payment systems, and so on, and these have very mature existing solutions. In terms of scale advantages, Weimeng, Youzan, WeChat, WeChat, and so on, are all very good SaaS platforms that have been developed. What about non-general IT requirements? Many vertical solutions will be formed, and the top of the mountain will be carved up, such as Meituan, Didi, Tuba Rabbit, Top, and so on. It is very difficult for you to have another opportunity in their field. There are only a small number of demand left for developers that really need to be customized. Such demand has a characteristic. Because it is customized, the cost determines that the customer unit price must be high. At this time, the customer will have some requirements for the strength of the entrepreneur company. How many employees do you have? How big is the office? How long is the accumulation of history? How many cases are there? How high is the registered capital?
In addition, with the development of IT today, the same application system will take many forms in software form, usually requiring one or more of App, Mini Program, web pages, etc., as well as cross-platform (APP has Android, IOS and the coming Hong Meng, Mini Program involves Wechat, Alipay, Baidu, Douyin, etc.). Although there are tools like UNIAPP, customers still need a lot of skills when they require native applications. This leads to the need to form a team, and the team members also include non-technical personnel, such as salespeople, finance, etc., all of which form a certain threshold of entry, and eventually you will find that starting a business requires not only technology but also capital.
Speaking of which, do you find the road very difficult? But please believe that this is not the only IT field, where there is competition, any success is not easy, only your interest can guarantee how far you can go and how high you can go, so please follow your heart.
If you follow your heart, ponder and still choose to do technology, to be a great god, then what should you do? First of all, you must pay attention to accumulation, especially to stand on the shoulders of giants and rush to the undeveloped land. You need to find the most promising biosphere in your subdivision, join it, and go back to the PHP development framework. Rookies look at the framework, which only further encapsulates and provides the necessary functions, while the Great Vision framework provides a unified collaboration platform, and everyone creates on the same platform. Only in this way can we avoid repeating the wheels, be cost-effective enough in terms of economic cost, and make use of the strength of others to free up our hands to develop our own affairs.
The unity of the basic platform is very important, only in this way can human beings accumulate and move forward and reduce costs, but there is a very interesting law in the formation of a unified platform, that is, in the end, there will be only one platform as the main platform. then there is a platform in the second place to form a competitive reserve, the third and fourth place is basically negligible, and the first and second place will be very different in terms of volume. For example, there are thousands of operating systems in history, leaving window and linux. The number of users of the two is very different, such as Android and Apple, Taobao and JD.com, Douyin and Kuaishou, Meituan and ele.me, and so on. Once the pattern is formed, it is very difficult to shake. For example, Microsoft can not shake Android, not because of technology, but because of the snowball effect in play, the king will be stronger and bigger, and the losers will gradually disappear. Even if the king has made some small mistakes, the development can not be changed. For example, the keyboard we use now, its letter arrangement is actually not the most reasonable. In history, there have been reasonable keyboards, but because people are used to the current keyboard, so continue to use, to become the king has two very important points: the technical level to be advanced enough, the community ecology to establish a snowball effect, these two points complement each other.
So who will be the unified basic platform in the field of PHP framework? The main development force of open source projects should be that a large number of users constantly refine and summarize them in the process of use, and then continue to discuss and improve them together, rather than a few people based on their own thinking or experience, so if you choose between ThinkPHP and Symfony, the answer is already very clear. In fact, Symfony realized the significance of a unified platform a long time ago, so it is committed to the establishment of decoupled and complete basic components. And iterate over and over again, so that some other existing frameworks also use Symfony components, such as Laravel and ThinkPHP,Symfony, which have repeatedly emphasized "standards", and have now become de facto standards in the field of php development, because standardization is a prerequisite for a unified platform.
As for Drupal, it is a higher-level unified standard platform established on the basis of Symfony, and it has become the standard foundation of a complete system. Almost all the application layer functions commonly used here have been provided. People are creating more future-oriented functions based on modular design on this unified platform, and realizing Drupal's ideal of "providing excellent digital experience".
Technology selection for decision makers:
If you are a startup boss or project director who is making a technical selection for a project, here are a few tips for you:
Control costs:
It seems needless to say, of course, but do you really have it under control? Software is invisible, if you are not a professional, it is difficult to control costs, here are some pitfalls:
In the current environment, if you want to make a long-term planning project, you should not outsource it if you can develop it by yourself. some things look the same, but the gap is very large. It is difficult for unprofessional people to see the differences in robustness, scalability, security, persistence and other properties between the two systems. For example, for a system with the same function, the development costs of load 5, 000 and load 50 million are completely different. For example, the workload of software documentation is sometimes much higher than that of software development itself, and documentation is the focus of ensuring the long-term development of the system, but outsourcing is difficult to achieve complete documentation, and the quality of outsourcing usually makes you pay for it in the future. It's not because the outsourcing company is weak, but because of the cost.
Less technical debt:
Don't find some developers who don't accumulate enough to save money at the beginning. Here's a story: there is a disagreement between a boss and a technical director on talent recruitment. The technical director asked for a post salary of 15000. When an applicant came, the technical director didn't want it, but the boss was overjoyed and thought he had earned it. Why should he pay more foolishly? Sometimes a rookie will leave a huge hidden danger in the system. The technical director just sees the problem of technical debt. The development team must have a deep technical backbone to control the system, and at the same time, do not choose anything with low maturity when choosing the basic system. This ensures that you do not owe technical debt as much as possible, otherwise you will start to be familiar with the road and get stuck in a quagmire. If you encounter a critical commercial window, then the immortals can not save you.
Speed up with the help of strength:
Today, with the development of society, in fact, many IT system functions are already available, and they are very complete. You don't need to develop them yourself. For example, to choose between ThinkPHP and Drupal, I will not hesitate to choose Drupal, because ThinkPHP is only a semi-finished product, and some functions are usually necessary in various business systems. For example, garbage collection system, state system, key storage, batch processing system, task scheduling system, data typing system, Ajax system, data viewing engine, version support system, permission system, etc., all of which are not available in ThinkPHP, but Drupal is very complete, and it will take months to years to develop these on ThinkPHP, which not only does not have the advantages of basic unified platform, but also difficult to guarantee the quality of the code developed by ourselves. It is not only a waste of resources, but also a high cost of training for new members at a later stage, so why not use a ready-made and mature system?
Integrate into the environment:
To integrate the development system into the general environment, in addition to speeding up, it also lies in the acquisition of reserve talents to decouple developers from the project. Do not find enough developers to join the project quickly and integrate into the environment when existing developers leave or are not enough. Decoupling developers ensure the development security of the project to a great extent.
National open source recommendations:
In this section, we stand at the national level to see how to deal with open source. China is becoming stronger and stronger, and many Chinese are looking forward to surpassing the United States as soon as possible, so if China wants to break through the blockade of the United States and achieve the goal of surpassing, it must participate in international open source and become the main contributor, rather than building its own independent system (self-built system should occur in new things, such as the next generation of Internet of things operating system Hongmeng). Because open source is open source for all mankind, not for any country, it will make China far away from the world, knowing that there are only 1.4 billion people in China and more than 7 billion people in the world. Ecological forces cannot compete with the world, so the rational approach is to participate in open source, strive to make contributions, on the one hand, inherit the existing achievements of human development, and develop faster on the basis of giants. Second, it is possible to establish the image of a great power by choosing to be with the majority of people, opening up the country and establishing influence.
On "drupal versus thinkphp look at the domestic open source environment example analysis" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.