O'Reilly logo

Prefactoring by Ken Pugh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required