Pages

Tuesday, 5 February 2013

Introduction To Java EE Concepts

This post aims at clarifying acronyms and concepts used in the Java EE paradigm, where EE stands for Entreprise Edition. It enables the creation of modular Java applications to be deployed on application servers. It relies on Java SE, a core set of Java libraries upon which all Java applications are implemented.

General Concepts

Before we dive into Java EE, here is a reminder of general concepts:

Multitier Application - A multitier application (or multitier architecture) is an application divided into multiple logical parts which are implemented (most often) on multiple servers. For example, the 3-tier model with a user and its browser, the application server and the database located on a separate server dealing with application server requests.

Multitier Service - When thinking about services in the 3-tier model, the application server is a service providing responses to user requests. The database server provides answers to queries made by the application server.

Java Bean - These are Java classes containing private properties, made accessible with getters and setter methods. Technically speaking, these classes must also have a no parameter constructor and implement the Serializable interface.

Java EE 5 Concepts

Java EE Application Model - This model describes a multitier architecture to implement services. The boundary defining what a service is is not defined clearly. In fact, a service is a logical concept and its concrete/real counterpart depends on the application implementing those concepts. For example, it is a server in the client/server model.

Java EE Server - It is the application server of the 3-tier paradigm, in the Java EE paradigm. It is composed of the web tier (serving JSP pages) and the business tier (managing enterprise Java beans).

Java EE Components - 'Components' mean independent software unit used in combination with other components to build an application.

Web Component - Part of the web tier generating pages or whatever is returned to user queries. Typically, these are Java Servlets, JavaServer Faces and Java Server Pages.

Applet - A small Java software application sent as part of a response to a user request, and which is meant to run in the user's browser. Applets are in competition with Javascript.

Application Client - For example, a desktop application written in Java.

Enterprise Java Beans - See below.

Java EE Clients - This concepts regroups three other concepts:

Web Client (or thin client) - In (not so) old times, web pages returned to client requests used to contain code scripts which were executed on the application server before returning the result to clients. These pages were considered as EE clients. For example, one could query a list of employee and display different results depending on the querying user. Today, most developers do not include scripts in their web pages anymore. It is considered a bad practice. They tend to use MVC design principles, which prohibit scripts in those pages.

Applet

Application Client

Java EE Server Communication - This refers to the communication happening between thin clients and application clients with the application server. Typically, thin clients and applets communicate with the web tier, while application clients communicate with EJBs.

You don't find this very clear too? You think it is cumbersome? Welcome to the club! This is why REST principles, together with MVC design principles are prevailing in web application development nowadays.

EJB (Enterprise Java Beans) - This is a logical concept which has nothing to do with traditional Java Beans. It basically tries to encapsulate business logic on the backend (i.e., server-side) of multi-tier applications. One key issue it was originally trying to solve is transactional integrity with the database. Warning: there has been several versions of EJB and version 3.0 is a clear breakaway from earlier versions.

JavaBean Component - It is a synonym of Java Bean mostly used in the JSP paradigm.

Deployment Descriptor - This is a XML file providing deployement information for packaged applications. See here for more information.

SOAP (Simple Object Access Protocol) - It is a protocol to exchange messages across services offered on the web. The messages are structured according to XML and can be exchanged via many transportation layers, but most often HTTP. SOAP competes with JSON and REST-like services.

JSP (JavaServer Page) - A text based HTML document (i.e., a kind of template) processed to produce static content. It can contain snippets of script code which is executed to render the final static documents.

JSTL (JavaServer Page Standard Tag Library) - A set of standard tags used in JSP to mimic scripting code functionalities. For example, looping over a list of clients to display their corresponding information. Nowadays, such tags have replaced scripting code in JSP. They are mostly used to generated to populate pages with information to display to users.

JSF (Java Server Face) - These are JavaServer Page including JavaServer Face tags (which are similar to JSTL tags). In addition, JSF allows the definition of navigation models between pages (something similar to Spring web flow). It also includes Facelets.

Facelets - Facelets is the MVC view part of JSF. It basically converts templates into HTML documents using provided data (for example with a list of clients). It can also extract parts of generated documents (for example a HTML body) and include it in another template. This is equivalent to what Sitemesh does too.

JASPIC (Java Authentication Service Provider Interface) - This is the complementary authentication SPI (i.e., Service API) to JACC. It defines how applications can access traditional authentication services.

2 comments:

You are using a totally outdated terminology here: J2EE stands for "Java 2 Enterprise Edition". That term was used until version 1.4, ten years ago. Since 1.5, the Enterprise Edition was renamed to Java EE (omitting the "2" as it was misleading). Please note that there is no such thing as J2EE 6 or even JEE.