Okay ~ Analyze and compare the reasons why Java Web on the internet is inferior to other platforms such as PHP ~ Of course, first collect information
PHP selects two typical products WordPress and discuz! As the research object.
The first is WordPress. Why did it succeed as a so-called fast website building platform? My personal knowledge is as follows:
1: The interface theme is templated, that is, the interface artist can design various skin according to the WordPress extension specifications.
2: Function Extension: similar to interface extension, it only means that the function can be extended through specific rules. The plug-ins are mainly related to the interface.
3: ease of use, not yet verified.
4: complete documents, teaching materials, and examples.
5:CommunityAnd number of users. (Okay, this is nonsense)
6: continuous update and maintenance. (This is also nonsense)
What are the first concerns of Java platform developers? Of course, it is a function extension plug-in. Let's look at the plug-in mechanism.
... (Study ..)...
WordPress plug-ins mainly support two types of actions and filters. What? What is the concept behind the servlet container filter/strutsmvc framework? No no... In fact, its functions are original or simple. Actually, it is more like the taglib in Java Web, that is, the core tag Library (I hope I have not explained it correctly ).
The so-called action is equivalent to adding a hook extension point (WordPress called Action tag) to the PHP page and associating one or more specific PHP functions. In addition, this function does not directly return parameters to the extension point. Generally, ECHO is the out. Print () in JSP in the hook function (). WordPress uses do_action ("tagname", Arg...) to add extension points in PHP. add_action ("tagname", function) is executed at the extension point to register the function at the extension point. When the page is parsed and executed to do_action, the registered function of the tagname created by the page is executed once. The difference between filter and action is that the returned values of the extended functions hooked up on fiter
You can return the position when the extension point is executed to facilitate the control of the extension point position.
This is the core of the plug-in mechanism, which is widely recommended by WordPress vendors... Can we find countless alternative implementations for the Java platform? Taglib is similar. Why is it not the preferred choice for most developers? The taglib threshold is too high: TwoCodeSyntax works at the same time, the implementation mechanism is not straightforward enough, and the extension does not have the nested ability. In addition, it is strange to achieve the goal: Many of taglib are syntax-controlled content and have no practical business significance. Second, because WordPress solidified the interface framework, its action tag is a fixed group, which gives secondary developers a high reference framework and a "common language". Different projects in javaweb development are implemented using different taglib, which has various implementation forms. As a result, javaweb developers are rarely able to "unite" at the product business level. This is similar to the JavaBean specification, that is, the so-called potential convention specification. There are a bunch of General Java Development specifications, and there are almost no general scattered business products and specifications, there is no de facto standard.
Sleep, To be continued ......