data-access-layer

What factors should effect the Data Access Layer I use on a new project?

I will be teaching a class sson, and I need to explain what factors should affect your decision of data access technology. I am familiar with many data access methods like Typed Data Sets, Linq to SQL, Linq to Entities, .netTiers, LLBLGen, and custom calls with SQL connection objects and command objects. Some of my clients will only all...

Data Access Layer: Exposing List<>: bad idea?

Hi everyone, I am currently coding a simple Data Access Layer, and I was wondering which type I should expose to the other layers. I am going to internally implement the Data as a List<>, but I remember reading something about not exposing the List type to the consumers if not needed. public List<User> GetAllUsers() // non C# users: t...

Database Abstraction - supporting multiple syntaxes

In a PHP project I'm working on we need to create some DAL extensions to support multiple database platforms. The main pitfall we have with this is that different platforms have different syntaxes - notable MySQL and MSSQL are quite different. What would be the best solution to this? Here are a couple we've discussed: Class-based SQL ...

Quick/Easy generation of CRUD pages & Data Access Layer in CMS

I have a database that I would like class files generated from, and also a .aspx page generated which contains a listview to interface with the classfile for create/read/update/delete. I have started to use Subsonic but am not sure how flexible the scaffold control is. Also, LINQ seems like an option, but it would be nice if that was g...

Addendum to my question from yesterday: C# class from sql database

This is my link: link text Thought about it and this was my additional question: Now If i am going against stored procedures, is there an easy way without using T4, LLCodeGen, Codesmith, subsonic, etc..to obtain the input/output params and types if i wanted to generate my own data access layer This is ASP.Net 2.0 ...

How do I determine if a column is in the primary key of its table? (SQL Server)

I am currently using... select Table_Name, Column_name, data_type, is_Nullable from information_Schema.Columns ...to determine information about columns in a given database for the purposes of generating a DataAccess Layer. From where can I retrieve information about if these columns are participants in the primary key of their table...

How to architect DAL for WebService exposure?

We have a highly specialized DAL which sits over our DB. Our apps need to use this DAL to correctly operate against this DB. The generated DAL (which sits on some custom base classes) has various 'Rec' classes (Table1Rec, Table2Rec) each of which represents the record structure of a given table. Here is a sample Pseudo-class... Public...

Code generators or ORMs?

What do you suggest for Data Access layer? Using ORMs like Entity Framework and Hibernate OR Code Generators like Subsonic, .netTiers, T4, etc.? ...

How does the MVC pattern differ, if at all, from the DAL / BLL design pattern?

I'm making my way through the early Data Access Tutorials on Microsoft's ASP.NET website and it occurred to me that this all seems awfully similar to what I have read about separating your logic and presentation code using the MVC pattern. As a newbie I have yet to implement the MVC pattern but I'm curious as to how these two design stru...

Is it worth it to write a bunch of 2 liner functions in BLL object just to re-route to DAL?

It seems pretty silly to me. What don't I get? ...

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, and it turns out his data access layer is just a small class wrapping a few SQL methods (...

What data access strategy for a large application

I am about to embark on a rewrite of a VB6 application in .NET 3.5sp1. The VB6 app is pretty well written and the data layer is completely based on stored procedures. I'd like to go with something automated like Linq2SQL/Entity Framework/NHibernate/SubSonic. Admittedly, I haven't used any of these tools in anything other than throwawa...

Repository Pattern vs DAL

Are they the same thing? Just finished to watch Rob Connery's Storefront tutorial and they seem to be similar techinques. I mean, when I implement a DAL object I have the GetStuff, Add/Delete etc methods and I always write the interface first so that I can switch db later. Am I confusing things? ...

Is it really such a bad idea to use webservices to wrap data-access layer?

I am not convinced - I think it might be useful to expose your data to different consumers that can build their front-end apps on top of your webservice. Can someone provide samples of when using web-services to wrap data-access layer is a bad idea? ...

Need advice regarding layered solution, separation of concerns, etc.

We have a layered application, or at least is in the process of transitioning to one, broken down as follows: Interface (user-interface or application-interface, ie. webservice, etc.) Business logic Data access To make the rest of this question more concrete, I'll describe a specific instance. We have a user interface, which has a c...

Better way to build objects in C#

I have an application with my object types that inherit from a base class that contains the majority of properties for the application objects. All the object types are stored in one table in the database. The "ClassType" column determines what object type I cast the SqlDataReader row to. Here is my current implementation: SqlDataR...

How to correctly unit test my DAL?

I'm new to unit testing. But how do I unit test my DAL which is written with Entity Framework, so I can make sure my DAL code is working correctly but no database is actually touched? Could someone give as much detail as possible please. Thanks, Ray. Note: this post is relevant to my other post Mocking vs. Test DB? which is asked aft...

Mocking vs. Test DB?

Earlier I asked this question How to correctly unit test my DAL?, one thing left unanswered for me is if to really test my DAL is to have a Test DB, then what is the role of mocking vs. a testing DB? To add on this, another person suggested to "use transactions and rollback at the end of the unit test, so the db is clean", test db that ...

Any DAL/ORM on GAE?

Is there any Database Abstraction Layer (DAL) or Object Relational Mapper (ORM) that works on Google App Engine (GAE), and on normal relational databases (RDBS), other than web2py's? If not, is anybody working on porting one of the existing DAL/ORM to GAE? ...

Return ADODB.Recordset type from .NET to Classic ASP

I have a DAL that I want to return an ADODB.recordset when executed from a classic asp. The object is exposed as a com object and I have a complete dal workin but I am not sure how to return an object that is a recordset that .net can use. Any help would be aprcitated. Thank you! --Nicolas ...