The World’s Leading Microsoft .NET Magazine
   
 
timstall

Donate Today!

Search Box

 

Calendar

««Jul 2008»»
SMTWTFS
  
1
2
3
4
5
6789101112
13141516171819
20212223242526
2728293031

My RSS Feeds








Mailing List

Most Popular Tags

                                       

Pair and Triplet classes

posted Thursday, 26 January 2006

There are some Framework classes out there that are useful, but infrequently used. In my experience, System.Web.UI.Pair and System.Web.UI.Triplet are two such examples. These provide basic utilities (like serialization) to store two or three related objects into single object. They have predictable members, for example Pair has a "First" and "Second" property that can be set either in the constructor or once instantiated.

They're simple classes, but are easy and helpful to use in web applications. Of course you could write your own container, but this saves you the step.

links: digg this    technorati    




1. shahkalpesh left...
Friday, 27 January 2006 3:04 am

Why is it that they are in System.web? It would be better to put them in some other namespace, where it will be easy to find & use it

What do you say?


2. Tim Stall left...
Monday, 30 January 2006 10:06 pm

Hello. I think they are optimized for viewstate. System.Collections offers tons of other data structures to handle this - like DictionaryEntry instead of Pair, as well as more advanced structurs like hashes and arrayList.