Big Store
We're working for a large grocery store.

The store has 1000 different types of items.
Banana
	Milk		Bread
		Plantain		Coffee		Tea
	Apple		Silk
Hummus
What is High Level Algorithm for Computing Total Cost?

Iterate over all items Accumulate total cost Return total
Do We Need 1000 Solutions?
We have 1000 different item types.

Do we need a design (algorithm) for each?


No. One solution will do it.

totalCost = 0
Iterate over all items {
	totalCost = totalCost + eachItem.getCost()
}
return totalCost
How Do We Do It?
How did we condense 1000 types into one type?


We generalized all the different types to a common type -- something like GroceryItem.

Remember context.

We don't care about the difference betweeen banana and bread. We only care that each can answer "getCost".