Enterprise Java and Rational Rose -- Part I - More J2EE
(Page 3 of 6 )
J2EE and Other Java Platforms
You are probably wondering if there's a relationship between J2EE and the other Java platforms. In fact, there is! Sun has defined three platforms, all derived from the core Java technologies. They are targeted to three specific domains in order to provide specialized solutions for each:
- The consumer domain and the embedded market.
- The "general" application domain that uses core Java technologies.
- The enterprise application domain and the e-business market.
J2EE and Multi-Tier Architecture
An enterprise application may (but does not necessarily) consist of several tiers. Tiers are primarily abstractions to help us understand the architecture. The J2EE architecture usually involves four distinct tiers, as shown in Figure 2.

Figure 2: Multi-Tier Architecture
Say you are doing some shopping on the Net. Your browser is in the Client Tier displaying applets, HTML, etc. When you press "Submit," it invokes a servlet to run on the Web server, which resides in the Web Tier. The servlet may need to get some data via an EJB residing on the App Server in the Business Tier. The EJB may then need to access a database and retrieve the information you want in the Enterprise Information Systems (EIS Tier) .
More precisely, the tiers are distinguished as follows:
The Client Tier -- The Client Tier provides for the interaction between the Web application and the end users, typically through a thin client such as a browser. The technologies involved in this configuration are D/HTML, XML, XSL, Java™ Applet, etc.
A client may also be an "application-based" client that connects to an Enterprise Information System client. Such clients are commonly referred to as think clients.
The Web Tier -- The Web Tier is the interface between the end user and the business logic of your application. By separating the presentation logic from the business logic in this fashion, you can update the look and feel of your application without any modification to the business logic itself. This also allows you to have a throw-away facade that lets you stay in sync with the latest Internet technologies. At this level, you typically find the JSPs (Java Server Pages) and Java Servlets technologies, as well as use of XML, XSL, HTML, DHTML, GIF images, JPEG images, etc.
The 1.2 specification of J2EE also introduced the notion of a Web Application, which means that your Web-tier application can be packaged in a Java Archive called a Web Archive (.war file).
The Business Tier -- This is where you implement the business logic, that is, the actions that make up your application. These actions are encapsulated within components called Enterprise JavaBeans (EJBs). By far the most popular technology of the J2EE family, the Enterprise JavaBeans architecture brings to your application all the system-level services it might require, such as transactions, security, persistence, or multi-threading. These aspects of EJBs are handled by the EJB container, which we will discuss shortly.
The EIS Tier -- In this tier, you provide persistent storage for the resources required by your application.
Although an application does not have to have all these tiers as independent entities, it helps to conceptualize an application component as belonging to a specific tier so you can structure it appropriately. Such an approach is recommended for achieving a sound architecture.
The J2EE Conceptual Model
Let's now visualize J2EE as an onion with several layers of skin.
The outermost layer is the server software, which enables application software to run on the physical hardware. The container is the next layer in. It provides generic services and hosting for the enterprise application. The enterprise application consists of EJBs, servlets, and JSPs. Each container provides services to the EJBs and servlets it is hosting. These services are provided via the J2EE APIs, as specified by the J2EE specification.
To understand the container model within a more familiar context, consider this. If you, as a developer, want to access a relational database, you probably don't really want to know what kind of caching architecture the database provider is using. Nor is there likely a strong desire on your part to implement all the access details.
Given that all databases are conceptually similar, what you need is an abstraction for the database that easily provides access to the data and associated services. A container that holds your data with a set of services is that abstraction. The J2EE simply extends this container/data architecture to the enterprise application domain.
Figure 3 shows the J2EE Conceptual Model.

The J2EE platform defines four containers: a Client Container and an Applet Container (Client Tier), a Servlet and JSP Container (Web Tier) and an EJB Container (Business Tier). These containers provide deployment and runtime support for the associated tier components. A container is located within a server. The relationship between a server and the containers within it is illustrated in Figure 4.

Next: Enterprise JavaBeans >>
More Development Cycles Articles
More By The Rational Edge