Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Passing data between layers

Passing data between layers

Scheduled Pinned Locked Moved Design and Architecture
databasequestioncsharpsql-serverdesign
3 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vagl
    wrote on last edited by
    #1

    Hi all, I am newbie here. My Tech. environment: .Net and Sql Server Problem: Manyatimes, we need to return data from different tables in the database to the UI (for example, search results) whose schema wouldnt match with any of the domain objects. In this case, one option is to transfer the data using the datasets/datatables feature provided by .Net. The other option I could think of is to create business (DTO?) objects to just pass on the data from the DB to the UI. I prefer the second approach. However, I need suggestions on how do I implement it? Will this DTO contain a reference of all the domain objects involved or Can I just include only the desired columns? Or, do we have any other solution? Thanks in advance, AGL

    J 1 Reply Last reply
    0
    • V vagl

      Hi all, I am newbie here. My Tech. environment: .Net and Sql Server Problem: Manyatimes, we need to return data from different tables in the database to the UI (for example, search results) whose schema wouldnt match with any of the domain objects. In this case, one option is to transfer the data using the datasets/datatables feature provided by .Net. The other option I could think of is to create business (DTO?) objects to just pass on the data from the DB to the UI. I prefer the second approach. However, I need suggestions on how do I implement it? Will this DTO contain a reference of all the domain objects involved or Can I just include only the desired columns? Or, do we have any other solution? Thanks in advance, AGL

      J Offline
      J Offline
      John ph
      wrote on last edited by
      #2

      I would suggest a seperate layer for the Data Definition. passing of Data between the layers is required in almost all the cases. There are two different ways of doing this in .NET. One option you pointed-out.. using Generic Dataset. There is another way of handling this. By using Strongly Typed DataSet. A Typed-Dataset is similar to a Generic Dataset because it is derived from the Dataset class and inherits all the members of a dataset. But the only difference is the Typed dataset is created with the XML Schema representation of the Database Table and the corressponding class file. So it provides type-safe operation and all the methods, properties, events are defined and also it provides an excellent way to access the tables and columns using the names. The only disadvantage of using typed dataset is that it put slightly higher overload on the application. We can have a seperate layer named DataDefinition and we can have all the database table's in the form of .xsd files which is the XML schema representation of the database tables.


      Regards
      John


      M 1 Reply Last reply
      0
      • J John ph

        I would suggest a seperate layer for the Data Definition. passing of Data between the layers is required in almost all the cases. There are two different ways of doing this in .NET. One option you pointed-out.. using Generic Dataset. There is another way of handling this. By using Strongly Typed DataSet. A Typed-Dataset is similar to a Generic Dataset because it is derived from the Dataset class and inherits all the members of a dataset. But the only difference is the Typed dataset is created with the XML Schema representation of the Database Table and the corressponding class file. So it provides type-safe operation and all the methods, properties, events are defined and also it provides an excellent way to access the tables and columns using the names. The only disadvantage of using typed dataset is that it put slightly higher overload on the application. We can have a seperate layer named DataDefinition and we can have all the database table's in the form of .xsd files which is the XML schema representation of the database tables.


        Regards
        John


        M Offline
        M Offline
        Mark Churchill
        wrote on last edited by
        #3

        If you are looking at using an object-oriented data layer then you should read this article[^].

        Mark Churchill Director Dunn & Churchill

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups