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 615729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:15:05+00:00 2026-05-13T18:15:05+00:00

I’m trying to write a web app using 4-tier design pattern ( Data Store,

  • 0

I’m trying to write a web app using 4-tier design pattern ( Data Store, DAL, BLL and UI).
Among other things this app would also implement a forum.

Suppose I want to move a thread from one forum to another. In order to do this, UI layer must pass down to other layers the ID of a thread and the ID of a forum to which I wish to move this thread ( UI would pass these parameters by calling method A in BLL layer and A would in turn call method B in DAL layer… ).

a) Now should one of the bottom layers provide some sort of checking mechanism to ensure that the two ID arguments supplied by UI layer really represent an existing thread and an existing forum or is it the responsibility of UI layer to provide valid ID values?

thanx

EDIT:

I would consider the ability to pass invalid IDs a bug.

Should non existing ID be considered a bug just in the case of moving a thread, or also in the case of displaying a thread. Thus when user navigates to page Showthread.aspx?ID={0}, if query string parameter ID references non existing ID, If none of the layers check for the validity of ID, then GridView simply won’t display any

“But in this case it doesn’t look like the ids are in any sort of list. If they were one could only assume that this would never happen as I assume the lists would be populated by a stored procedure or a DAL procedure that pulls all valid IDs.”

But even if user chooses IDs from a set of list, by the time it posts the page back, the DB table containing this ID could be changed in the mean time by admin or whomever?!

  • 1 1 Answer
  • 0 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-13T18:15:05+00:00Added an answer on May 13, 2026 at 6:15 pm

    UI->BLL->DAL
    UI<-BLL<-DAL

    Your database is not another layer its simply a repository of the data. What you describe is your typical 3-tier architecture. Layers are the assemblies (dll files) while tiers are the storage mechanism (hardware). Some people might mix those terms up but ultimately it doesn’t matter.

    In this case your UI calls the BLL which in turn calls the DAL.
    Once you process what you need from the DAL then the DAL takes that information and passes to the BLL (Business Logic Layer) which in turn submits back to your UI.

    Your UI shouldn’t know anything about a valid ID, that is your UI should not touch your DAL. Pass the ID’s to the BLL and the BLL can then check if they are valid. Some folks like to actually check inside the DAL sproc level and return some sort of flag.

    bool IsValid(int forumID) {
    //call the dal to get a true or false based on this
    bool isValid=false;
    DAL d = new DAL();
    isValid = d.IsValid(forumID);
    return isValid;
    }
    

    And your DAL then has a function to simply call say a sproc to return true or false if the ID exists.

    bool IsValid(int forumID){
    bool status;
    //call sproc
    status=ValueReturnedFromSproc();
    return status;
    }
    

    If you are wondering how the UI handles all this it can do so by this:

    BLL b = new BLL();
    if (!(b.IsValid(someRandomForumID)))
      Response.Write("Sorry you've got an invalid forumID");
    else
      {
        //proper forum id go ahead...
      }
    

    In response to your edit:

    If you are actually exposing the ID in the URL and allow someone to change it then your on load event needs to simply pull the ID (request parameters) and check if it is valid. If it is show the data if it isn’t redirect to a page that states “Opps it appears you are trying to access a forum / thread that does not exist”.

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

Sidebar

Related Questions

I'm trying to write a web frontend for Crontab in Ruby using the excellent
I'm trying to write a web page in .NET, using C# and NHibernate 2.1.
I'm trying to write a web application using nodejs and couchdb. In couch i
I'm trying to write a client app using monotorrent library with asp.net. there is
I am trying to write an Android app to connect to an existing web
I'm trying to write a web application using Spring MVC. I have a configuration
I am trying to write a app.config / web.config error correcting app which will
I'm trying to figure out why my web app (I didn't write it, but
I am trying to login to my web app using HttpWebRequest but I keep
I'm trying to write a third party app of Sina Weibo using bottle. However,

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.