Domain Objects - The Item
  • Example 3 shows the source code for the interface for the Item object
  • An item is something that's up for sale
  • Again, there could be a fair amount of information associated with an item
    • E.g. images, links
    • But our implementation simply has a textual description
      • Description set and retrieved using setDescription() & getDescription()
  • The item also has an attributed indicating when the auction for it will terminate
    • Set and retrieved using setAuctionEnd() and getAuctionEnd()
    • Note that the type java.util.Calendar is used here
    • This works even when called remotely
    • Parameter and return types must be serializable
    • Serializable types are passed by value (e.g. a copy is made)

Next Slide >>