Questions tagged [data-access-layer]

Data access layer is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database.

A data access layer (DAL) in computer software, is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database.

For example, the DAL might return a reference to an object (in terms of object-oriented programming) complete with its attributes instead of a row of fields from a database table. This allows the client (or user) modules to be created with a higher level of abstraction. This kind of model could be implemented by creating a class of data access methods that directly reference a corresponding set of database stored procedures. Another implementation could potentially retrieve or write records to or from a file system. The DAL hides this complexity of the underlying data store from the external world.

For example, instead of using commands such as insert, delete, and update to access a specific table in a database, a class and a few stored procedures could be created in the database. The procedures would be called from a method inside the class, which would return an object containing the requested values. Or, the insert, delete and update commands could be executed within simple functions like registeruser or loginuser stored within the data access layer.

Also, business logic methods from an application can be mapped to the Data Access Layer. So, for example, instead of making a query into a database to fetch all users from several tables the application can call a single method from a DAL which abstracts those database calls.

1287 questions
0
votes
2 answers

Generic DataAccess Layer in C# 3.5

What are the best practices to creating a Generic DataAccess Layer in C# 3.5. Dose LINQ to SQL have any support for Other DataSources like MySQL , Oracle etc.
Greens
  • 3,061
  • 11
  • 43
  • 61
0
votes
2 answers

Seeding EF Database in a Separate DAL Project

I'm starting a new ASP.NET project, and I'm trying to follow the multi-project approach I've seen mentioned in multiple questions around Stackoverflow. I've been following this tutorial, but it assumes only one project for your entire solution. Most…
0
votes
1 answer

Using the web2py DAL with temp tables

I'm trying to execute some raw SQL against a temp table through the web2py DAL, but my results are all returning None. Here's the full function: def test(): db_test = DAL('mysql://root:root@localhost/test') sql = """CREATE TEMPORARY TABLE…
Yarin
  • 173,523
  • 149
  • 402
  • 512
0
votes
1 answer

How to add parameters and execute a generic IDbCommand

Here is my problem in detail. I have created a data access layer class that allows me to create most of objects I needed to communicate with databases (Odbc, OleDb and SqlClient). I also have created a business object handling layer class with…
0
votes
1 answer

Data validation in software

Should the data validation be in the application/business layer or should it part of the data access layer-acting as a gateway to what goes into the data store?
Sam
  • 933
  • 5
  • 14
  • 26
0
votes
1 answer

Entity Framework as DAL how to implement Update and Delete correctly

I'm writing a DAL class using EF4.0, I've read http://www.codeproject.com/Articles/43367/ADO-NET-Entity-Framework-as-Data-Access-Layer and http://msdn.microsoft.com/en-us/magazine/cc700340.aspx But when I test their code, I meet some problem with…
Edi Wang
  • 3,547
  • 6
  • 33
  • 51
0
votes
4 answers

Recommended data structure for a Data Access layer

I am building a DataAccess layer to a DB, what data structure is recommended to use to pass and return a collection?
Ashish
  • 391
  • 1
  • 3
  • 7
0
votes
1 answer

How to make the connection string in DAL project refer to the database in APP_DATA folder in MVC 3 project

I'm working on an MVC 3 project, and i created a DAL project too. the EDMX is in the DAL project, and of course there is a connection string in the App.config(in the DAL project) so everytime i want to update the edmx it refers to this connection…
0
votes
1 answer

does web2py's DAL automatically create forward references when a child table references the parent?

The following information is from page 270 of the web2py book: person = db.person(id) for dog in person.dog.select(orderby=db.dog.name): print person.name, 'owns', dog.name In this last expressions person.dog is a shortcut…
Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61
0
votes
1 answer

is there a list of naming conventions for web2py's DAL?

Clearly, the implicit naming conventions for DAL/web2py are different from the conventions adopted by Rose::DB::Object but i dont see any explicit list of such conventions anywhere. Is there a set of principles that guide the name of tables and…
Terrence Brannon
  • 4,760
  • 7
  • 42
  • 61
0
votes
6 answers

Datareader or Dataset in Winform with long trips to database?

I've got a Winform app that will be used in the US and China. The SQL Server 2005 database is in the US, so the data access is going to be slower for the people in China. I'm deciding between using a DataReader and a Dataset for best performance.…
Chris Burgess
  • 5,787
  • 13
  • 54
  • 69
0
votes
1 answer

Is it possible to SaveChanges except an entity?

The Problem Initiating a new entity(call it "TargetEntity") to insert, I'm using another entity properties(call it "TemplateEntity"). some properties of TargetEntity are getting the values of TemplateEntity properties and its' navigation…
Reza Owliaei
  • 3,293
  • 7
  • 35
  • 55
0
votes
1 answer

Spring Custom User Details from DAL - Casting

I'm currently working on a System that makes use of Spring Security. I have the Authentication Provider setup but I'm having a problem creating a custom User Type which would store all the information I need. In the Authentication Provider, I call a…
Johann du Toit
  • 2,609
  • 2
  • 16
  • 31
0
votes
2 answers

Data access layer by file implementation in spring

I defined a Data Access Layer for my application CRUD operations and its interfaces. I want temporary save/load data to/from file but finally I will define appropriate model in relational database. So I wrote a file implementation of defined DAO…
Sam
  • 6,770
  • 7
  • 50
  • 91
0
votes
2 answers

Move Data Access logic from the business layer to the data access layer

I am doing an asp.net mvc application having a Data Access Layer (DAL). Having done 90% of my database CRUD code I asked myself wether I need a Business Layer. But what should I put there? All my CRUD methods in the DAL are not single Selects on one…
Pascal
  • 12,265
  • 25
  • 103
  • 195