Web application development using java ee or php

Well, I'm trying to understand what could be the advantages when developing a web application using java ee or using php.why should a programmer choose java ee or php? I usually develop a web application in php, working with some frameworks. What is the difference in terms not of the language (which is clearly completely different), but from the point of view of the project aspects.

+4
source share
2 answers

The two most significant differences are deployment models and hosting options.

As for deployment models, since PHP is (mostly) a language that is interpreted at the time of the request, the turnaround during development can be quite quick - you can easily make your in-place change behind the server, and your changes instantly as soon as you refresh your browser . On the contrary, Java can fall into a change cycle - a deployment that may take longer and also be more invasive (for example, a deployment may possibly exit your session).

Many of them can be mitigated using Java using various methods, various containers, third-party extensions (for example, JRebel), but you do not get this opportunity out of the box or from books on the shelf. I also do not want to replay it, the process is controlled, it is not so terrible. But this is the difference between the two platforms.

Hosting options come into play, since almost any random web host can host PHP applications at a certain level. PHP can be deployed as low CGI on saturated super cheap hosts for larger and more complex configurations.

Java MAY be deployed as a simple WAR for a shared host, and this works "OK", but shared Java environments may be less stable because different applications in a shared environment may be unfriendly to each other and have undue influence. This causes fewer problems when deploying PHP.

Therefore, most semi-rigid Java deployments instead use the VM instance as a standalone deployment. The game there will be to compare costs and such different options.

In general, I think that deploying Java is generally easier to manage and work due to the nature of packaging and the good tools Java servers work with, but it is a matter of taste and experience. Someone with a lot of PHP hosting and deployment experience rightly shrugs. But due to the fact that everything is new to someone, I think that it is much easier to work with Java.

+5
source

Assuming you're comfortable with both languages, the difference mostly depends on your server environment. PHP runs on Apache (usually), which is not a java server, while Java will run on Jboss or Tomcat.

This question will be closed fairly quickly, because at the moment when you ask it, people feel the need to echo their opinion about which approach is "better." The reality is that both approaches have their positive and negative sides, obviously, so you should choose based on which environment you want to support and in which language you like best. In addition, if you have very specific needs, you can explore which approach is best for these needs. If you have such requirements, you should ask about them individually.

For what it's worth, direct Java separates your business logic from your presentation logic. It is VERY complicated because there is not even the concept of a multi-line String with parameters. Of course, this problem was solved with the help of JSP, so if you like this language, you really fall into 6 of these 1/2 of the other ten.

+3
source

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


All Articles