I have a several years of experience developing web applications with PHP and I've also worked with Java extensively (however never for web application development). I'm completing a large project that I've been working on for the past six months built in PHP/CodeIgniter and hosted with CloudControl (provides automatic server provisioning and scalability).
The project has gone well, and PHP served my needs - but now I'm in the beginning phase of developing a web application that will be targeted towards enterprise users and I'm considering using Java (possibly 'Grails') in conjunction with AWS Elastic Beanstalk.
My first question is: multi-threading, how often is it used in web application development for Java? With my PHP app, my server might have been required to make an API call to facebook in response to a user's request (say post to a user's wall). To avoid having my PHP process wait on the API call completing before returning to the user, I used Gearman job queing servers w/ workers to offload the work from my primary application server to a background worker.
Would a Java developer simply spin up a thread just to handle the API call and have the main process return to the user? Is this the biggest strength of Java development over PHP? Thanks! I've been feeding myself with both languages for a while hehe. My very humble opinion is: the strength of Java is the availability of APIs and libraries. For PHP is speed to build up a prototype or a functional version. Look at me right now, I have chosen java yet again for a new project because I knew I could use Apache POI instead of PHPExcel... sort of laziness. :)
以上就是Questions about Java for Web Development from a PHP Developer的详细内容，更多请关注web前端其它相关文章！