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


Similar Messages:

Web Forms :: Want To Use Design Patterns In .net Application?

May 17, 2010

I'm trying to build a small, web application. But I want to use desing patterns in it. So I have a question: which desing patterns do you use and why in asp.net applications?

View 11 Replies

Architecture :: Design Patterns Vs Architectural Patterns

Jan 10, 2011

1.what is the difference between design patterns vs architectural patterns ?

2. In which situations They are preffered?

View 2 Replies

Design Patterns & UML Diagrams?

Apr 27, 2010

what are design patterns and UML diagrams with best examples. How we should use in real time scenarios. Recurring iam facing these type of questions in project round.

View 5 Replies

Session Facade Vs Singleton Object Design Patterns?

Mar 27, 2010

which one is better in "Session Facade Class" and "Singleton Object" design patterns in ASP.Net? Also, please state the scenarions where specific design pattern is advisable to use.

View 1 Replies

Architecture :: Design Patterns For Handling User Web Navigation And Flow?

Jan 20, 2011

Our site is expected to allow the user to do whatever they want from a number of different places. Except, that doing whatever they want really means firing off mini sequences of pages they must vist (or possibly abort from to go off to another task) before returning to their starting point. So, at any given time, the user has a list of pages they are allowed to go to, a list of pages they must go to in order to complete their task, and some end point they must eventually return to, all of which are constantly changing.

As an example, a user may choose to edit an order they placed, at which point they must step through a series of pages to edit the order. These pages to edit an order may be different based on the type of order they are editing, and they must return to whatever place they were at when they decided to start editing the order. They may also have certain options of other pages to visit during their order editing process.

I really need a good way to handle this for a large number of different scenarios, and allow it to be easily changed. Right now we are doing things like setting session variables when a user chooses an action and checking them within the page on button handlers to see what they are allowed to do or where they are allowed to go. I'd love to be able to abstract this out into something that can be easily examined in one place, or even data driven, and have some sort of navigation controller pointing them to the pages they can or must go.

View 6 Replies

Design Patterns - Singleton Behavior With Multi-user Requests In C#?

Jan 7, 2011

I need to create a singleton that would hold lots of data for a spedesign patterns - Singleton behavior with multi-user requests in ASP.NETcific user. However, I am not unclear as to what the behavior of that singleton is in regard to multi-user app requests.

Here is the scenario:

On AppStart event I want to load common data for all users (from SQL) and store it as a collection somewhere within the ASP.NET storage mechanisms.

If I store that data in the cache, I would also have to create a static property in the Global.asax that would provide access to that the data from the cache.

This is not ideal because whenever an instance of any particular page, or generic handler, or what have you tries to query this data using Linq the property has to load the data from the cache... introducing latency. I need this data to be immediately available. (think of it as about 5K rows of data stored in collection of objects...)

I was thinking to use a singleton to get that data, and store it but I don't know how it would behave between requests (and postbacks), as well as application instances, in terms of its persistence.

On PostAuthenticate event I want to get user specific data from SQL in the form of a collection. If i store it as a singleton (in a similar manner as the common data) i am not clear as to:

How is the data persisted? What is the scope of that singleton (it should be for the duration of the user session). How can I ensure that the data is immediately available to whatever needs to consume it?
What happens between post-backs to that singleton? If another user logs in would another instance of that singleton be created for that specific application instance?

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;

[code]...

View 2 Replies

How To Implement Three Tier Architecture

Jul 12, 2012

I would like to implement 3 tier arch in my project. What is the best and optimized 3 tier architecture in asp.net..

View 1 Replies

Web Forms :: How To Implement 3-tier Architecture

May 7, 2015

I want to use 3 -tier archhitecture in my registration form how to do that in a simple way....

View 1 Replies

WCF / ASMX :: How To Implement Web Services In A 3 Tier Architecture

Oct 5, 2010

how to implement web services in a 3 tier architecture and also give a brief idea about how to implement coding as soon as possible.

View 1 Replies

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?

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

View 5 Replies

Web Forms :: Implement Three Tier Architecture In Entity Framework 4.0

Nov 9, 2012

Any good example of Three tier architecture in entity framework 4.0 ...

View 1 Replies

Architecture :: .NET Web-Application Architectures / Patterns?

Jul 9, 2010

