Should, in a web app using a 3-tier design pattern, one of the bottom layers provide some checking mechanism to ensure…?
<p>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. </p>

<p>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… ). </p>

<p>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? </p>

<p>thanx</p>

<p><br></p>

<p>EDIT:</p>

<blockquote>
  <p>I would consider the ability to pass invalid IDs a bug.</p>
</blockquote>

<p>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 </p>

<blockquote>
  <p>“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.”</p>
</blockquote>

<p>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?!  </p>
