Chapter 13. The Sniper Makes a Bid
In which we extract an AuctionSniper
class and tease out its dependencies. We plug our new class into the rest of the application, using an empty implementation of auction until we’re ready to start sending commands. We close the loop back to the auction house with an XMPPAuction
class. We continue to carve new types out of the code.
Introducing AuctionSniper
A New Class, with Dependencies
Our application accepts Price
events from the auction, but cannot interpret them yet. We need code that will perform two actions when the currentPrice()
method is called: send a higher bid to the auction and update the status in the user interface. We could extend Main
, but that class is looking rather messy—it’s already ...
Get Growing Object-Oriented Software, Guided by Tests now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.