Hooked on LINQ

Hooked on LINQ - Developers' Wiki
for .NET Language Integrated Query

Quick Search

Advanced Search »

Index for Objects (i4o)

Modified: 2007/04/12 14:49 by ericksoa - Categorized as: Indexing, LINQ to Objects, Samples
Edit

Overview

Index for Objects (i4o) allows developers to create indexed collections that query much faster than the out of the box queries do over existing collections. i4o is an open source project available under the CDDO license.

Edit

Usage

i4o allows developers to tag properties of arbritrary objects with the [Indexable()] tag. For example:

using i4o;
class Student{
    private string _firstName;
    private string _lastName;
    private string _gradePointAverage;
 
    [Indexable()]
    public string FirstName{
        get{ return _firstName; }
    }
}

Once the appropriate properties are tagged as indexable, developers can use the specialized generic collection, IndexableCollection, to instantiate a collection of Student that, when queried using LINQ operators, will execute an index aware query rather than the default sequential search.

IndexableCollection derives from Collection, the preferred class to subclass from when writing your own custom collections. Thus, the typical usage pattern will be to create a class, say, Students in this example, that is defined as such:

using i4o;
class Students : IndexableCollection<Student> {
    //Student collection stuff goes here
}

From this point, any linq query that uses an indexable field will use the index rather than doing a sequential search, resulting in order of magnituide performance increases for queries using the index.

Edit

Development Status

i4o is in currently in beta. The where and join operators have been implemented for IndexableCollection, with the contains operator coming soon.

Edit

Download

The current version of i4o, as well as source code, is available under the CDDO license, here: i4o Download Page

Edit

Contact

For more information, or help with i4o, please contact Aaron Erickson .

If you would like to comment on this page, click on the Discuss button located on the top-right of each page. Feel free to edit any mistakes or ommissions you find. If you have an objection or find in-appropriate content then contact the administrator. This website is not affiliated with Microsoft®, all content and opinions are those of the specific author and some advice, solutions and article may contain un-intentional errors - please use care. Powered by ScrewTurn Wiki version 2.0.33. Some of the icons created by FamFamFam.