C# - Web App Using A 3-tier Design Pattern, One Of The Bottom Layers Provide Some Checking Mechanism To Ensure...?

Feb 17, 2010

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?


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

View 5 Replies

Similar Messages:

Architecture :: Design Pattern And Tier Architecture

Jun 12, 2010

I am a newbie to asp.net and work in a firm where the projects are quite small.

I was told by my manager that in a few weeks or so we would be getting a bigger project and I need to be well versed with Design Patterns and N tier arcihtecture.

I would really appreciate if someone could provide me some links and also drop me a few sentences on how this things are useful?

View 4 Replies

Web Forms :: Asynchronous Paging And 3 Tier Layers?

Sep 3, 2010

I have a query about asynchronous paging using RegisterAsynchTask or AddOnPreRenderCompleteAsync

If I have a 3 tier web application with the UI, Business Layer and the Data Access Layer and I'm doing the Begin and End asynchronous processing of a method at page level (UI). This UI method accesses the DB and goes through all the layers starting asynchronously from the first page, then continuing "normally" through all the other layers. These underlying layers are all synchronous but started asynchronously through the first Page.

My question is how should asynchronous paging processing be handled with regards to layers? Do I need to set the methods being used at all levels asynchronously (using Begin and End event handlers) ?

And what about MasterPages... I can't Asynchronous processing for them. RegisterAsynchTask is not available and neither AddOnPreRenderCompleteAsync.... what I'm missing?

View 5 Replies

Best Design Pattern For Associating Subdomain With Area And PRG Pattern?

Aug 21, 2010

Now that the next version of ASP.NET MVC is being prototyped and previewed (ASP.NET MVC 3 Preview 1 came out a couple of weeks ago), I wonder if we should call the attention of the Core Dev team (S Hanselman, Phil Haack and all) to this "feature."there a easy/non tacky way of associating subdomains → areas?Something like:
[URL]Also, whats the best accepted design pattern in implementing PRG pattern in ASP.NET MVC? I guess it should also get some official loving in MVC 3.

View 2 Replies

Design: ORM And Application Layers

Nov 4, 2010

While designing (and then implementing) a layered application:

Is it correct to use the same ORM objects accross all layers? (which would go against encapsulation).

Or the presentation, business and data layer should each have their own objects? (which would lead to lots of code repetition).

e.g. (just to illustrate the question): if one uses Linq to SQL in the Data Layer and Visual Studio's O/R designer to generate the ORM objects, are those objects supposed to be used in the Business and Presentation Layers as well.

i.e.: Are the objects associated with the entities that the application handles a crosscutting issue?

View 1 Replies

C# - Can Reuse Built-in IIS Authentication But Provide Own Credentials Checking

Feb 14, 2011

I'd like to use built-in IIS authentication with non-Windows accounts. There's this module that does that for basic authentication, but it in fact does both the authentication and credentials checking.The problem is I also need to support digest authentication and I could try to do it, but it would be a lot of hassle - I need to generate challenges ("nonces") securely, store them and check for replays, etc. - lots of things I can screw up and make determined attackers happy. So I'd prefer to reuse the digest authentication functionality in IIS, but use my own module for credentials validation. How can I do that?

View 1 Replies

Architecture :: Entity Framework With 3 Layers Design

May 19, 2010

I am thinking to use entity model as DAL, how should I create the BLL then? What kind of datasourceobject should I use in the asp pages?

I am looking for best practice to use Entity framework 2 in the three layers design. I had experience at dataset with three layers design.

Should I use objectdatasource at the pages for gridviews? My guess is that entitydatasource by passed the BLL which is not good, so the only option left is the objectdatasource.

Could and should my BL object inherit those entity model in the DAL, so I dont need to recreate their object's property?

View 4 Replies

SQL Server :: How To Design Manual Login/logout Mechanism

Dec 10, 2010

How to design login-logout mechanism in asp.net manually(no using standard control for login) by storing login id and password details in table but password must be in encrypted format in table for security !

View 9 Replies

Architecture :: Design Which Have A Few Layers:Common, DataAccess, BusinessLogic,Operational?

Jun 24, 2010

It's appreciated if you could share your thought.I have seen a e-commerce website design which have a few layers:Common,DataAccess,BusinessLogic,Operational.In the Common layer,it includes all the classes with only attributes and properties,no methods nor data access codes here.

In the DataAccess layer,there is a class for each action per class in the Common layer.For example,

a class for the Select action of class A of Common layer,
a class for the update action of class A of common layer,
a class for the Select action of class´┐ŻB of Common layer,
Is this a design I could use for a potential high trafic website?What's the pro and con of this design.

View 3 Replies

Forms Data Controls :: How To Implement A Rating Mechanism Into Database Design

Mar 5, 2010

I have the attached database design.

The database has been designed for a tradesman web site, i.e. Plumbers, Builders etc. The two main tables are tblCustomer and tblTrader which will stored data from two frontend web pages where the customer and trader can enter their personal details. After a customer enters their personal details (i.e. registers through the site) they will then be directed to a child page where they can progress to entering a specific job attached to a specific trade (i.e. Plumber) and trade type (i.e. Bathroom Installation), once a customer job has been entered I want these details to be emailed to all the trader_email addresses from tblTrader, from this email alert the traders will then enter the system and offer quotes to the customer through tblTraderQuote where the customer will then accept the best quote for them.

What I also want to implement is some sort of rating option that will allow the customer to rate their trader, either something like ebay's feedback or just a simple 1-5 rating option? How can I implement this into my database design or is this something that should be performed within the programming layer?

View 3 Replies

C# - Regex Pattern For Checking If A String Starts With A Certain Substring?

May 1, 2010

What's the regular expression to check if a string starts with "mailto" or "ftp" or "joe" or...

Now I am using C# and code like this in a big if with many ors:


It looks like a regex would be better for this. Or is there a C# way I am missing here?

View 5 Replies

Asp MVC Vs. Asp Web Forms / Breaking Code Design Into 3 Layers (presentation, Dal And Business) Meets MVC Concept?

Dec 20, 2010

I'm a junior programmer, i do not get the concept of MVC! My method of coding is seperating my application design into 3 layers:

Presentation Layer
Business Layer
Data Access Layer

I find it very practical to a junior developer or at least to me, so i do not really get the point of MVC since i believe MVC just tries to separate logic from UI. Right?

I decided to have this book to help me have a better idea on code design:


Note: i also decided to start learning about TDD.


Is breaking my code design into 3 layers (presentation, dal and business) meets MVC concept?

View 4 Replies

Web Services Design Methodologies. Top-down And Bottom-up. What's The Difference?

Aug 17, 2010

can someone give me a high level overview of these two methodologies? what's the difference between these two and why would you choose one over the other? i would just like a general explanation in your own words as i'm just starting with web services.

View 1 Replies

Which Of The Two Design Patterns Should I Implement In A 3-tier .Net Application

Sep 22, 2010

I'm trying to decide which of the two factory patterns I should use in my Asp.Net applications:

1 : All DAL providers derive from same abstract base class DepartmentsProvider, which defines public interface of the class ( all the necessary CRUD methods for which derived classes (providers ) provide a concrete implementation ). BLL layer instantiates correct provider by calling DepartmentsProvider.Instance:

public abstract class DepartmentsProvider
static private DepartmentsProvider _instance = null;
/// <summary>[code]....

In first case we implement new provider by deriving from DepartmentsProvider class, while in second case new provider is implemented by deriving from DBProviderFactory. What are pros and cons of each implementation?

View 1 Replies

C# - Object Oriented N-tier Design Abstracting Too Much?

Jun 8, 2010

I'm building my first enterprise grade solution (at least I'm attempting to make it enterprise grade).I'm trying to follow best practice design patterns but am starting to worry that I might be going too far with abstraction.

I'm trying to build my asp.net webforms (in C#) app as an n-tier application.I've created a Data Access Layer using an XSD strongly-typed dataset that interfaces with a SQL server backend.I access the DAL through some Business Layer Objects that I've created on a 1:1 basis to the datatables in the dataset(eg, a UsersBLL class for the Users datatable in the dataset).I'm doing checks inside the BLL to make sure that data passed to DAL is following the business rules of the application.That's all well and good.Where I'm getting stuck though is the point at which I connect the BLL to the presentation layer.For example, my UsersBLL class deals mostly with whole datatables,as it's interfacing with the DAL.Should I now create a separate "User" (Singular) class that maps out the properties of a single user,rather than multiple users?This way I don't have to do any searching through datatables in the presentation layer,as I could use the properties created in the User class.Or would it be better to somehow try to handle this inside the UsersBLL?

below is the code from the UsersBLL:

using System;
using System.Data;
using PedChallenge.DAL.PedDataSetTableAdapters;


View 2 Replies

Which Design Pattern To Choose

Jul 20, 2010

I am using asp.net and c#.

I have a some classes. Some of the classes are having same methods insert, update and delete.

Each insert will insert different data to different table. (same for update and delete). What type of pattern can be applied for this kind of class.

View 3 Replies

C# - An Architectural / Looking For Design Pattern ?

Feb 26, 2011

