ch01.html

来自「java2高级编程」· HTML 代码 · 共 331 行 · 第 1/2 页

HTML
331
字号
<LI CLASS="BL"><A NAME="pgfId-1087465"></A>Detailed description of item</LI><LI CLASS="BL"><A NAME="pgfId-1087466"></A>Number of days item is available for bidding</LI></UL><P CLASS="Body"><A NAME="pgfId-1087467"></A><EM CLASS="Bold">Buyer Bids on Items. </EM>The detailed summary page for each item lets registered users identify themselves and bid on the item by providing the following information: </P><UL><LI CLASS="BL"><A NAME="pgfId-1087468"></A>User ID</LI><LI CLASS="BL"><A NAME="pgfId-1087469"></A>Password</LI><LI CLASS="BL"><A NAME="pgfId-1087470"></A>Bid amount</LI></UL></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087471"></A>Activity Diagram</H5><P CLASS="Body"><A NAME="pgfId-1087474"></A><A NAME="marker-1087472"></A>The <A NAME="marker-1087473"></A>activity diagram in Figure 1.2 outlines the flow of tasks within the auction house as a whole. The solid black circle on the left shows the beginning of activities, and the white circles with black dots in the center denote where activities end. </P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087479"></A>Figure 1.2 <A NAME="34809"></A>Activity diagram</H6><DIV><IMG SRC="CH01-2.gif"></DIV></DIV></DIV></DIV><DIV><H4 CLASS="A"><A NAME="pgfId-1087481"></A><A NAME="48447"></A>Choosing the Software</H4><P CLASS="Body"><A NAME="pgfId-1087483"></A><A NAME="marker-1087482"></A>With the application modeled and project requirements defined, it is time to think about which Java APIs to use. The application is clearly client-and-server-based because you will want to accommodate 1 to n buyers, sellers, and viewers at any given time. Because registration and auction item data must be stored and retrieved from somewhere, you will need an API for database access.</P><P CLASS="Body"><A NAME="pgfId-1087484"></A>The core application can be created in a number of ways by using any of the following APIs (to name a few):</P><UL><LI CLASS="BL"><A NAME="pgfId-1087485"></A>Servlets and HTTP</LI><LI CLASS="BL"><A NAME="pgfId-1087486"></A>Sockets, multithreading, and JDBC&#153; APIs</LI><LI CLASS="BL"><A NAME="pgfId-1087487"></A>Remote Method Invocation (RMI) and JDBC APIs</LI><LI CLASS="BL"><A NAME="pgfId-1087488"></A>RMI over IIOP</LI><LI CLASS="BL"><A NAME="pgfId-1087489"></A>Enterprise JavaBeans platform.</LI><LI CLASS="BL"><A NAME="pgfId-1087490"></A>Java Transaction Architecture (JTA)</LI><LI CLASS="BL"><A NAME="pgfId-1087491"></A>Common Object Request Broker Architecture (CORBA)</LI><LI CLASS="BL"><A NAME="pgfId-1087492"></A>Java Native Interface (JNI)</LI></UL><P CLASS="Body"><A NAME="pgfId-1087493"></A>Instead of using all of these APIs as individual APIs in one application, you can use Enterprise JavaBeans. The Enterprise JavaBeans platform handles transaction and state management, multithreading, resource pooling, search functionality to handle common situations, and other complex, low-level details so you can focus on creating the best business solution. You get a distributed database application without writing any socket, thread, JDBC, or RMI code. For example, simple database transactions are rolled back (not written to the database) in the event of an error, database connections are cached so there is always a connection available when the application needs one, and items in the database are retrieved and displayed to the requestor using a simple search string.</P><P CLASS="Body"><A NAME="pgfId-1087494"></A>Chapter 2, Auction House Application, (page 11) explains the core Enterprise JavaBeans application code and how to set up and run the example. Later chapters explain how you can implement such things as your own transaction management for more complex transactions, database caching to improve performance, or a more complex or comprehensive search algorithm. </P></DIV><DIV><H4 CLASS="A"><A NAME="pgfId-1087496"></A><A NAME="40319"></A>Duke's Auction Demonstration</H4><P CLASS="Body"><A NAME="pgfId-1087499"></A><A NAME="marker-1087497"></A><A NAME="marker-1087498"></A>This section shows you how the auction house application Web pages look.</P><DIV><H5 CLASS="B"><A NAME="pgfId-1087501"></A><A NAME="marker-1087500"></A>Home Page</H5><P CLASS="Body"><A NAME="pgfId-1087502"></A>The home page (Figure 1.3) introduces the auction and makes auction house features available to buyers and sellers.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087506"></A>Figure 1.3 Duke's Auction home page</H6><DIV><IMG SRC="CH01-3.gif"></DIV></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087507"></A>Registration Page</H5><P CLASS="Body"><A NAME="pgfId-1087508"></A>The Registration page (Figure 1.4) gets information from new buyers and sellers so that all individuals initiating transactions at the auction house can be identified.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087512"></A>Figure 1.4 Duke's Auction buyer and seller registration</H6><DIV><IMG SRC="CH01-4.gif"></DIV></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087513"></A>New Auction Items Today</H5><P CLASS="Body"><A NAME="pgfId-1087514"></A>The New Auction Items page (Figure 1.5) lets anyone view new items for sale.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087518"></A>Figure 1.5 New items at Duke's Auction today</H6><DIV><IMG SRC="CH01-5.gif"></DIV></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087519"></A>Items Closing Today</H5><P CLASS="Body"><A NAME="pgfId-1087520"></A>The Items Closing page (Figure 1.6) lets anyone view auction items about to be sold to the highest bidder.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087524"></A>Figure 1.6 Items closing today at Duke's Auction</H6><DIV><IMG SRC="CH01-6.gif"></DIV></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087525"></A>All Items</H5><P CLASS="Body"><A NAME="pgfId-1087526"></A>The All Items page (Figure 1.7) lets anyone view all items available for sale.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087530"></A>Figure 1.7 All items available at Duke's Auction</H6><DIV><IMG SRC="CH01-7.gif"></DIV></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087531"></A>Search for Items</H5><P CLASS="Body"><A NAME="pgfId-1087532"></A>The Search Items page (Figure 1.8) lets anyone search for auction items for sale.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087536"></A>Figure 1.8 Search for items in Duke's Auction</H6><DIV><IMG SRC="CH01-8.gif"></DIV></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087537"></A>Sell Item</H5><P CLASS="Body"><A NAME="pgfId-1087538"></A>The Sell Item page (Figure 1.9) lets registered sellers post an item for sale.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087542"></A>Figure 1.9 Sell item at Duke's Auction</H6><DIV><IMG SRC="CH01-9.gif"></DIV><P CLASS="Body"><A NAME="pgfId-1026120"></A>&nbsp;</P></DIV></DIV></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?