What is Java EE?

Java EE has this “mysterious shroud” around it for younger Java developers - the one I tried to pick up for a while with little success.

Confusion arises from:

  • Java EE seems to be both a library and a platform — there are many ways to “get” the Java EE library, usually from something like downloading the Java Java EE SDK. However, the Java EE library does not work and does not compile unless your code runs or has access to the Java EE application server (for example, JBoss, GlassFish, Tomcat, etc.). What for? Can libraries work outside the application server environment? Why do I need something massive, like JBoss, just to compile simple code to send email?

  • Why are Java EE libraries not “standard” and included in the regular JVM and / or SDK download?

  • Why are there so many Java EE offers when in fact there are only two main variations of standard Java (Oracle JVM / SDK | OpenJDK JVM / JDK)?

  • What can be done with Java EE that they cannot do with standard Java?

  • What can they do with standard Java that they cannot do with Java EE?

  • When does a developer decide that they "need" Java EE?

  • When does a developer decide that they don’t need Java EE?

  • Why is the Java EE library version not in sync with the standard Java library versions (Java EE 6 vs. Java 7)?

Thank you for helping me clear the flag!

+84
java java-ee
Apr 02 '13 at 21:40
source share
5 answers

Why can't libraries work outside the application server environment?

Actually, they can. Most libraries can be directly used autonomously (in Java SE) or included in .war (almost always Tomcat). Some parts of Java EE, such as JPA, have explicit sections in their respective specifications that tell how they should work and be used in Java SE.

In any case, this is not so much the application server environment as such, which is at stake here, but the presence of all other libraries and the integration code that combines them.

Because of this, annotations will be checked only once for all of your classes, and not for each library (EJB, JPA, etc.) performing this scan again and again. Also, because of this, CDI annotations can be applied to EJB beans, and JPA entity administrators can be introduced into them.

Why do I need something massive, like JBoss, just to compile simple code to send email?

There are several errors in this question:

  • To compile you only need an ATM ATM, which is below 1 MB for a web profile and just over 1 MB for a full profile.
  • To start, you obviously need an implementation, but "massive" exaggerates everything. For example, OpenJDK is about 75 MB, and TomEE (a web profile implementation containing email support) is only 25 MB. Even GlassFish (full profile implementation) is only 53 MB.
  • Mail works fine with Java SE (and therefore with Tomcat) using standalone mail.jar and activation.jar .

Why are Java EE libraries not “standard” and included in the regular JVM and / or SDK download?

To some extent, Java EE was one of the first attempts to split an already massive JDK into pieces that are easier to manage and load. People already complain that graphic classes (AWT, Swing) and applets are inside the JRE when all they do is run some commands on a headless server. And then you also want to include all Java EE libraries in the standard JDK?

With the final version of modularity support, we will only have a small basic JRE with many things that can be installed separately as packages. Perhaps one day, many or even all of the classes that now make up Java EE will also be like that. Time will tell.

Why are there so many Java EE offers when in fact there are only two main variations of standard Java (Oracle JVM / SDK | OpenJDK JVM / JDK)?

There are more than two options for Java SE. There is at least the IBM JDK, the previous BEA (the JRocket, which merges into Oracle / Sun due to the acquisition), various other open source implementations, and many implementations for embedded use.

The reason that Java SE and EE is a specification is because many vendors and organizations can implement it and thus encourage competition and reduce the risk of vendor blocking.

This really is no different from C and C ++ compilers, where you have many competing offers, as well as all adhering to the C ++ standard.

Why the Java EE library version is not in sync with the standard Java library versions (Java EE 6 and Java 7)

Java EE is built on Java SE, so it lags behind. Versions really match. Java EE 5 requires Java SE 5. Java EE 6 requires Java SE 6 and so on. That is, basically, when Java SE X is current, Java EE X-1 is current.

+33
Apr 03 '13 at 8:02
source share

Here are some quick answers to your questions ...

  • Why can't JavaEE libraries work without an application server? The services provided by JavaEE (container-driven transactions, dependency injection, container-managed, timer service, etc.) essentially include JavaEE-compatible application servers (e.g. GlassFish, JBoss, WebSphere, etc.). Therefore, JavaEE libraries have no purpose without such a container. "Why do I need something as massive as JBoss to just compose simple code to send email?" You will not do it. There are ways to send email without JavaEE ... But if you want to do this JavaEE, you need a JavaEE container.

  • Why aren't JavaEE libraries included in the JavaSE download? For the same reason that many libraries are not included: that would be redundant. Since you cannot even use JavaEE libraries without an application server, why include them? JavaEE should be downloaded if and when the developer installs the application server and decides to use JavaEE.

  • Why are there so many JavaEE sentences? Are there really many JavaEE sentences? If yes, list some of them. More precisely, I believe that there are several implementations of the same API.

  • What can be done with JavaEE, which they cannot do without standard Java? A lot of. You cannot rely on an application server to manage transactions or persistence contexts without JavaEE. You cannot allow an application server to manage EJB dependency injection without JavaEE. You cannot use the application-driven timer service without JavaEE. The answer to this question should make the answer to the first question quite clear ... Most of the services provided by JavaEE require a JavaEE container.

  • What can you do with JavaSE, what cannot you do with JavaEE? Hmm ... I don't know.

  • When did the developer decide that they needed JavaEE? This question is completely subjective ... But if you need any services provided by JavaEE, you start to think about it. If you do not know what JavaEE is, you probably do not need it.

  • When does a developer decide that they don’t need JavaEE? See previous answer.

  • Why is the JavaEE library version not in sync with the JavaSE version? Good question. I will not pretend that I know how to answer it ... But I would have guessed that the answer is "because they are not synchronized."

+12
Apr 02 '13 at
source share

When you look at the bird's eye, Java EE is a platform, that is, something we can rely on.

Taking a more technical perspective, the Java Enterprise Edition standard defines the set of APIs commonly used to create enterprise applications. These APIs are implemented by application servers - and yes, different application servers can use different Java EE API implementations.

However, the java ee library will not work or compile unless your code runs or has access to the Java EE application server (for example, JBoss, GlassFish, Tomcat, etc.).

You are compiling the Java EE APIs, so you only need these APIs at compile time. At run time, you will also need to implement these APIs, i.e. the application server.

Why do I need something massive so that JBoss just compiles simple code to send emails?

No. However, if you want to use the Java EE API to send mail, you will need to implement this API at runtime. This can be provided by the application server or provided by a separate library that you add to your classpath.

Why are Java EE libraries not “standard” and included in the regular JVM and / or SDK download?

Because only APIs are standardized, not implementations.

Why are there so many Java EE offers

Because people do not agree with the correct way to implement certain functions. Because different manufacturers are competing for market share.

What can they do with Java EE that they cannot do with standard Java?

Since Java EE implementations are built with "standard Java": Nothing. However, using existing libraries can save a lot of effort if you solve common problems with corporate clients, and using a standardized API can prevent a provider from being blocked.

What can they do with standard Java that they cannot do with Java EE?

Nothing because Java EE includes Java SE.

When does a developer decide that they "need" Java EE? When did the developer decide that they did not need Java EE?

Generally speaking, the Java EE APIs solve typical, recurring problems in enterprise computing. If you have such problems, it usually makes sense to use standard solutions, but if you have different problems, different solutions may be required. For example, if you need to talk to a relational database, you should consider using JPA. But if you do not need a relational database, JPA will not help you.

+8
Apr 03 '13 at 0:44
source share

What is Java EE?

Let's start by defining canonicity in the wiki:

Java, Enterprise Edition, or Java EE is an Oracle enterprise Java computing platform. The platform provides API and runtime environments for the development and launch of enterprise software, including network and web services and other large-scale, multi-level, scalable, reliable and secure network applications.

The main thing is that Java EE is a platform that provides an API, not some specific library.

What is needed for Java EE?

The bulk of Java EE is networking applications, unlike Java SE, focused on developing desktop applications with simple network support. This is the main difference between the two. Scalability, messaging, transactional transactions, database support for each application ... the need for all this increased with the development of the network. Of course, many of the off-the-shelf solutions that Java SE provides are useful for network development, so Java EE extends Java SE.

Why do we need application servers to run our code?

Why do we need operating systems? Because there is a lot of painful work with equipment that we need to do to make even the simplest application. And without an OS, you need to do this all over again. Oversimplified OS is just a software container that provides us with a global context for launching our applications.

And these are application servers. They allow us to run our applications in their context and provide us with the many high-level functionality that is required for enterprise high-performance network applications. And we don’t want to write our own bikes to solve these problems, we want to write code that will satisfy our business needs.

Another example would be the Java JVM.

Why doesn't Java EE contain an embedded application server?

Hard to say for me. I think this was done for more flexibility. Java EE says what they should do, they decide how to do it.

Why doesn't the JVM include Java EE?

Because they are directed to different sectors of the market. Java EE has many features that are not needed for regular desktops.

Why are there so many Java EE offers?

Because Java EE only describes behavior. Everyone can realize it.

What can they do with Java EE that they cannot do with Java SE?

To conquer the Internet. This is very difficult to do with Java applets and sockets :)

What can they do with Java SE that they cannot do with Java EE?

As mentioned above, Java EE extends Java SE, so with Java EE you can do everything that is available for Java SE.

When does a developer decide that they "need" Java EE?

When they need the power of Java EE. All of the above.

When did the developer decide that they did not need Java EE?

When they write a regular console or desktop application.

Why are Java SE and Java EE versions not synchronized?

Java has always had problems with naming and versioning technology. Therefore, this situation is no exception.

+8
Apr 03 '13 at 2:02
source share

Java EE is all about the container concept.
A container is an execution context in which your application will run and that provides this last set of services. Each type of service is defined by the JSR specification. For example, JSR 907, JTA (Api java transaction), which provide a standard way to manage a distributed transaction in relation to different resources.
There are usually many different implementations for a given JSR, the implementation that you will use depends on the container provider, but you really don't mind it, because you are sure that the behavior matches the predefined contract: the JSR API.
To take advantage of Java EE, you need to run the application inside the container. The two main ones are the EJB and the servlet container that are present on any Java EE-certified application server.

The purpose of all this is to define a standard runtime environment that allows you to pack your application only with the main ones, id.est. Your business. This allows you to avoid dependence on an unknown and a different set of third-party libraries that you will have to package and provide with your application otherwise and which can be sources of conflicts with other applications on the server. In Java EE, you know that all standard non-functional requirements, such as security, transaction, scalability, remote call, and much more, will be provided by the container (factorized for all applications running inside it), and you just need to base your work on it.

+6
Apr 3 '13 at 7:37
source share



All Articles