Develop n-tier applications using J2EE
An introduction to the Java 2 Platform, Enterprise Edition specification by way of BEA's WebLogic Server
By Steven Gould, JavaWorld.com, 12/01/00
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Java originally made its debut in browsers and client machines; at the time, many questioned whether it was suitable for server-side
development. Now, with increasing third-party support for the Java 2 Platform, Enterprise Edition (J2EE), Java has become
a widely accepted alternative for developing enterprise-strength server-side solutions.
The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the
functionality for developing multitiered Web-based applications.
In this article, we will examine the 13 core technologies that make up J2EE: JDBC, JNDI, EJBs, RMI, JSP, Java servlets, XML,
JMS, Java IDL, JTS, JTA, JavaMail, and JAF. We will describe where and when it is appropriate to use each technology; we will
also describe how the different technologies interact with each other.
Moreover, to give J2EE a real-world feel, we'll look at its main technologies in the context of WebLogic Server, a widely
used J2EE implementation from BEA Systems. With that in mind, this introductory article will be of interest to developers
new to WebLogic Server and J2EE, as well as project managers and business analysts with an interest in understanding what
J2EE has to offer.
The big picture: Distributed architectures and J2EE
In the past, two-tier applications -- also known as client/server applications -- were commonplace. Figure 1 illustrates the typical two-tier architecture. In some cases, the only service provided by
the server was that of a database server. In those situations, the client was then responsible for data access, applying business
logic, converting the results into a format suitable for display, displaying the intended interface to the user, and accepting
user input. The client/server architecture is generally easy to deploy at first, but is difficult to upgrade or enhance, and
is usually based on proprietary protocols -- typically proprietary database protocols. It also makes reuse of business and
presentation logic difficult, if not impossible. Finally, and perhaps most important in the era of the Web, two-tier applications
typically do not prove very scalable and are therefore not well suited to the Internet.

