HighTechTalks DotNet Forums  

Dictionary with a combination of values as key....

Dotnet Framework (Performance) microsoft.public.dotnet.framework.performance


Discuss Dictionary with a combination of values as key.... in the Dotnet Framework (Performance) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Rune
 
Posts: n/a

Default Dictionary with a combination of values as key.... - 11-18-2007 , 03:49 PM







I need to represent some data in memory which needs the performance of a
Dictionary lookup, but the key for these data consists of multible values,
e.g.:

Data has a structure like this:
ProductId (key) InventId (key) Property1 (value) Property2 (value)
1234 1 <somevalue>
<somevalue>
1234 2 <somevalue>
<somevalue>
1237 1 <somevalue>
<somevalue>

The unique key in this case is a combination of <ProductId> and <InventId>

My first idea was to startout having the key a new Generic class e.g.
Key<T1,T2> for use with Dictionary<Key<T1,T2>, ProductRelation> etc..
- But this solution is not usable for more than two values for the key ....

What is the "best" way to do it if you want max flexibility and max
performance ??

Regards, Rune


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.