Thinking of building a nested category "system" using "chained strings" for lack of a better term. Here's the plan:
A category slug could be something like "shopping-clothing-womans". This would correlate to a 3 deep category: Shopping > Clothing > Woman's.
An object in the database would have a category field, containing the slug. Let's say there are several objects, with varying slugs in the Shopping > Clothing category, perhaps: "shopping-clothing-mens", "shopping-clothing-kids" and "shopping-clothing-other".
I'd have a collection, or a dictionary, that would translate that slug into something more meaningful for end-users (for example, "shopping-clothing-womans" -> "Woman's Clothing").
If I wanted to select all the objects that were in the Shopping > Clothing category, I'd do something like this:
DB.Objects.Where(a => a.Category.Contains("shopping-clothing"));
And would get back all the womans, mens, kids and clothing subcategories of the Shopping > Clothing category.
The goal is simple querying, yet remain powerful with capabilities of near endless sub categorization without insane DB relations and JOINS. I'm also leaning toward perhaps adapting my application to a NoSQL database in the future, this would help in implementing that.
But, the query above worries me... would it be slow?
Is this plan a bad idea?