Album Cover

Design Patterns Vol. 2 Java

Close Preview
Please examine the scoreTicket(...) method below to see how Mike the Scalper goes about his work.
If Mike the Scalper has a ticket in stock for the requested concert, he
  • removes it from his inventory
  • adds his customary markup fee
  • delivers the ticket:

public class Scalper extends TicketHolder...
public Ticket scoreTicket(String concert) { Ticket ticket; if (inStock(concert)) ticket = removeFromInventory(concert); else ticket = connection.scoreTicket(concert); ticket.markup(20.00); return ticket; }
If you prefer, you may download and browse the code using an IDE instead:
| Tweet...
Page rating: | Rate this Page