doukan1258 2013-12-26 18:43
浏览 144
已采纳

我对j2ee和php感到困惑[关闭]

As a developer going through web development I would like to know if J2EE or PHP is better for building web sites.

My initial thoughts were that J2EE was better because it is Java based but upon reading several articles I read that PHP might be easier and more focused with regard to web development.

On this topic I have another query, whilst looking at different articles on web design and construction I came across websites that claimed to be built in J2EE, Java and Ruby. Is J2EE the same as Java? Or is it something completely different.

  • 写回答

3条回答 默认 最新

  • douken7402 2013-12-26 19:02
    关注

    First of all, there is no J2EE anymore. There is Java EE. One profile in Java EE is the web profile. So while Java EE has a bunch of complex, enterprise-level stuff in it, you just use the piece you need.

    However, it isn't even like Java EE is the choice for developing web applications in Java. It is the standard, but people have enjoyed great success with open-source frameworks like Spring MVC. If you expand your scope beyond Java to all JVM languages, you have Grails (in Groovy) and Play (in Java but also in Scala) at your disposal as well. Both are extremely good.

    And then there are so many other non-JVM options like Zend (PHP) as you say but also Rails, Django (Python), etc.

    So to truly appreciate what's "better," you need to consider a lot of things:

    • Your comfort and productivity with the language
    • Your comfort and productivity with the "ecosystem"--i.e. accessing third-party libraries to help you with various tasks, ease of mocking and testing, boilerplate code and mundane tasks being abstracted away, ease of implementing caching and minifying web assets, etc.
    • Ability to find help online through a vibrant community
    • Your requirements. If you need to access Amazon S3 buckets, for example, and your language or third-parties libraries in that language have poor S3 support, you should avoid it. Similarly, if you need to use Neo4J as a data store but there is poor support, move on.

    There is no "right" answer to this question. I would suggest the options approach described in Lean Software Development. Do some research to narrow your choices to three. Then get a site up and implement a representative feature with all three choices. The less appropriate choices for you will eliminate themselves and leave the best choice for you.

    As for your last question, Java is a programming language; Java EE is an enterprise software platform utilizing the Java language and the JVM (with multiple profiles as mentioned). The Ruby part of the application you mentioned was probably utilized with JRuby, which enables you to run Ruby on the JVM via JSR 223.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化