Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looking for advice on passing data between layers
Message
From
05/03/2005 11:03:00
 
 
To
04/03/2005 13:55:46
General information
Forum:
ASP.NET
Category:
Class design
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
00992836
Message ID:
00993014
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
Sylvain,

This all boils down to the "chatty" vs "chunky" methodologies. Chatty would be many calls to the back-end, chunky would be getting as much as possible in one fell swoop. Typically, chunky is better, unless there's huge amounts of data involved. In this particular example, if you're talking about a lot of data, I might lean towards your first option, one call for each table, since each table is dependent on what the user chooses from the Combos. Again, this all this depends on how large your anticipated data will be.

Another question to think about is whether or not to use Web Services to access your server-side data (I recommend it).

~~Bonnie



>I'm looking for advise on how to architect my application. My application will have 3 layers: a UI layer, a business layer and a data layer (SQL Server). I'm looking for a best approach on how to send the data to the UI.
>
>For example, let say that I have 3 controls on my form: a Client combobox, a Project combobox and a DataGrid. The Client combobox will gets it's data from the Client table. The Project combobox will receive it's data from the Project table, but will list only the projects belonging to the currently selected Client. The DataGrid will display the data coming from multiple related tables, but for the currently selected Project. All the data on this form are read-only.
>
>What's the best way to send back the tables to the UI from the BO? I dont know what to chose between:
>
  • One call for each table:
    >a) UI gets a ADO.NET DataTable from the BO for the Client table
    >b) UI gets the Project related to the selected Client
    >c) UI gets the grid data related to the selected Project
    >
  • One call to get all data from the BO: the BO return a ADO.NET DataSet with all the tables and relations set
    >
  • No ADO.NET passed between the UI and the BO. The BO will expose objects for the UI to use to get all data
    >
  • < Insert your suggestion here >
    >
    >The first option should be faster because it fetch only the data it need while the second option returns all the data. But the second option should be easier to program and should reduce the communicaton between the UI and the BO.
    >
    >This is currently a WinForms application, but it will also have a web interface in a near future.
    >
    >I'm new to .NET, so I don't know what's the "common" approach used by the majority of experienced .NET developper.
    >
    >Any suggestions are welcome.
    >
    >TIA
    Bonnie Berent DeWitt
    NET/C# MVP since 2003

    http://geek-goddess-bonnie.blogspot.com
  • Previous
    Next
    Reply
    Map
    View

    Click here to load this message in the networking platform