WEB architecture of java programming language and php difference

     This reference to other users of the article, only learning to use, if infringement Union deleted.        

              1. php-write with.

       That is to say that only a complete change, you immediately see the effect, but java is much slower, after completion of code changes, recompile, and then restart jvm, intermediate time-consuming, but a lot of ah, and restart the process, but jvm user response will cause disruption oh.

    2. php write something fast.

      php can be said to be very agile, a demand to give, they do not consider the amount of performance and user problems later, it is very fast, you can not even frame, will direct write very fast, write a CRUD function, may also get 30-50 lines of code. The java on more slowly, first in order to use what framework, essentially, is the spring, and then is to configure a variety of databases, filters, servlet, the decision is mybatis or hibernate, then consider passing between the code and then consider affairs. . . Then stop debugging, a change in the code might be a few minutes of waiting time can be imagined.

    3. php surface ideas more clearly.

      What is the surface the idea is that you see the thing is made out of real things, such as echo "hello world", is the output hello world, but java is different, you probably written response, it may be written in modelattribute, but also It may be the return of the string, and then do not know how, it will be displayed on the page.

    4. php small footprint.

      php is a process-type deal with the problem, take up memory is very small, it can be said that you deploy 50 projects in one machine without any problems, as long as the traffic does not come up, do a set. And to die java, java each start a project, you have to run out of a lot of memory itself, such as on a 8g memory machines, usually ran two projects on the same subject.

    5. say this php benefits, java do no good for you? That is impossible.

    6. java components and more.

      Personally I feel that this alone overshadowed all other advantages, because the multi-component, means that with more people, the masses have sharp eyes. So, java must be good, it has accumulated a lot of things, not a new language can easily be replaced. What do you want, a good search java components, you may have the features you need, especially for the currently most popular big data industry, java is occupied side. The php In such a scenario a bit powerless.

    7. java thread pool, connection pool, Asynchronized convenient.

      In fact, this point and the first point is very similar, but also because the components, therefore the connection pool to use the thread pool is very convenient, which for high-performance concurrent scenes, it is absolutely necessary. Because the reasons for running java is multi-threaded, so do not always go to initialized a lot of basic things, which eliminates the need for too much time, and therefore we can endure a slow process server is started, because only once. The php is a multi-process, every time need to re-load all the required code, and therefore can not be some common data stored in the memory, the connection pool is not good to do, asynchronous operation is a big short board.

    8. java is a logical true sense of clarity.

      Because, java, you can enter can be a logical analysis to the deepest operating aid from the IDE tools, for each field, can be clear, this is actually an advantage to use interface and a complete object. The php then do not say that very few people or fees that hard to do this kind of thing, php can be said for the half semi-object-oriented development process, so that during the call insert several self-defined function call is normal, so you think a simple IDE to analyze the call chain is not so easy. For example, for the interface provided by third parties, php it is difficult to clearly see what the interface return, unless you print it out, but not necessarily print out right, because some return value data is not necessarily reflected. This understanding of the code, it adds a big threshold.

    9. Although the java compiler trouble, but you can find errors in advance.

      The java compiler and is more time consuming, but if there is an obvious error, the compiler will not pass, which gives you a chance to re-check the code. The php is not, whether you write more rotten, do not give you any tips, but many times, often because of fewer write a; semicolon, leading you to troubleshoot hours.

    10. java remote call convenient, rmi, hessian, dubbo.

      Anyway, remote and local calls are very convenient to know the relevant information, but also with the language of java call is not a purely http call, and maintain a certain connection, thus greatly improving performance. The php also has remote call, but relatively speaking, a lot of weak.

  In fact, there is no question there is no absolute good or bad, there is reasonable. Just not the same scenario only.
 

Guess you like

Origin blog.csdn.net/qq_42103479/article/details/90339744