๐Ÿš€ UllrichLumina

What exactly is Java EE

What exactly is Java EE

๐Ÿ“… | ๐Ÿ“‚ Category: Java

In the vast landscape of enterprise software development, understanding the foundational technologies is crucial. One such technology that has powered countless mission-critical applications for decades is Java EE. But what exactly is Java EE, and why has it been so pivotal for businesses ranging from financial institutions to e-commerce giants? At its core, Java EE, now known as Jakarta EE, is a set of specifications that define a standard for developing large-scale, multi-tiered, and highly secure enterprise applications. It provides a robust, standardized environment, allowing developers to focus on business logic rather than low-level infrastructure concerns. This powerful platform has enabled organizations to build scalable and reliable systems that manage complex operations, handle massive data volumes, and support thousands of concurrent users, making it an indispensable part of the enterprise ecosystem.

What is Java EE? The Enterprise Standard Defined

Java EE, which stands for Java Platform, Enterprise Edition, is more than just a programming language; it’s a comprehensive set of specifications and APIs (Application Programming Interfaces) designed for developing and running server-side enterprise applications. These applications are typically large, distributed, and require high levels of scalability, reliability, and security. Think of it as a blueprint for building robust software solutions that can handle the demanding needs of modern businesses. It provides a standardized framework, ensuring that applications developed using Java EE can be deployed and run on any compliant application server, offering significant flexibility and reducing vendor lock-in.

For decades, Java EE has been the backbone for building everything from banking systems and inventory management tools to customer relationship management (CRM) platforms and intricate supply chain solutions. Its strength lies in its ability to abstract away much of the complexity inherent in distributed computing. Developers don’t need to write custom code for transaction management, security, or concurrency; these capabilities are provided by the Java EE platform and the application server. This allows development teams to focus on delivering unique business value, accelerating development cycles, and ensuring the stability of critical systems. The transition to Jakarta EE under the Eclipse Foundation marked a significant step towards a more open, community-driven future, aligning it with modern cloud-native development trends while maintaining its enterprise focus.

Java EE provides a collection of APIs and runtime environments for developing and deploying large-scale, distributed, and highly available enterprise applications. It standardizes common enterprise concerns like database access (JPA), web services (JAX-RS), messaging (JMS), and transaction management, allowing developers to build robust, scalable, and secure systems with a clear, established architecture.

Key Components and Core Technologies

The power of Java EE lies in its rich set of component APIs, each addressing a specific aspect of enterprise application development. These APIs work together seamlessly within the confines of a Java EE application server to provide a complete, integrated environment. Understanding these core technologies is essential for anyone looking to build or maintain enterprise applications on this platform.

Web Tier Technologies: Servlets and JSP

At the forefront of the Java EE web tier are Servlets and JavaServer Pages (JSP). Servlets are Java classes that extend the capabilities of servers, handling requests from web browsers and generating dynamic responses. They are the programmatic backbone of web applications, managing HTTP requests and responses directly. JSPs, on the other hand, are text-based documents that contain static HTML along with special JSP tags that embed Java code. They are primarily used for creating dynamic web content, making it easier to separate presentation logic from business logic. Together, Servlets and JSPs form a powerful duo for building interactive and data-driven web interfaces.

Business Tier: Enterprise JavaBeans (EJB)

For managing complex business logic, transaction processing, and data persistence in a distributed environment, Java EE offers Enterprise JavaBeans (EJB). EJBs are server-side components that encapsulate business logic and are managed by the EJB container within the application server. They provide services like transaction management, security, concurrency, and persistence transparently to the developer. While their usage has evolved with the advent of simpler frameworks, EJBs remain a powerful tool for developing highly scalable and transactional business services, particularly for applications requiring strict adherence to ACID properties.

Persistence Tier: Java Persistence API (JPA)

