14.1. The Second Store

Sam comes in and tells me he is opening his second store in the near future and he wants the system to be ready when that occurs.

I ask the leading question, "Are these two stores, or one store in two places?"

Sam stares at me with "the look."

He is already familiar with the reasons behind my strange questions. "What's the difference?" he asks.

"In the case of two stores, the system is almost ready to go now," I replied.

"And in the other case?" he queried.

"Then I've got some questions for you to answer."

"It sounds like the first case will cost less," he noted. "But go ahead with your questions."

"I wrote down the assumptions I made in the first system and the design decisions that were relevant to those assumptions. The assumptions are hard to decipher from the code itself, so I kept them as a separate document."

I continued, "A CDDisc was either in the store or not in the store. If it was not in the store and not part of a Rental, it was assumed lost. There was nowhere else for the Rental to go, except to be lost and never returned (like Charlie on the MTA). If CDDiscs were rented in only one store and were returned to that store, we could stop here."

"I like stopping; it is definitely cheaper. But what happens if I let them return a CDDisc to another store?" asked Sam.

"It makes things a little harder," I said. "Currently, when a customer returns a CDDisc to the store and the PhysicalID is entered into the system, the system might respond that the ...

Get Prefactoring 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.