none
dataset or typed dataset RRS feed

  • Question

  • In type dataset we create our classes and the other way is that we write our BLL and DAL classes.To  achieve the  3 lier  application structure.
    I want to know if I am starting a project what could be my start point  to think sould I write  dAL/BLL classes or to work with the typed Dataset.

    Thanks


    Thursday, May 22, 2008 6:10 PM

Answers

  • Honestly, I don't even use typed datasets any more and generally cringe when I see them. Outside the 3000+ lines of code it can generate and the huge serialization overhead they carry, I also found them awkward to use ('myObj.IsPropNull ? null : myObj.Prop' for every property usage...yeesh) and maintain (always keeping the XSD in sync with the table structure).  I'm all for letting a tool generate code, but I just found that particular solution less than ideal and more of an interim solution until something better came along (in my case, I decided to learn how to use FOR XML EXPLICIT to put the O-R mapping into the DB)

     

    Friday, May 23, 2008 2:21 PM

All replies

  • IMO, you should go the route of entity classes. Typed datasets dont' serialize particularly well, given that there is a lot of overhead with regards to inter-table relationships as well as the simple fact that those generated datasets end up being thousands of lines long with tons of internal logic for casting DB types over to regular .Net types (DBNull, for instance). On the other hand, simple entity classes are just containers that are lighter over the pipe, with no internal logic to transfer (except for auto-instantiation of collections) and relationships that are implied in the hierarchical structure rather than explicitly defined with additional data structures.

     

     

    Thursday, May 22, 2008 6:29 PM
  • so when should I consider using typed DataSet
     As it describes in the tutorial and other metrails it seems that typed dataset took over writing BLL and DAL.
    Thanks for your previus answer.

    Thursday, May 22, 2008 9:51 PM
  • Honestly, I don't even use typed datasets any more and generally cringe when I see them. Outside the 3000+ lines of code it can generate and the huge serialization overhead they carry, I also found them awkward to use ('myObj.IsPropNull ? null : myObj.Prop' for every property usage...yeesh) and maintain (always keeping the XSD in sync with the table structure).  I'm all for letting a tool generate code, but I just found that particular solution less than ideal and more of an interim solution until something better came along (in my case, I decided to learn how to use FOR XML EXPLICIT to put the O-R mapping into the DB)

     

    Friday, May 23, 2008 2:21 PM
  • This subject is a bit like discussing religion. I have had "interesting" discussions with others to the point where all parties simply agree to disagree rather than devolve into major flame wars.

     

    Personally, I like Typed DataSets and we use them everywhere. The whole serialization thing is not an issue. When we pass data between client-side and server-side layers (we use Web Services), we don't pass the DataSet itself, we simply pass a string of XML (as in MyDataSet.GetXml()). We don't even pass the schema, just the data. You don't need to pass the schema or the DataSet itself, because both client-side classes and server-side classes are referencing the  DataSet DLLs and the XML can be easily re-serialized back into the DataSet.

     

    Anyway, just wanted to give another point of view.

    Sunday, May 25, 2008 8:08 PM