Figure 1. Two-tier application architecture
Sun designed J2EE in part to address the deficiencies of two-tier architectures. As such, J2EE defines a set of standards
to ease the development of n-tier enterprise applications. It defines a set of standardized, modular components; provides a complete set of services to
those components; and handles many details of application behavior -- such as security and multithreading -- automatically.
Using J2EE to develop n-tier applications involves breaking apart the different layers in the two-tier architecture into multiple tiers. An n-tier application could provide separate layers for each of the following services:
- Presentation: In a typical Web application, a browser running on the client machine handles presentation.
- Dynamically generated presentation: Although a browser could handle some dynamically generated presentation, for the widest support of different browsers much
of the action should be done on the Web server using JSPs, servlets, or XML (Extensible Markup Language) and XSL (Extensible
Stylesheet Language).
- Business logic: Business logic is best implemented in Session EJBs (described later).
- Data access: Data access is best implemented in Entity EJBs (described later) and using JDBC.
- Backend system integration: Integration with backend systems may use a variety of technologies. The best choice will depend upon the exact nature of
the backend system.
You may begin to wonder: why have so many layers? Well, the layered approach makes for a more scalable enterprise application.
It allows each layer to focus on a specific role -- for example, allowing a Web server to serve Webpages, an application server
to serve applications, and a database server to serve databases.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- "JDBC Drivers in the Wild," Nitin Nanda (JavaWorld, July 7, 2000) explains how to deploy, use, and benchmark JDBC driver types 1, 2, 3, and 4
http://www.javaworld.com/jw-07-2000/jw-0707-jdbc.html
- "XML Document Processing in Java Using XPath and XSLT," André Tost (JavaWorld, September 8, 2000)
http://www.javaworld.com/javaworld/jw-09-2000/jw-0908-xpath.html
- "Programming XML in Java, Part 1," Mark Johnson (JavaWorld, March 2000) looks at how to use SAX to process XML documents in Java
http://www.javaworld.com/javaworld/jw-03-2000/jw-03-xmlsax.html
- For more JavaWorld articles covering JDBC, visit the Java Database Connectivity (JDBC) section of our Topical Index
http://www.javaworld.com/javaworld/topicalindex/jw-ti-jdbc.html
- JavaWorld's Topical Index also offers extensive articles on EJBs
http://www.javaworld.com/javaworld/topicalindex/jw-ti-ejb.html
- JavaWorld's Topical Index offers a lot of information on XML as well
http://www.javaworld.com/javaworld/topicalindex/jw-ti-javaxml.html
- For answers to your pressing J2EE questions, check out the JavaWorld Server-Side Java discussion
http://forums.itworld.com/webx?14@@.ee6bdcf
- Sign up for the JavaWorld This Week free weekly email newsletter and keep up with what's new at JavaWorld
http://www.idg.net/jw-subscribe
- Professional Java XML Programming with Servlets and JSP, Alexander Nakhimovsky and Tom Myers (Wrox Press, 1999) provides good coverage of XML and related topics and their relation
to Java
http://www.amazon.com/exec/obidos/ASIN/1861002858/qid=974496697/sr=1-3/107-1103713-5842922
- Sun's J2EE page contains the latest information and updates to the J2EE specifications
http://www.javasoft.com/j2ee
- You'll also want to check out Sun's J2EE documentation, FAQs, and developer guides
http://java.sun.com/j2ee/docs.html
- The WebLogic Server Website offers extensive documentation on installing, configuring, and administering WebLogic Server,
and on using it as a development platform. It should be the first place you look for help with any WebLogic-related questions
you have
http://www.weblogic.com
- The HttpServlet API documentation at Java.sun.com offers more information on Java servlets
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServlet.html
- Sun's Java Developer Connection -- a must for every Java developer -- contains reservoirs of technical documentation, FAQs,
whitepapers, and more
http://developer.java.sun.com/developer
- Developing Java Enterprise Applications, Stephen Ashbury and Scott R. Weiner (John Wiley and Sons, 1999) covers much of the same material as this article but in significantly
more depth
http://www.amazon.com/exec/obidos/ASIN/0471327565/o/qid=974165631/sr=8-2/ref=aps_sr_b_1_2/104-2442186-0189510
- "Java Database Connectivity," Carol Sliwa (Computerworld, December 13, 1999) discusses the pros and cons of the four types of JDBC driver, and covers when you would use each
http://www.computerworld.com/cwi/story/0,1199,NAV47-68-85-98_STO43545,00.html
- Sun's Java.sun.com Website offers a complete list of JNDI service providers
http://java.sun.com/products/jndi/serviceproviders.html
- "The JNDI tutorialBuilding Directory-Enabled Java Applications," Rosanna Lee (Java.sun.com, May 1, 2000)
http://java.sun.com/products/jndi/tutorial/index.html
- Visit Sun's Java-XML page for news on the latest developments surrounding the combination of Java and XML
http://java.sun.com/xml
- The XML Zone at IBM's developerWorks
http://www.ibm.com/developer/xml/
ReBy Anonymous on December 30, 2009, 2:24 pmYour issue close to this topic is professional and some students would utilize that for their format thesis. But some people still take the support of buy dissertation...
Reply | Read entire comment
This article is almost 10 years oldBy Anonymous on September 21, 2009, 10:54 amDid anyone else notice this article is almost ten years old! It was posted on 12/01/2000
Reply | Read entire comment
Nice post about descriptionBy aimée andré on September 16, 2009, 5:50 amNice post about description J2EE. I like your blog very much because it has very interesting articles of different topics like 70-642 questions, 70-649 questions...
Reply | Read entire comment
lesson servletBy Anonymous on August 14, 2009, 2:07 pmno
Reply | Read entire comment
Description of J2EE along with application serverBy Anonymous on August 11, 2009, 6:17 amExplained clearly and with the beauty of simplicity added to it
Reply | Read entire comment
View all comments