📄 overview2.html
字号:
<a name="wp79768"> </a><p class="pBody">Application clients directly access enterprise beans running in the business tier. However, if application requirements warrant it, a J2EE application client can open an HTTP connection to establish communication with a servlet running in the Web tier.</p><a name="wp79769"> </a><h4 class="pHeading3">JavaBeans<img src="images/tm.gif" border="0" alt="Trademarked"> Component Architecture</h4><a name="wp79771"> </a><p class="pBody">The server and client tiers might also include components based on the JavaBeans component architecture (JavaBeans component) to manage the data flow between an application client or applet and components running on the J2EE server or between server components and a database. JavaBeans components are not considered J2EE components by the J2EE specification. </p><a name="wp79772"> </a><p class="pBody">JavaBeans components have instance variables and <code class="cCode">get</code> and <code class="cCode">set</code> methods for accessing the data in the instance variables. JavaBeans components used in this way are typically simple in design and implementation, but should conform to the naming and design conventions outlined in the JavaBeans component architecture.</p><a name="wp79773"> </a><h4 class="pHeading3">J2EE Server Communications</h4><a name="wp79777"> </a><p class="pBody"><a href="Overview2.html#wp79786">Figure 1-2</a> shows the various elements that can make up the client tier. The client communicates with the business tier running on the J2EE server either directly or, as in the case of a client running in a browser, by going through JSP pages or servlets running in the Web tier. </p><a name="wp79779"> </a><p class="pBody">Your J2EE application uses a thin browser-based client or thick application client. In deciding which one to use, you should be aware of the trade-offs between keeping functionality on the client and close to the user (thick client) and off-loading as much functionality as possible to the server (thin client). The more functionality you off-load to the server, the easier it is to distribute, deploy, and manage the application; however, keeping more functionality on the client can make for a better perceived user experience.</p><div align="left"><img src="images/Fig22.gif" height="229" width="371" alt="Server Communications" border="0" hspace="0" vspace="0"/></div><p class="pBody"></p><p> <a name="79786"> </a><strong><font >Figure 1-2 Server Communications</font></strong></p><a name="wp79787"> </a><h3 class="pHeading2">Web Components</h3><a name="wp79790"> </a><p class="pBody">J2EE Web components can be either servlets or JSP pages. <em class="cEmphasis">Servlets</em> are Java programming language classes that dynamically process requests and construct responses. <em class="cEmphasis">JSP pages</em> are text-based documents that execute as servlets but allow a more natural approach to creating static content.</p><a name="wp79792"> </a><p class="pBody">Static HTML pages and applets are bundled with Web components during application assembly, but are not considered Web components by the J2EE specification. Server-side utility classes can also be bundled with Web components and, like HTML pages, are not considered Web components.</p><a name="wp79797"> </a><p class="pBody">Like the client tier and as shown in <a href="Overview2.html#wp83971">Figure 1-3</a>, the Web tier might include a JavaBeans component to manage the user input and send that input to enterprise beans running in the business tier for processing. </p><a name="wp79799"> </a><h3 class="pHeading2">Business Components</h3><a name="wp83959"> </a><p class="pBody">Business code, which is logic that solves or meets the needs of a particular business domain such as banking, retail, or finance, is handled by enterprise beans running in the business tier. <a href="Overview2.html#wp79816">Figure 1-4</a> shows how an enterprise bean receives data from client programs, processes it (if necessary), and sends it to the enterprise information system tier for storage. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it back to the client program. </p><div align="left"><img src="images/Fig33.gif" height="226" width="446" alt="Web Tier and J2EE Applications" border="0" hspace="0" vspace="0"/></div><p class="pBody"></p><p> <a name="83971"> </a><strong><font >Figure 1-3 Web Tier and J2EE Applications</font></strong></p><a name="wp83979"> </a><p class="pBody"></p><div align="left"><img src="images/Fig4a5.gif" height="185" width="446" alt="Business and EIS Tiers" border="0" hspace="0" vspace="0"/></div><p class="pBody"></p><p> <a name="79816"> </a><strong><font >Figure 1-4 Business and EIS Tiers</font></strong></p><a name="wp79818"> </a><p class="pBody">There are three kinds of enterprise beans: session beans, entity beans, and message-driven beans. A <em class="cEmphasis">session bean</em> represents a transient conversation with a client. When the client finishes executing, the session bean and its data are gone. In contrast, an <em class="cEmphasis">entity bean</em> represents persistent data stored in one row of a database table. If the client terminates or if the server shuts down, the underlying services ensure that the entity bean data is saved. </p><a name="wp79819"> </a><p class="pBody">A <em class="cEmphasis">message-driven bean</em> combines features of a session bean and a Java Message Service (JMS) message listener, allowing a business component to receive JMS messages asynchronously.</p><a name="wp79825"> </a><h3 class="pHeading2">Enterprise Information System Tier</h3><a name="wp79827"> </a><p class="pBody">The enterprise information system tier handles enterprise information system software and includes enterprise infrastructure systems such as enterprise resource planning (ERP), mainframe transaction processing, database systems, and other legacy information systems. J2EE application components might need access to enterprise information systems for database connectivity, for example. </p> </blockquote> <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"> <table width="550" summary="layout" id="SummaryNotReq1"> <tr> <td align="left" valign="center"> <font size="-1"> <a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a> </td> <td align="center" valign="center"><a accesskey="p" href="Overview.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="Overview3.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a> </td> <td align="right" valign="center"> <font size="-1"> <a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font> </font> </td> </tr> </table> <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"><p><font size="-1">All of the material in <em>The J2EE(TM) 1.4 Tutorial</em> is <a href="J2EETutorialFront2.html">copyright</a>-protected and may not be published in other workswithout express written permission from Sun Microsystems.</font> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -