Is this more suited for key value storage or a tree?

Posted by JC on Stack Overflow See other posts from Stack Overflow or by JC
Published on 2010-03-18T06:32:26Z Indexed on 2010/03/18 6:41 UTC
Read the original article Hit count: 290

Filed under:

I'm trying to figure out the best way to represent some data. It basically follows the form Manufacturer.Product.Attribute = Value. Something like:

Acme.*.MinimumPrice = 100
Acme.ProductA.MinimumPrice = 50
Acme.ProductB.MinimumPrice = 60
Acme.ProductC.DefaultColor = Blue

So the minimum price across all Acme products is 100 except in the case of product A and B. I want to store this data in C# and have some function where GetValue("Acme.ProductC.MinimumPrice") returns 100 but GetValue("Acme.ProductA.MinimumPrice") return 50.

I'm not sure how to best represent the data. Is there a clean way to code this in C#?

© Stack Overflow or respective owner

Related posts about c#