Does anybody knows good, short and slim tutorials (not here ), which describe actual/modern web-application architectures / patterns (especially for ASP.NET based (classic and MVC) applications (maybe also with embedded Silverlight components) ? How would you you design today an ASP.NET application which uses different datasources (databases, services,...) ? Background: I has been away a couple of years writing web applications, and I want to start now again. So at the moment I am a little bit unsure, how to take off and find the right starting point.

View 3 Replies

MVC 3 Application Using Ninject, Entity Framework 4 Code-First CTP 5, Patterns

Jan 24, 2011

ive tried to build some base project with above technologies. I wanted maximum flexibility and testability so i tried to use patterns along the way to make this as a base for future projects. However, it seem.something is wrong or whatever and i really need help here. So

i have two questions :1- Is there anything wrong with my current code ? Ive applied patterns correctly ?

2- Why do this code actually connect to the database, create it, but doesnt support insert even if i perform the corrects operation ? (Look at the end of the post for details about this error)

I have two entities : Comment and Review

COMMENT [Code]....

REVIEW[Code].... I built up a base repository for each of them this way :GENERIC REPOSITORY[Code]...For specific operations, i use an interface :[Code]....So i am getting the generics operations from the abstract class plus the specific operations :[Code]....As you figured out, i also use a database factory will produce the database context :DATABASE FACTORY [Code]....DISPOSABLE (Some extensions methods...)[Code]....DATABASE [Code]....And to finish, i have my unit of work....UNIT OF WORK[Code]....I also binded using Ninject the interfaces :NINJECT CONTROLLER FACTORY [Code]....however, when i call in the constructor ...[Code]....

This seem to create the database but doesnt't insert anything in the database in EF4. It seem that i may figured out the problem.. while looking at the database object.. the connection state is closed and server version throw an exception of this kind :

ServerVersion = '(((System.Data.Entity.DbContext (_database)).Database.Connection).ServerVersion' threw an exception of type 'System.InvalidOperationException'

I am doing the right things ? Is there anything wrong in what ive built ? Also if you have recommandation about the code i posted, i would be glad. I am just trying to the learn the right way for building any kind of application in MVC 3. I want a good a start.

I use :
- Entity Framework 4 Code-First CTP 5
- ASP.NET MVC 3
- Ninject as DI Container

View 4 Replies

Architecture :: Architecture And Design Patterns?

Mar 16, 2011

hat is the difference between Architecture and Design patterns ?

View 8 Replies

Visual Studio :: Design View Is Not Able To Pull In The Application For Design?

Feb 23, 2010

can't connect to sql 2005 express sp1 and vs is also sp1. 2) Which my guess is because of the database connection not being able... design view is not able to pull in the application for design, it's as if there is no theme and css just white background and black print.

View 1 Replies

Architecture :: Entity Model Design Framework And N - Tier Architecture

Dec 25, 2010

recently i've studied on ADO.NET's Entity Model Framework and say 'wow' as ORM is one of the fevourite pattern i practice..but suddenly i've come to an ambiguous situation when i'm going to start. i usually follow the following 3-tier architecture..

1. UI Layer
2. BLL - business logic layer
3. DAL - Data Access Layer
a. DTO / DAO
b. Gateway (contains the sql query/stored procedure and connection with DB)

now when i'm going to use the Entity Model Design,where the DBML/ .edmx File should be placed? Because many a times i'm using the DBML file as DTO because of the mapped objects.. in the same time, sometimes DBML ( .edmx file in .NET 4.0) contains CRUD methods and stored procedured method as well as methods with different selection operations,- which should be in Gateway. so where the .edmx file should be placed !?!! IN DTO namespace !? or in Gateway namespace!

moreover sometimes there is no need for the BLL which breaks the rules of inter-layer-communication (UI > BLL > DAL.Gateway)! what makes me confuse is, what should be the ideal n-tier architecture when i'll use the ADO.NET Entity Model Design Framework

View 4 Replies

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

Recommended Tier Framework For Web Application?

Mar 1, 2010

trying to switch to better coding practises, I am totally confused about which path to choose. For the past year I was just coding through classic asp coding methodology. Now I know about things as

3 tier custom 3 tier with Strongly typed data sets N tier applications Custom entity objects and so on

Can someone recommend me an approach for designing web applications from these? Some book or tutorial reference with simple CRUD application that would help me. I am currently stuck with strongly typed data sets as I cant find CRUD tutorials with that approach. I would like to just choose the right approach and build on it.

View 4 Replies

Way To Implement The PRG Design Style In A Small Site

Feb 20, 2010

I'm trying to figure out a logical and quick way to implement the "PRG" design style in a small site I'm doing, and I'm finding an issue I can't think of a good way to solve.I have a form. It has 2 fields (first and last name). When the user submits the form, I check to make sure that they have data in them before I save it to the database. If they do not, then I show them a nice little error message and leave what little they have entered still in the form.However, in order to correctly implement PRG, as I understand it

View 1 Replies

Architecture :: Handle Transactions In 3 Tier Web Application?

Jul 2, 2010

I' am trying to write a aplication using a 3 Tier Model

Data Access Layer <--> Business Logic Layer <--> Presentation Layer

But now i am facing a problem, i need to Handle Transactions i already found a interesting article

[URL] but i have some doubts.

For example when i need to iterate to a Grid in the presentation Layer how will i Use the Transactions??

[Code]....

View 2 Replies

Architecture :: Connect Different Server In 3 - Tier Application?

Nov 1, 2010

I want to develop a three tier architecture app.I have no idea when weplace our BLL and DLL code in different server how to connecct this BLL and DLL code to our Website(UI).

View 4 Replies

Architecture :: Data Validation In A 3 Tier Application?

Aug 31, 2010

Say you have a form designed in Silverlight(Front end)-Asp.NEt(business layer)-SQl(bakcend)Should data validation occur on all 3 layers or just the presentation layer or a combination of the front end with the other 2 e.g. validating an email address? I'm trying to undestand as to why if data has been validated on the presentation why further data validation would be necessary especially if there would be large amounts of data being validated and this could potentially slow down database transactions?

View 4 Replies

Web Config - Where Should Connection Strings Be Stored In A N-tier Application

Sep 29, 2010

I have an ASP.NET project which is pretty n-tier, by namespace, but I need to separate into three projects: Data Layer, Middle Tier and Front End.

I am doing this because...

A) It seems the right thing to do, and

B) I am having all sorts of problems running unit tests for ASP.NET hosted assemblies.

Anyway, my question is, where do you keep your config info?

Right now, for example, my middle tier classes (which uses Linq to SQL) automatically pull their connection string information from the web.config when instantiating a new data context.

If my data layer is in another project can/should it be using the web.config for configuration info?

If so, how will a unit test, (typically in a separate assembly) provide soch configuration info?

View 3 Replies







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