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
1 answer

should our data access layer be in a WCF service, or dll?

Our product has two clients, a website and a windows application. Both clients need to share the data access layer because it contains some of our complex business logic that we do not wish to duplicate. Should this layer be exposed as a WCF…
Steve Goykovich
  • 757
  • 1
  • 9
  • 17
0
votes
1 answer

how to use EF 4.3 data migration feature in multi-layer application?

i have 3 projects : ef code first in the data access layer . and service layer ,and a mvc project . how can i use data migration when i changed ef poco class without recreating database?
0
votes
1 answer

ASP.NET Provider Model for Data Access

Just been introduced to the ASP.NET Provider Model as a potential data-access technology. My own idea is to use LINQ repositories, but want to keep an open mind. Any thoughts? Thanks
Duncan
  • 10,218
  • 14
  • 64
  • 96
0
votes
2 answers

How do you deal with Service methods on 2 very similar sql tables

I have 2 sql tables which are very similar. Only the Foreign Key is different for each table. TemplateUnit table: Id (PK) ParentId Name TemplateId (FK) TestplanUnit table: Id (PK) ParentId Name TestplanId (FK) When I go for 2 tables which has…
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
0
votes
2 answers

Data Access Layer in Asp.Net

Am Afraid If am Overdoing things here. We recently started a .Net project containig different Class Libraries for DAl,Services and DTO. Question is about our DAL layer we wanted a clean and easily maintained Data access layer, We wanted go with…
Suave Nti
  • 3,721
  • 11
  • 54
  • 78
0
votes
2 answers

Does a concurrect exception happen to both user

if a user edits a data record and the same time another user edits the same record too and both save. 1.) Will the concurrency exception ALWAYS happen only for one user? Actually its logical that the first wins but who is the first in a technical…
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
0
votes
1 answer

Dynamic Data Access Layer with EF4.3

I have been tasked with designing a data access layer that will connect to tables with interchangable schemas(used for permissions and separation). The database itself may different each call as well (because of business rules). I plan on using…
0
votes
1 answer

Pagination and DAL

I'm currently implementing my DAL using DAO's. I would like to do pagination at the database level, so in my DAO's I currently have methods like getEvents($page, $limit) and getEventCount() Then in my service layer I'm returning an array…
0
votes
2 answers

Mapping class properties to generic columns in table .NET

I have have a SQL Server table which has generic names like Text1, Text2.. etc. The table was designed like this because the same structure is used for different projects. I have a class in .NET which has properties. Say a Customer class has a…
Tony_Henrich
  • 42,411
  • 75
  • 239
  • 374
0
votes
2 answers

Stored procedure with data adapter, throwing SerializationException

I'm running this code where basically I have a stored procedure which is inserting a new row into the table member. I have posted the code of the method from C# to call the stored procedure and the code where I'm calling that method: Stored…
0
votes
1 answer

Generate a nested CRUD form

From a logical perspective it sometime doesn't make sense, for example, to add an Address before you add a Customer. db.define_table('address', Field('line1','string', required=True), Field('line2','string'), Field('suburb','string',…
A T
  • 13,008
  • 21
  • 97
  • 158
0
votes
1 answer

Creating Data Access Layer by using the template pattern

I have some problem with writing a Method in the template pattern style. But first my code: My Base class I am using looks like this: public abstract class DbBase where T : new() { protected abstract Value CommandValue { get; } protected…
MUG4N
  • 19,377
  • 11
  • 56
  • 83
0
votes
1 answer

DAL design: handling access to 2 or more tables in a database?

I'm developing on php at the moment, but this question should be language independent. For DB access, I have always heard people promoting the "one class per table" practice, so I'm wondering where to put access methods that accesses 2 or more…
Peter
  • 361
  • 1
  • 3
  • 6
0
votes
4 answers

Can I use the the power of Generics to solve my issue

I have a wierd issue. I am loading 1k invoice objects, header first then details in my DAL. I am using VB.NET on this project. I am able to get the invoice headers just fine. When I get to loading the details for each invoice I am getting a timeout…
Saif Khan
  • 18,402
  • 29
  • 102
  • 147
0
votes
1 answer

Entity framework projection or

Let's say I have existing application with Db which was designed using EF Model First approach. I have Users table, when client-code tries to read an entry from Users table DAL logic projects EF entities to plain objects (which are just simple C#…