Wednesday, December 3, 2008

Overview of J2EE

Why use J2EE

J2EE may not be the perfect choice for developing enterprise applications. You should consider other alternatives before deciding to use J2EE. Some advantages of using J2EE for enterprise applications are listed below:

• Low level services are already implemented
An enterprise application needs to implement very complex services to be successful. Some of those services are transaction and state management, resource pooling and multi-threading. J2EE architecture separates those low level services from the application logic. Since all those services are implemented by applications servers, you can save a lot of time if you need those services.

• J2EE is well documented and understood
J2EE is developed by a consortium formed by several major companies in the industry. For more information on this consortium you can search for “Java Community Process” (see links section)

• J2EE is a standardized and reliable software architecture
Using standardized and reliable software architecture in your development will most likely decrease your future costs and ensure longevity of your applications.

• J2EE gives you a lot of flexibility
Once you develope your application with J2EE, you can deploy it wherever you need to. You can deploy your application to any application server with small changes.

• APIs used in J2EE are well documented.
Several APIs are used to implement low level details of enterprise applications. Since those APIs are already written and well documented, this will save you a lot of time.

J2EE Platform Architecture

J2EE platform uses a multi-tiered distributed application model. Application logic is divided into components and each component is installed on a specific machine based on which tier that component resides.

Figure-1 J2EE Application Model

As you can see from the Figure-1, there are four tiers in J2EE application model: client tier, web tier, business tier and enterprise information system (EIS) tier. Business and web tiers are generally existed in a server application called application server or J2EE server. Application server provides complex services needed by components in business and web tiers.

Figure-2 Interaction between client, web and business tiers in J2EE

Client tier can have two types of components: web client or application client. Web clients access the components in the web tier namely servlets or java server pages (jsp). Web browsers as a web client are generally used to access web tier components.

Application clients are standalone applications that do not run in browsers (e.g. swing application). They directly accesses to the components in the business tier.

Figure-3 Business and EIS tiers

Figure-3 shows Business and EIS tiers in detail. EIS tier contains database and legacy systems and can be accessed from the business tier.

There are three types of components in business tier: entity beans, session beans and message-driven beans. We will discuss them separately in detailed subsequent tutorials.

Another important concept in J2EE architecture is the “container” concept. An enterprise application needs to implement very complex services to be successful. Some of those services are transaction and state management, resource pooling and multi-threading. J2EE architecture separates those low level services from the application logic by implementing those services in containers. So, web containers are mainly used to provide low level services to web components (e.g. servlet) or EJBs (e.g. entity beans) Containers are also used to manage execution of the components in business tier. Figure-4 may demystify this idea more.

Figure-4 J2EE Application Server and Containers

0 comments: