Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 505369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:35:30+00:00 2026-05-13T06:35:30+00:00

Not sure if there is a correct answer to this, so I’ve flagged it

  • 0

Not sure if there is a “correct” answer to this, so I’ve flagged it as community wiki. Apologies for the long pre-amble.

I am building a modestly sized web application in .Net, and have settled on a table based architecture. My DAL layer consists of a set of TableGateway classes that handle loading/saving data to the database – these return strongly typed DataSets. Application logic is organised into a set of TableModule classes. Finally my ASPX pages handle displaying stuff and passing form values etc. to the TableModules to be worked on.

What puzzles me is who should take responsibility for calling the TableGateway to get the DataSet, the ASPX code-behind or the TableModule?

Example 1 – ASPX does it:

SomePage.aspx.cs:

    protected void AddLink_Click(object sender, EventArgs args)
    {
        long id = long.Parse(PopulationDropDown.SelectedValue);
        string someProperty = SomePropertyTextBox.Text;

        IPopulationGateway populationGateway = DALServicesLocator.GetPopulationGateway();
        PopulationDataSet populationData = populationGateway.LoadPopulationDetails(id);

        PopulationModule.SomeLogicToAddStuff(populationData, id, someProperty);

        populationGateway.Save(populationData);
    }

Example 2 – TableModule does it:

SomePage.aspx.cs:

    protected void AddLink_Click(object sender, EventArgs args)
    {
        long id = long.Parse(PopulationDropDown.SelectedValue);
        string someProperty = SomePropertyTextBox.Text;

        // Just pass values to the TableModule and let it talk to the Gateway.
        PopulationModule.SomeLogicToAddStuff(id, someProperty);
    }
  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:35:30+00:00Added an answer on May 13, 2026 at 6:35 am

    IMHO 2nd variant, because it simple to split logical layers as MVC model:

    • aspx page is View, only translates data and commands from and to user representation

    • TableModule acts like Controller layer

    • TableGateway represents Model layer

    In second variant you can modify access mode in Control layer, based on internal conditions, not accessible for aspx level.
    E.g. decide from which id really load data, check for user access rights etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sure there's a simple answer to this... or not: I have a site
I'm not sure whether there is a simply answer to this but I am
I am not sure where i've seen this before, but im sure that there
I am sure there are easier ways to do this, but I am not
I'm sure there's a clean way to do this, but I'm probably not using
First of all there is probably no correct answer, but I'm sure there are
I am not sure if this is the correct place to ask this, but
I'm not sure if there is a proper term for what I want to
I am not sure if there is a mistake in my existing code or
I am not sure if there is a way to update edmx file automatically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.