Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

J2EE application components

A discussion of the J2EE application components.

If you're going to use J2EE for developing Web services, then you have to understand what it is and what components make it up. Not so tough, to be sure, but essential. One of the first tasks facing anyone trying to lead about is field is to learn the vocabulary. This tip, then, excerpted from InformIT, discusses some of the names and definitions of the components of J2EE.

The J2EE standard defines a rich set of application component framework, with which almost all kinds of business applications can be built. These applications range from simple Web portals to complex, distributed, enterprise-scale transactional applications. Application components, which are the brick and mortar of enterprise systems, are built on the top of this framework.

[The] J2EE component framework is only a rudimentary infrastructure—in the form of libraries, base classes, and interfaces. Application components that are built over them usually embody business logic and the presentation/controller logic that make up the application.

For example, let us consider servlets, which are standard application components provided by J2EE. Servlets for a given business application are to be developed on top of a basic servlet interface provided by J2EE. While doing so, developers can make use of servlet libraries and services that come along with the servlet package. Many of the system level services, such as reading data from an HTTP input stream or writing data to an HTTP output stream, are available within these libraries, so that applications can readily make use of them.

Hence, we term the component infrastructure provided by J2EE as an application framework, and those codes written on top of it as J2EE application components. But I'll be using these two terms interchangeably, throughout this series for the sake of simplicity.

J2EE application components are available for the client tier, presentation tier, and business logic tiers.

These components include the following:

  • Client tier: applets, Javabeans
  • Presentation logic tier: servlets, Java server pages, Javabeans
  • Business logic tier: Enterprise Javabeans

It is very important to note that normal Java classes and Jar archives can be hosted in all of these tiers very well, apart from the J2EE-specific components listed above. In many cases, we will find application codes spilling outside the J2EE components into normal Java classes.

Components are not available for the Enterprise Information System (EIS) tier because EIS encompasses all enterprise backend resources —such as databases, BackOffice/legacy systems, and ERP implementations—in the J2EE realm. Obviously, all we need is access to these resources from our application components, which are taken care of by J2EE enterprise services. Thus, there is no scope for application components in the EIS tier.

Applications are to be coded by the programmer, using one or more of these components, and deployed in respective containers.

Arriving at a proper mix of application components for a given business scenario is the crafty job of a J2EE architect. Because there are a wide variety of components available, it requires considerable knowledge and experience to choose the right mixture of components that will result in optimized code and performance-rich applications.

By assigning specific and well-defined roles to each application component, J2EE aims to provide room for logical application architecture, design, and development. The component interfaces ensure that the components adhere to certain standards and exhibit common behavior, which provides the base for interoperable J2EE server environments.

These application components are loosely coupled across the tiers to ensure flexibility and reusability while interacting with each other. A whole range of enterprise services—such as mailing, database connectivity, messaging, and transaction processing—are available at the disposal of application components.

On the flip side, unlike .Net framework, which is Microsoft's middleware architecture, all J2EE application components are to be coded only in the Java language!

To read the entire article from which this tip comes, click over to InformIT. There's no registration required, no fuss, no muss. Just more info on this important topic.

Dig Deeper on Topics Archive