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
8
votes
7 answers

What ORM to Run: telerik Open Access VS Subsonic VS linq to sql VS Active Record

We are looking into using an ORM and I wanted some opinions/comparisons The basic criteria we have for an ORM is: Easy to use/configure(short learning curve), flexible, the ability to abstract it away, easy to maintain Here is a list of what…
Bob The Janitor
  • 20,292
  • 10
  • 49
  • 72
8
votes
5 answers

How can Dispose() know it was called because of an exception?

I'd like to write a simple unit of work class that would behave like this: using (var unitOfWork = new UnitOfWork()) { // Call the data access module and don't worry about transactions. // Let the Unit of Work open a session, begin a…
Ilya Kogan
  • 21,995
  • 15
  • 85
  • 141
8
votes
3 answers

What is the difference between ORM and DAL?

I have read up on both, but it has just confused me more. I have tried to find the differences (and similarities), but am unable to convince myself. Both of them are an intermediate layer between the business logic and the database. Is there a…
ASR4
  • 545
  • 1
  • 8
  • 24
8
votes
3 answers

Future Proof DALs

We are in the beginning of a really long development project with several sub projects. Basically each sub-project will take several months to develop. The code itself will be split up into several C# projects, but the physical database will be…
Timothy Baldridge
  • 10,455
  • 1
  • 44
  • 80
8
votes
4 answers

What would you choose if you could use any .NET DAL technology?

I'm getting back into .NET development after a couple years and it seems that now, especially with LINQ, the way you access your data has changed and become much easier. For instance, in a ASP.NET MVC website, I can: Add Item add LINQ-to-SQL…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
8
votes
2 answers

is it good to make Data Access Layer a separate layer from service layer

I am having a question about the architecture I am working with. we have a backend restful service, a data layer(which is implemented by python eve and also a restful service), and the database. The data (access) layer itself is a independent…
Acton
  • 255
  • 4
  • 13
8
votes
6 answers

Generating LINQ to DB2?

I have an existing DB2 database at my job. (At least, I think it's DB2. They refer to it as "the iSeries" and it looks and feels like DB2 on some mainframe-ish hardware.) For years the .NET developers in my department have just manually written…
David
  • 208,112
  • 36
  • 198
  • 279
8
votes
2 answers

Is it poor design for DAOs to manage transactions?

I've been reading about the sun blueprint GenericDAO implementation and Gavin King's take on this for use with Hibernate. It seems he doesn't mention anything about transaction handling: public abstract class GenericHibernateDAO
James
  • 1,720
  • 5
  • 29
  • 50
8
votes
7 answers

Define data access layer

It seems that everybody knows you're supposed to have a clear distinction between the GUI, the business logic, and the data access. I recently talked to a programmer who bragged about always having a clean data access layer. I looked at this code,…
Jim
  • 11,229
  • 20
  • 79
  • 114
8
votes
4 answers

Database testing in python, postgresql

How do you unit test your python DAL that is using postgresql. In sqlite you could create in-memory database for every test but this cannot be done for postgresql. I want a library that could be used to setup a database and clean it once the test…
StackUnderflow
  • 24,080
  • 14
  • 54
  • 77
8
votes
4 answers

Repository pattern with lazying loading using POCO

I'm in the process of starting a new project and creating the business objects and data access etc. I'm just using plain old clr objects rather than any orms. I've created two class libraries: 1) Business Objects - holds all my business objects, all…
lancscoder
  • 8,658
  • 8
  • 48
  • 68
7
votes
3 answers

What patterns to use to build layers for delphi win 32 application

I want to develop mysql database application using dbexpress to develop from scratch or work with existing databases. To create reusable layers what patterns-components should I use. I want the app to be scalable to n-tier easily. Tried google…
user114285
  • 513
  • 7
  • 19
7
votes
6 answers

.NET MVC or just plain old ASP.NET?

This is a shoutout as I've been spending the last few days learning about .NET and the process has left me a little confused rather than enlightened. Just as a background info, I have knowledge of PHP (have even used CakePHP to create a whole app…
DLS
  • 5,313
  • 8
  • 37
  • 50
7
votes
8 answers

C# static database class?

I have a Database class which contanins the follwing methods: public bool ExecuteUDIQuery(string query) // UDI = Update Delete Insert public bool ExecuteSelectQuery(string query) public bool ExecuteSP(string sp, string[,] parms) public int…
Martijn
  • 24,441
  • 60
  • 174
  • 261
7
votes
14 answers

Orm tool not allowed: What do you do?

Let's say you're in an IT shop that allows no ORM tool of any kind. They don't want to buy one, and neither can you use an open source solution. What would you do? Give up on a real domain model and work table-centric? Craft own DAL?
dotnetguy