"A toy example: if you happen to have 2 products that are the same price you still wouldn't want to combine them into one constant value."
A more common example, take an online clothes store. They only sell shirts and trousers (pants - :]). It's a really simple app. Obviously, I'm skimming a great deal here, but each product category is described by the following properties:
- Shirts
-- Price
-- Size
-- Colour
- Trousers (Pants - :])
-- Price
-- Size
-- Colour
-- Length
What the DRY principle generally addresses, is this basic idea.
My instinct would be to create an abstract class called Clothing:
- Clothing
-- Price
-- Size
-- Colour
Trousers (Pants - :]), for me, would definitely be an extension of Clothing.
But until my suppliers can furnish me with Dresses, T-shirts, Scarves, etc, I would not be too concerned about even creating a separate Shirt class, but probably would.
What I've since found through experience however, is that not everyone thinks this way. For some people, each product category would have absolutely have to have it's own wholly encapsulated class in this situation. I can see the problem such an approach attempts to head off, but until the problem actually exists, I believe this pattern makes the development process painfully inefficient, and harder to maintain.
It's interesting to me, because while it seems like 'one of those' arguments, it's somewhat more impactful than 'tabs vs spaces'.