So yesterday my mate and myself had this duscussion about the architecture of this e-shopping website that im developing. Note that I work with ASP.NET for this. He was quite surprised to learn that I do not keep the Items added to the shopping-cart in an ArrayList or other Generic list but rather i insert them straight to the database using LINQ To Entities. Could I pass only for this web app and not use n-tire or should I do as my friend suggested which is, have methods that perform updates, deletions etc..

View 2 Replies

Visual Studio :: Can't See Bottom Of Page In Design View

Apr 1, 2011

When I'm in Design View I can't scroll down to the bottom of some of my pages. I've scrolled down as far as I can and the bottom is cut off. This doesn't happen on all the pages. I tried increasing the height for the ContentPlaceHolder.

View 1 Replies

Design Pattern - Rule Checker

Apr 4, 2011

I sell products throgh my website. Recently we've been given a list of rules that need to be checked against each order, to make sure it's not fraudulent. So this list of rules/fraud indicators will change and grow so I want to make sure it's easily maintainable and really solid. I'm thinking I have an abstract class rule that each of the rules implements.

abstract class Rule
public string Message;
public bool Success;
public void CheckOrder(OrderItem currentOrder);
class FakeCreditCardNumberRule : Rule
public string Message = "Fake CC Number Rule";
public void CheckOrder(OrderItem currentOrder)
currentOrder.CreditCardNumber = "1234-5678-9012-3456";
Success = false;
class ReallyLargeOrderRule : Rule
public string Message = "Really Large Order Rule";
public void CheckOrder(OrderItem currentOrder)
currentOrder.ItemsOrder.Count > 100;
Success = false;

Then I'm thinking of having a class that accepts an Order object in it's costructor and checks though the list of rules. Something like:

class FraudChecker
List<Rule> rules;
public FraudChecker(OrderItem currentOrder)
foreach(var rule in rules)

So I was trying to think of the best place/best way to populate the FraudChecker.Rules list and started thinking there might be some nice design pattern that does something like what I'm doing. Has anyone seen a design pattern I should use here? Or can anyone think of a good place to populate this list?

View 3 Replies

Design Pattern For Generating The UI Dynamically?

Sep 14, 2010

I am planning to generate the UI from database.The platfrom will be ASP.net.Can anyone help in identifying the best design pattern/Architecture that suits for generating the UI and events dynamically.

View 3 Replies

Architecture :: Which Design Pattern Can Be Implemented?

Mar 22, 2011

suggest me a good design pattern for implmenting the following? I have an object say myObject. This myObject is created using few inputs from the UI. After the creation of myObject. This object will be passed to few methods.. like method1(myObject);

method2(myObject);... method5(myObject);etc. Each methods will prepare the input for successive methods call. For example method1(myObject) will set the values necessary for the operation of method2.Then method2(myObject) will set up the values necessary for the operation of method3 and so on..Same object is used as the argument for every method calls.Which design pattern can be implemented?

View 2 Replies

Session Object Design Pattern?

Jan 28, 2011

I'm looking to build an ajax page; it's a reporting page. By default, load today's report. On the page there's a calendar control and when the user clicks on a date, reload the gridview with the corresponding data. Is it considered good practice to do the following:

1) on the first page load, query the data for the page

2) put the query result in the session object and display it in a gridview

3) if the user requests new data, get new data from the query with different parameters

4) put the result of the second query in the session object and display it

5) if the user then requests the data from the first query, get it from the session object

6) do the sorting and paging with the data held in the session.

Note: the data of each query will contain about 300-500 rows and about 15 columns. I'd like to do all this with ajax calls. What are some suggestions and pitfalls to avoid.

View 4 Replies

Design Pattern For Adding A Web Service In MVC3

Mar 4, 2011

Firstly - I'm not asking this question How to include a web service in MVC3? I know where the button is :-)

I'm trying to find an example of best practices of how to use the new DI / Common Service Locator framework in order to make web service calls (and code dependent on web service calls) testable. I've no experience of using NInject or the like - is that the way to go?

View 2 Replies

Architecture :: What Basically Is Factory Design Pattern

Jul 17, 2010

I visited this Link to study about Factory design pattern.http://wiki.asp.net/page.aspx/310/factory/ But i am confused about it still. What i understood is that we must use an Interface to define a class .In the interface we will give the prototype of functions and later on we will define it in concrete class. Is that simple concept is Factory design pattern ?

View 13 Replies

C# - Best Practice Or Design Pattern For User Registration ?

May 2, 2010

We have a big portal that needs user registration to allow them use its services. It's already done in .NET and SOL Server 2005. we are in the phase now of discovering all the problems of the current registration system to build a new robust flexible one that can be extended easily and can be more usable for all services.

View 3 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved