ADO.NET :: Which Is Best Approach For Designing Data Layer

Mar 3, 2011

I'm designing a mid sized business app in asp.net / c# Framework:4.0 environment.

I'm just wondering which is the best approach for designing data access layer.

Candidates designs are:

1. ADO.Net

2. LINQ using sps or LINQ with Entities

3. Hibernate object model

View 2 Replies


Similar Messages:

C# - Designing An API: Use The Data Layer Objects Or Copy/duplicate?

Feb 25, 2011

writing a web-based application; I would like to do this in such a way that:All transactions go through a web services API (something like http://api.myapplication.com) so that customers can work with their data the same way that we do / everything they can do through our provided web interface they can also do programmaticallyA class library serves as a data layer (SQL + Entity Framework), for a couple of design reasons not related to this questionProblem is, if I choose not to expose the Entity Framework objects through the web service, it's a lot of work to re-create "API" versions of the Entity Framework objects and then write all the "proxy" code to copy properties back and forth.What's the best practice here? Suck it up and create an API model class for each object, or just use the Entity Framework versions?Any shortcuts here from those of you who have been down this road and dealt with versioning / backwards compatibility, other headaches?Edit: After feedback, what makes more sense may be:Data/Service Layer - DLL used by public web interface directly as well as the Web Services APIWeb Services API - almost an exact replica of the Service Layer methods / objects, with API-specific objects and proxy code

View 3 Replies

Designing System With Presentation Layer And Web Service Based API

Oct 19, 2010

We are designing a system that has functionality that is essentially the same at the presentation layer and the exposed API layer. My question is what technique / strategy to use so we can get the most reuse out of our code with performance in mind? Here's a simplified example: A user can add a Customer via a web form. This will fire the Customer.Create() method. An API consumer / user can add a Customer via a SOAP / HTTP-POST to a web service which will call the Customer.Create() method.

Imagine these layers:
PRESENTATION
|
|
WEB SERVICE API (Customer.Create() is available here
|
|
FACADE Business Object Interface - Customer.Create() signature is here
|
|
BUSINESS Business object - Customer.Create method() is fleshed out here
|
|
DATA ACCESS - Writes data

The presentation layer SOAP calls the Create() web method, which calls the facade's Create() method which calls the business object's Create() method which wires via the data access layer.

Questions:

Is there a concern about performance in using the API's web services in our presentation layer, or are there alternatives to connect the presentation layer directly to the facade? If so, what technology to use (WCF, Remoting, Web Services, etc)?

View 2 Replies

Architecture :: How To Pass The Data Between Data Access Layer And Business Acces Layer

Jun 3, 2010

here i have in 3-tier architecture , how to pass the data between DAL and BAL. i am using grid view to edit the data,when ever i click on the edit button all the corresponding fields should come to textboxes. i tried for delete ,it works fine bt not working to EDIT.

View 7 Replies

Architecture :: Data Access Layer And Business Logic Layer?

Jun 24, 2010

I am building a web site following the tutorials on asp.net. I am using dataset as data access lay, and writing classes to access the dataset. But the example is just basic ideas, how do I retrieve individual table column value in the business layer?For example, if I have a table called Product, I only want to find out what is the product name by product id. I did this in my ProductBLL:

public ProductBLL
{
public int GetProductName(string productId)
{
ProductDataSet.ProductDataTable prodData = Adapter.GetProductById(productId);
[code]...

Is there a better way, or am I doing this correctly? Can anybody give me a reference to a more complicated business logic model?

View 16 Replies

Architecture :: How The Data Pass From One Layer To Another Layer In Mvc Design Pattern

Apr 1, 2010

how the data pass from one layer to another layer in mvc design pattern...

View 2 Replies

Architecture :: How To Pass The Values From Presentation Layer To Business Logic Layer

Oct 26, 2010

I am new to this .NET what is the difference between N-Tier and 3- Tier Architecture. If they are same. How to pass the values from presentation layer to business logic layer.

For Example

I have 10 controls in presentation layer. I passing values to these controls. How the architecture works.

View 3 Replies

MVC :: How To Make Business Layer Seperate From Presentation Layer

Feb 23, 2011

I've even got my JQuery Ajax submission going on now but I've encountered another problem. I *think* it's something to do with the structure I'm using but like I say, I'm fairly newo this.I have my AJAX form submission which builds my "PersonViewModel" (model for the presentation layer) in JSON and sends it to "@Url.Action("RegisterSubmit")" in my Person Controller. Now, I seperate my business layer from my View/presentation layer so in "RegisterSubmit"I'm verifying the model is valid then instantiating a new instance of my business model "Person", adding the values from "PersonViewModel" and then calling my "Save" function.

View 7 Replies

Business Layer Errors And Service Layer Handling?

Mar 7, 2011

We're building a large web app that has numerous layers. In order to communicate to the business layer we're using a service layer that the web layer calls when data is needed. Unfortunately, it seems that if exceptions are thrown in the business layer, it seems that the services on the web side are wrapping the exceptions and re-throwing them. We're looking for a clear way to encapsulate the error and log it, without WCF wrapping a new exception around the original.

View 2 Replies

MVC :: Custom Ex Class Be In The Repository Layer Or The Domain Layer?

May 6, 2010

My repositories throw exceptions (System.Exception) when some things go bad and I know this is bad practice.. so i will create a custom exception (DataException). My question is should this custom ex class be in the repository layer or the domain layer? Im thinking it should be in Domain layer where all business objects and repository interfaces live but just want to make sure.

View 3 Replies

C# - N-layer Business/service Layer Design?

Jan 26, 2011

I'm trying to reevaluate our n-layer architecture and would love to get some based on your experiences. Here is our typical .NET n-layer (sometimes n-tier) design.

Project.UI
Project.Services
Project.Business
Project.Model
Project.DataAccess

DataAccess typically consists of Entity Framework 4 and Repository classes. I attempt to follow the Aggregate Root concept in order to avoid having a repository for table, easier said than done in my experience. I tend to have ~70% match between Repositories and Tables.

Model usually consists of my Entity Framework 4 entities, I've been using Self-Tracking EF entities with success.

Business is what I struggle with the most. I typically have a Manager class for every Repository. This class will contain methods like .Add() which will perform business validation before forwarding down to repository.Add().

Services, typically I will only implement this if in fact I am looking to create a web service based solution. This layer will be tasked with marshaling requests/responses between DTOs and entities. And most importantly provide the more coarse grained interface. For example a TradingService.SubmitTrade(), which is really a facade for a business transaction which might include AccountManager.ValidateCash(), OrderManager.SubmitOrder(), etc.

My business layer is very entity centric, really it's just the glue between the entities and the repository, with validation in between. I've seen many designs where the Service Layer is what holds a reference to the repositories (in essence skipping the "business layer"). In essence it serves the same purpose as my Business layer, it does the validation, however its' responsibility (and naming) is a higher level, more coarse grained business transaction. Using the example above the TradingService.submitTrade() will not delegate to any business manager classes, it would itself query the necessary repositories, perform all the validation etc.

I like my design in a sense that I can reuse a business layer method in multiple service calls, however I hate the fact that for every repository I have a matching business layer manager, creating tons of extra work. Maybe the solution is a different type of grouping at the Business Layer level? For example combine individual Manager classes like PhoneManager and EmailManager (note I have Phone entities and Email entities) into a logical Manager class such as ContactsManager (note I don't have a "Contact" entity type). With methods such as ContactManager.GetPhones() and ContactManager.GetEmail(), etc.

View 1 Replies

C# - Best Approach To Write Huge Xml Data To File?

Apr 20, 2010

I'm currently exporting a database table with huge data (100000+ records) into an xml file using XmlTextWriter class and I'm writing directly to a file on the physical drive.

_XmlTextWriterObject = new XmlTextWriter(_xmlFilePath, null);

While my code runs ok, my question is that is it the best approach? Or should I write the whole xml in memory stream first and then write the xml document in physical file from memory stream? And what are the effects on memory/ performance in both cases?

EDIT

I will indeed be using XmlTextWriter but I meant to say whether to pass a physical file path string to the XmlTextWriter constructor (or, as John suggested, to the XmlTextWriter.Create() method) or use stream based api. My current code looks like the following:

[Code]....

View 3 Replies

Forms Data Controls :: Two DataList Control And Repeatcolumn Property And Not Properly Rendering Due To Any Designing?

Jan 7, 2010

I have Two Datalist Control . One is dtlistCat and second is dtlistSeries. dtlistSeries is filled by dtlistCat by dtlistCat_ItemDataBound method .

Coding side is ok . But Only problem in rendering . I want the page render with dtlistSeries has 2 repeat column in verticle direction I think only designning part creating problem .Not proper width or height specified so.

ViewSeries.aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage/Store.master" AutoEventWireup="true"

View 2 Replies

MVP - Presenter And The Service Layer - Where To Declare Service Layer

Mar 27, 2011

I'm reading through Architecting Microsoft .Net Solutions for the Enterprise and I try to figure a couple of things out concerning the Presenter and the Service Layer.

First off, my Presenter needs to call methods that reside in the Service Layer, like initialize(), save() etc. But where do I place a reference to the service layer? Should it be at class level in the Presenter, or should I define a new service in the presenter methods itself?

Second - this isn't really clear in the book either - is this how the processing from the Presenter to the Service Layer works?:

[code]....

View 1 Replies

Looking For Data Layer To Use For Performance?

Jul 29, 2010

I did not post this in database forum because the data will run on an asp.net site.I have 3 solution in my mind and i would like some opinions.What i want to do is create a parent-child relationship on 2 controls.A listbox and a textbox.I will populate the listbox with data(this is taken care of so ignore) and what i want to do is when i click on an item in the listbox then the textbox to show it's joined related item(one item only).This is not a problem in windows forms app but in asp, since i'm new i don't know what would be better for a faster retrieval on the page.So the 3 options i have in mind are:

1)DAL.The standard create a query and let one @parameter wait for the id.

2)ADO.NET with possibly an sqldatasource.In standard forms i would have chosen simple ado.net but in asp?So either constantly open,close the db and retrieve the item or use an sqldatasource and chance the parameter.

3)Asynchronous handler page.Bind the textbox to an asynchronous page that contains the connection and expect the @id parameter.

I admit that i'm not fond of DAL but if it will boost speed then i will use it.But i have a though that says that simple ADO will be faster.

View 16 Replies

Architecture :: Using Data Sources Vs. Using Data Access Layer To Populate Presentation Controls?

Mar 17, 2010

We are using a tierd design with a Data Access Layer and classes for everything we need. This serves as an advantage because we do not have to write querys over and we can separate the Presentation layer from the Data Access Layer and Business Rules.I have always in the past populated GridViews, DataLists, repeaters,etc with SqlDataSources. This is what I have become accustomed to and I feel like it is simple. For querys such as Select * from Members, I feel like using a DataSource is simpler than having to go in the code and calling methods to populate and DataBind these presentation controls.


I am working with a gentleman who has introduced me to the world of Data Access Layers and we are breaking everything down into simeple, but effective queries to populate controls and do what we need to accomplish with this application. He is not very approving of using any type of DataSource. We are disagreeing on the time and place to use these class methods to call the database.So my question is, which is more widely used in the programming world? Do most people use DataSources to populate presentation controls regardless of the Data Access Layer they are working with? Which type of queries are best suited for a DAL - simple, populating queries or complicated joins and upserts?

View 9 Replies

ADO.NET :: Building Data Access Layer In 3.5

Aug 25, 2010

In old style i used to return datasets to BOL (From DAL) and then to Website. but in 3.5 is there any new way to construct DAL. i heard about returning List<> is better than DataSet. I Got to build new DAL for my new project. if i should go for List <> aprroach can i use Linq to Sql technique or shall i go for execute dataset (using applicatio block libraries) and then fill data in List<> prior to return it back to BOL.

View 1 Replies

Can Get The Data Access Layer .cs File

Feb 2, 2010

I want to get the .cs class file that we use when we work with the data base. and then I can just include it in all the files.

it should contain all the information like rundbquery, runstoredproc,runstoredprocwithparams....etc.

View 3 Replies

ADO.NET :: Connectionstring In Data Access Layer?

Nov 1, 2010

I am developing a web application in Visualt Studio 2008. I have a data access layer that is automatically generated using Visual Studio. After publising my site to IIS and tested it for several hours, two exceptions occured:

[Code]....

The connection string is stored in the data access layer in Properties.Settings and has not changed.Does anyone have a clue why these exceptions occur and how i can avoid them?

View 1 Replies

.net - Data Access Layer As A Web Service?

Aug 18, 2010

I have been researching for a while and have actually created a prototype ASP.NET web service as a DAL for a few ASP.NET 2.0 web sites. Just would like to ask for some insight/advice from more experienced developers out there who had successfully rolled out DAL as a web service. What are the drawbacks/risks to deploying DAL as a web service? What is the best way to secure or authenticate consumption of this web service? WCF is out of the question, I'll be coding in VS 2005.

View 4 Replies

Forms Data Controls :: How To Pass DDL Selected Value To Data Access Layer

Mar 24, 2010

I'm having a difficult challenge of passing a DropDownList Selected Value to a Data Layer having a Function containing 'cmd.Parameters.AddWithValue("@CourseDDLid", CoursesDDL.SelectedValue.ToString)'. Visual Studio is indicating I need to declare 'CoursesDDL'. I tried accessing the 'Find Control' method but it did not work. Below are the codes for your review.

[Code]....

View 3 Replies

DataSource Controls :: Encapsulate A Data Access Layer With WCF Or WCF Data Services?

Jul 12, 2010

Are there scenarios where it makes sense to encapsulate a data access layer (of a ASP.NET webapplication) with WCF or WCF Data Services ? Makes it sense to use a service inside the application ?

View 2 Replies

Forms Data Controls :: Looking For Clean Approach To Building Nested Datalist Or Nested Gridview

Jun 17, 2010

Is there a better, cleaner way to do this in ASP.NET 2.0?

An ASP.NET 2.0 page displays a datalist of records. Each record can have many dates, so the dates are in a nested gridview (I chose a gridview over a datalist here because we want to be able to delete a date and this is easier done in a gridview). The parent record can never be deleted.

The display works fine: the nested gridview gets its datasource during the parent datalist's OnItemDataBound event.

The problem: the nested gridview's delete function. The date gets deleted without a problem (handled in the OnRowDeleting event), but somehow the redisplay is untying all the other nested gridviews from their datasources. The delete does not appear to cause a page postback, so I don't know how the other nested gridviews are losing their datasources.

View 3 Replies

Data Access Layer With Enterprise Library?

Jun 14, 2010

I've VS2008 and enterprise library 4.1 installed .I want to display few records in the categories table of my NorthWind in my presentation layer through data access layer with enterprise library. I've added references of the following dlls in my data access layer project( which is of type class library)

Microsoft.Practices.EnterpriseLibrary.Common

Microsoft.Practices.EnterpriseLibrary.Data
Microsoft.Practices.ObjectBuilder2

how to access data from the database using datareader , entity beans and rendering data on to presentation layer.

View 2 Replies

DataSource Controls :: Why Should Use A Data Access Layer (DAL)

May 10, 2010

I'm now reading this article:[URL]But I don't understnad why this is better than just writing code, methods that connects to DB and get from stored procedore what I need.
Why is it better to use so much DataSets for all the tables and more.

View 8 Replies







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