Interacting with databases is a fundamental requirement for most enterprise applications, and the Java Persistence API (JPA) provides a standard, object-relational mapping (ORM) framework for this purpose. JPA allows developers to map Java objects to relational database tables, abstracting away the complexities of JDBC (Java Database Connectivity) and SQL. This enables developers to work with persistent data using object-oriented principles, significantly simplifying data access and manipulation. JPA, often implemented by providers like Hibernate, allows for efficient and robust data management across various relational databases.

Web Services: JAX-RS (RESTful Web Services)

In today’s interconnected world, applications often need to communicate with each other. JAX-RS, the Java API for RESTful Web Services, is a key component for building web services that adhere to the Representational State Transfer (REST) architectural style. It provides annotations and a programming model that simplify the development of RESTful APIs, enabling applications to expose and consume data over HTTP in a lightweight and flexible manner. This is crucial for integrating disparate systems and building modern, distributed architectures, including those supporting microservices.

Question & Answer :
I have been doing Java SE for some years now and moving on to Java EE. However, I have some trouble understanding some aspects of Java EE.

  1. Is Java EE just a specification? What I mean is: Is EJB Java EE?
  2. Are EJB/Spring different implementations of Java EE?

I am sorry to ask but I have some difficulties to understand what Java EE is.

Could someone explain what Java EE is? And EJB?

(Updated May 2023)

First of all, “Java EE” has since Sep 2019 been renamed to “Jakarta EE”, starting with version 8. Historically, there was also the term “J2EE” which covered versions 1.2 until 1.4. The term “Java EE” covered versions 5 until 8. See also Jakarta EE, History on Wikipedia.


Is Jakarta EE just a specification? What I mean is: Is EJB Jakarta EE?

Jakarta EE is indeed an abstract specification. Anybody is open to develop and provide a working implementation of the specification. The concrete implementations are the so-called application servers, like WildFly, TomEE, GlassFish, Liberty, WebLogic, etc. There are also servlet containers which implement only the JSP/Servlet part of the huge Jakarta EE API, such as Tomcat, Jetty, etc.

We, Jakarta EE developers, should write code utilizing the specification (i.e. import only jakarta.* classes in our code instead of implementation specific classes such as org.jboss.wildfly.*, com.sun.glassfish.*, org.apache.tomcat.*, etc) and then we’ll be able to run our code on any implementation (thus, on any application server). If you’re familiar with JDBC, it’s basically the same concept as how JDBC drivers work. See also a.o. In simplest terms, what is a factory?

EJB is part of the Jakarta EE specification. Look, it’s in the Jakarta EE API. Full-fledged Jakarta EE application servers support it out the box, but simple JSP/Servlet containers don’t.

See also:


Are EJB/Spring different implementations of Jakarta EE?

No, as said, EJB is part of Jakarta EE. Spring is a standalone framework which substitutes and improves many parts of Jakarta EE. Spring doesn’t necessarily require Jakarta EE to run. A bare-bones servlet container like Tomcat is already sufficient. Simply put, Spring is a competitor of Jakarta EE. E.g. “Spring” (standalone) competes EJB/JTA, Spring MVC competes Faces/REST/MVC, Spring DI/IoC/AOP competes CDI, Spring Security competes JASPIC/Security, Spring Boot competes MicroProfile, etc.

Back during the old J2EE/EJB2 times, the EJB2 API was terrible to implement and maintain. Spring was then a much better alternative to EJB2. But since EJB3 (Java EE 5), the EJB API was much improved based on lessons learnt from Spring. Since CDI (Java EE 6), there’s not really a reason to look at again another framework like Spring to make the developers more easy as to developing among others the service layer.

Only when you’re using a bare-bones servlet container such as Tomcat and can’t move on to a Jakarta EE server, then Spring is more attractive as it’s easier to install Spring on Tomcat. It isn’t possible to install e.g. an EJB container on Tomcat without modifying the server itself, you would basically be reinventing TomEE.

See also:

๐Ÿท๏ธ Tags: