Speaking of ADO.Net, I started working on the
DataSet/DataRelation/Constraint stuff, but all I have so far is the
attached class, Tuple. Tuple takes an array of objects which must be
comparable (they must implement IComparable) and "aggregates" it into a
single comparable object. This allows relations and constraints to be
constructed on more than one column. More explictly it allows
multi-column data to be used as a key into an associative
order-preserving container. Its not designed to be used by client code.

I didn't write a hash function because I thought that the compiler would
provide one for me automatically. If this isn't the case let me know and
I will write one. If the compiler does provide one, some tests to
determine its fitness should probably be written because the uniformity
of its distribution will have a big impact on performance.

I started thinking about how I would implement the Relation and
Constraint classes, particularly how I would connect them to the
DataTable and DataTableCollection classes to respond to row insertion,
updates and deletes without modifying the class interface. I ended up
stopping that, however, because it was giving me a big headache.

I figured what I needed was a diagramtic reperesentation of the
relationships between the classes in the System.Data namespace that I
could have in front of me while I was programming, so I decided what I
would do is draw a uml diagram of the System.Data namespace. Then I
started thinking "why not diagram the entire .Net Framework Class
library?", but then it also dawned on me that I didn't know anything
about uml. I went and read a book on uml. As of now I've started
constructing uml diagrams (package dependancy diagrams, class diagrams,
etc) for the .Net class library. I don't have enough done to warrant
providing them to the group, but when I do, I'll tar/gzip them up and
send them out (html, postscript and pdf versions)

I figured that having diagrams of the framework library would be a big
help. Let me know if you think this is a worthwhile effort or not.


-Scott Wisniewski
On Fri, 2002-05-24 at 12:54, Daniel Morgan wrote:
> I found this interesting...
> 
> http://abstractadonet.sourceforge.net/
> 
> 
> _______________________________________________
> Mono-list maillist  -  [EMAIL PROTECTED]
> http://lists.ximian.com/mailman/listinfo/mono-list
> 

//
// System.Data/Tuple.cs: 
//      Produces an orderable object from an array of orderable objects. This is used 
by System.Data
//      to allow for relationships and constraints involving multiple columns within a 
table. For the purposes of the
//      Tuple class, an object is orderable if it implements ICompareable
//
// Author:
//   Scott Wisniewski ([EMAIL PROTECTED])
//
// (C) 2002 Scott Wisniewski
namespace System.Data 
{
        public class Tuple : IComparable
        {
                private object[] Data_;

                public Tuple(object[] Data) 
                {
                        Data_ = Data;
                }
                public int CompareTo(object obj) 
                {
                        if (obj != null) 
                        {
                                int CompValue = 0;
                                Tuple t = (Tuple)(obj);
                                for (int i = 0; CompValue == 0 && i < Data_.Length && 
i < t.Data_.Length; ++i) 
                                {
                                        CompValue =  
((IComparable)(this.Data_[i])).CompareTo(t.Data_[i]);
                                }
                                return CompValue;
                        }
                        else 
                        {
                                //This object must be greater than null at all times, 
by definition...
                                return 1;
                        }
                }
        }
};

Reply via email to