Home Interface - Bid
  • Example 8 shows the source code for the home interface for the Bid EJB
  • One create method
    • Takes the user posting the bid, the item, and the amount as parameters
    • None of these can subsequently be changed
    • The Bid EJB, like Item, derives its identity from its owner
  • Five different finder methods
    • Filter all bids according to various criteria: owner, item, maximum bid
  • Q: What is the correct set of finder methods?
  • A: Application dependent, but finder methods should avoid redundancy
    • According to this maxim, findMaxBidForItem() should not really be there, because it can be computed from findBidsByItem()
    • However, as it turns out, its implementation is efficient

Next Slide >>