简体   繁体   English

Java EE示例应用程序

[英]Java EE sample App

I have been using Java SE for 2 yrs now and I am pretty ok with the fundamentals of Java. 我现在已经使用Java SE 2年了,我对Java的基础知识非常了解。 I would like to move to the Java EE API and develop something based on this. 我想转到Java EE API并基于此开发一些东西。 I have 2 questions: 我有两个问题:

  1. Does the EE API contain all the classes of the SE? EE API是否包含SE的所有类? ie can anything developed in the SE also be developed using the EE API? 即SE中开发的任何东西也可以使用EE API开发吗?

  2. Can anybody point me in the direction or offer a suggestion for the development of a sample Java EE application such as a web service or something. 任何人都可以指出我的方向或提供开发样本Java EE应用程序(如Web服务等)的建议。 Ideally, this sample app would be testable on my local machine and would be worthy of placing in my portfolio for future job interviews as a Java developer. 理想情况下,这个示例应用程序可以在我的本地计算机上测试,并且值得作为Java开发人员放置在我的投资组合中以供将来的面试。

Does the EE API contain all the classes of the SE? EE API是否包含SE的所有类?

Yes. 是。 The Java EE platform is built on top of the Java SE platform. Java EE平台构建于Java SE平台之上。

Can anybody point me in the direction or offer a suggestion for the development of a sample Java EE application 任何人都可以指出我的方向或提供开发样本Java EE应用程序的建议

Have a look at the Java EE Code Samples & Apps . 查看Java EE代码示例和应用程序

To answer your first question, Java EE is a large set of APIs (Servlets, EJB, JNDI, JDBC etc.). 为了回答您的第一个问题,Java EE是一组大量的API(Servlet,EJB,JNDI,JDBC等)。

It supplements the Java SE and is distinct from Java SE and whichever implementations you choose provide additional functionality to that available in Java SE. 补充了Java SE,与Java SE 不同 ,您选择的任何实现都提供Java SE中可用的附加功能。

There are a couple of Java EE example applications in the Java EE 5 Tutorial . Java EE 5教程中有几个Java EE示例应用程序。 See the Case Studies section. 请参阅案例研究部分。 Also note that the Java EE tutorial is updated for Java 6 , I just don't see the case studies, which I think will be the most applicable section to your question. 另请注意, Java EE教程已针对Java 6进行了更新 ,我只是看不到案例研究,我认为这将是您问题中最适用的部分。

As far as Java EE API containing all of the classes of the Java SE API, I don't know of anything that's missing from Java EE. 至于包含Java SE API的所有类的Java EE API,我不知道Java EE中缺少的任何东西。

The EE is a superset of SE, but most of the difference is in how you expect to deploy it. EE是SE的超集,但大多数差异在于您希望如何部署它。

SE tends to be deployed as a single app that runs on one machine. SE倾向于部署为在一台机器上运行的单个应用程序。

EE is a set of tools and APIs added to SE that allow for deployment in various client/server configurations (most notably, web). EE是一组添加到SE的工具和API,允许在各种客户端/服务器配置(最值得注意的是Web)中进行部署。

There are some restrictions using various parts of EE. 使用EE的各个部分有一些限制。 For instance when programming EJBs you shouldn't access files because there is no guarantee there is a filesystem available (I don't think many containers mind if you actually do ... but thats another matter ...), and you shouldn't start threads, because that part is supposed to be handled by the container (if you do you may experience unexpected results). 例如,在编写EJB时,您不应该访问文件,因为无法保证有可用的文件系统(我不认为很多容器会介意,如果您确实这样做......但这是另一回事......),你不应该' t启动线程,因为该部分应该由容器处理(如果你这样做,你可能会遇到意想不到的结果)。

Over time EE and standard edition seems to get closer and closer. 随着时间的推移,EE和标准版似乎越来越近了。 JDBC is an EE API, but it has always been shipped with standard edition. JDBC是一个EE API,但它一直随标准版一起提供。 Today Entity beans and the JPA api is also available without a full EE stack, you can run it in a standard JVM or a webcontainer like Tomcat, but you need an implementation like Hibernate or OpenJPA and a database (like the one embedded in the JDK or any other). 今天实体bean和JPA api也可以在没有完整的EE堆栈的情况下使用,你可以在标准的JVM或像Tomcat这样的web容器中运行它,但你需要像Hibernate或OpenJPA这样的实现和数据库(就像JDK中嵌入的那样)或任何其他)。 You miss the ejb-containers automatic transaction handling though, but you may just as well need that control yourself, depending on the application. 您错过了ejb-container自动事务处理,但您可能也需要自己控制,具体取决于应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM