DataSet vs Custom Collection

Discussion in 'ASP .Net' started by JimGreen, Sep 12, 2005.

  1. JimGreen

    JimGreen Guest

    We are designing a WinForm application ( three tiered)
    There is a debate in our group as to whether we should pass datasets or
    our custom collections from business layer to the user interface layer.
    The data is stored in memory (fetched from DB only once). The
    collection is dynamic in the sense that it can change.
    My personal opinion is that using dataset makes you code take much more
    memory than a custom collection. Datasets have overheads that you may
    not want (or get) if u use your custom collections.
    Am I right? Can someone throw some light on this topic
     
    JimGreen, Sep 12, 2005
    #1
    1. Advertising

  2. JimGreen

    Guest

    Re: DataSet vs Custom Collection

    Hi,

    This is a question that comes up alot. I can't tell you how often I see
    people over design an application and introduce totally uncessary
    complexity. Because I don't have the specifics on your application, I
    am going to assume that you are not building something that is going to
    lift the space shuttle. Having said that, I have written applications
    that do both and are termed "big applications". Since you are working
    in a WinForms application, I definitely say go with the DataSet because
    you will have the processing power of the client at your fingertips.
    The DataSet has allot of cool functionality that you are going to have
    to reinvent as the application grows. If you are really leaning toward
    collections, I would still suggest you start with the DataSet and hide
    it behind an interface so you can swap it with a collection if you have
    to.

    To that end, are you building a smart client application? If so, then
    the DataSet is even better because it offers the facility to read and
    write to XML (as you probably already know) to support offline
    capabilities. Anyway, people always bring up the size and possible
    performance issues with DataSets and it scares people into not using it
    because they think their application has to perform. I say use the
    DataSet but combine it with the Caching Application Block if you are
    concerned with performance; although I have never seen a problem with
    it.

    Thanks,

    Sayed Y. Hashimi

    http://www.sayedhashimi.com
    Shameless Book Plug: Service-Oriented Smart Clients with .NET 2.0
    http://www.amazon.com/exec/obidos/t...f=sr_1_1/102-5068238-6758524?v=glance&s=books
     
    , Sep 12, 2005
    #2
    1. Advertising

  3. JimGreen

    David Browne Guest

    "JimGreen" <> wrote in message
    news:...
    > We are designing a WinForm application ( three tiered)
    > There is a debate in our group as to whether we should pass datasets or
    > our custom collections from business layer to the user interface layer.
    > The data is stored in memory (fetched from DB only once). The
    > collection is dynamic in the sense that it can change.
    > My personal opinion is that using dataset makes you code take much more
    > memory than a custom collection. Datasets have overheads that you may
    > not want (or get) if u use your custom collections.
    > Am I right? Can someone throw some light on this topic
    >


    There are indeed performance differences between DataSets and custom
    collections. But these differences are not so large or simple that
    performance can be used as a valid design criterion based on the information
    you have provided. Memory usage is usually similar, serialization is
    cheaper for custom objects (at least until .NET 2.0), indexing, searching,
    filtering and data binding is cheaper with DataSets.

    There are design tradeoffs related to DataSets and ease-of-use tradeoffs
    related to DataSets. These are the issues which should drive design
    desitions. The performance tradeoffs are usually just a tie-breaker.

    David
     
    David Browne, Sep 12, 2005
    #3
  4. JimGreen

    The Crow Guest

    Re: DataSet vs Custom Collection

    you can fine tune datasets even typed ones to certain degre. in a winforms
    application i agree with you, implementing IBindingList and other issues are
    not easy to implement, but with a web application i suggest inheriting your
    base collection to collectionbase and add common functionalty to it and then
    inherit from that collection for each entity and add custom behaviour, maybe
    database read operations to that strongly typed collection.
     
    The Crow, Sep 12, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dylan
    Replies:
    5
    Views:
    432
    Daniel T.
    Mar 22, 2005
  2. Pradeep
    Replies:
    2
    Views:
    687
    Patricia Shanahan
    Jan 24, 2007
  3. Øyvind Isaksen
    Replies:
    1
    Views:
    1,001
    Øyvind Isaksen
    May 18, 2007
  4. Terry Holland
    Replies:
    9
    Views:
    225
    Steven Cheng[MSFT]
    Oct 28, 2005
  5. Donald Simpson

    Web Custom Control & Custom Collection problem

    Donald Simpson, Jul 11, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    136
    Donald Simpson
    Jul 11, 2003
Loading...

Share This Page