Yes, you could do this by loading up a custom collection class of
custom objects, this is something that .NET is suited to do.  But just
because you can do it, doesn't mean you should do it.

You want to display your data in a grid, so why do you want to create
a huge set of objects when they primarily will be used only for
display purposes?

Why not load the grid from a DataTable and when the user wants to edit
an item, create the custom object from the appropriate row in the
DataTable?

The DataTable already has all the tools you need for filtering and
sorting, why re-invent the wheel in another class?




On 7/15/05, Mark Pawelek <[EMAIL PROTECTED]> wrote:
> A DataTable is not flexible enough and probably has too much system
> overhead. I just need more flexibility that a collection class gives me. I
> could go into detail on why but it would bore you.
> 
> Dean Fiala wrote on 14 July 2005 15:07:
> 
> > instead of creating the overhead of two classes (a collection class
> > and the entity class)?
> 
> I really don't consider this as 'overhead'. Maybe it is in terms to the time
> needed to write the code. But I feel that the resultant code with make my
> application run faster. I will want to keep a lot a data in immediate memory
> which can be simply loaded and stored back to the database. I can't see any
> other way to go apart from this. As I previously wrote, this is apparently
> what Java and ASP.NET bods are supposed to do.
> 
> Since yesterday I applied myself to using Google better and now I have some
> links worth investigating:
> 
> 'Sorting the Unsortable Collection' by Rockford Lhotka
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/h
> tml/vbnet01272004.asp>
> 
> 'Sort and Filter Strongly-Typed Collection Classes' by Brendan Tompkins
> <http://codebetter.com/blogs/brendan.tompkins/archive/2004/09/02/24116.aspx>
> 
> 'Typed Collection Class Generator' by Kristopher Johnson
> <http://kristopherjohnson.net/TypedCollectionGenerator/1.3.0/TypedCollection
> Generator.htm>
> <http://kristopherjohnson.net/cgi-bin/twiki/view/KJ/TypedCollectionGenerator
> >
> 
> 'Writing Type-Safe Collections in C#' by Amit Goel
> <http://www.ondotnet.com/pub/a/dotnet/2003/03/10/collections.html>
> 
> 'CollectionBase Class' by Microsoft
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
> /frlrfsystemcollectionscollectionbaseclasstopic.asp>
> 
> 'typed collection class' links by Google
> <http://www.google.com/search?q=typed+collection+class&hl=en&lr=&rls=GGLD,GG
> LD:2004-13,GGLD:en&start=10&sa=N>
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 


-- 
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to