Component Diagrams


A component diagram focuses on a set of components and the structural relationships among them. The diagram may also show interfaces.

Figure 9-4 shows a set of Java Servlets that have been defined for a Web server using the ‚ «servlet ‚ » stereotype.


Figure 9-4: Component diagram for Web server

The elements of Figure 9-4 are as follows :

  • Book Details retrieves the information, such as the thumbnail of the cover, the current price, and the various reviews that appear when the Customer wants to see the details about a particular Book.

  • Book Base contains a cached list of all available Books; other servlets call this one when they need to retrieve information about particular Books.

  • Catalog returns the results of Customer search and browse requests .

  • Login handles Customer logins.

  • Main Page is the first page a Customer sees when he or she gets to the bookstore's site.

  • Purchasing handles the conversion of a Shopping Cart to an Order and also interacts with the external financial entities that approve or deny Customer credit cards.

  • Shopping Cart View handles Customer modifications to the contents of Shopping Carts.

Figure 9-5 shows a set of components that have been defined on a separate application server.


Figure 9-5: Component diagram for application server

The elements of this diagram are as follows:

  • Book is an entity bean that contains a Book's ISBN, name , and author; a brief description of the Book; and the list price.

  • Cart Line Item is a stateful session bean that contains a pointer to a particular Book in a Shopping Cart, the desired quantity of that Book, and the discount on the list price of that Book, as applicable .

  • Customer is a stateful session bean that contains the key information necessary to log a Customer in and ship Orders to him or her.

  • Order is an entity bean that contained information such as the total cost of an Order and the date it was placed; a Shopping Cart becomes an Order when the Customer gives final approval.

  • Order Line Item is an entity bean that contains the same information as the associated Cart Line Item.

  • Pricer is a stateless session bean that calculates the cost for each Cart Line Item in a Customer's Shopping Cart, based on list prices, discounts , and quantities .

  • Shopping Cart is a stateful session bean that contains pointers to the Books that the Customer wants to buy.

Note that some of the session beans described in the previous list are stateful, rather than stateless, to allow a Customer to retrieve the contents of his or her Shopping Cart even after an interruption in his or her session.

Component diagrams are generally put into their own packages, such as the one shown in Figure 9-6.


Figure 9-6: Implementation package



Fast Track Uml 2.0
Fast Track UML 2.0
ISBN: 1590593200
EAN: 2147483647
Year: 2004
Pages: 97

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net