data-access-layer

Communicating Concurrency Conflicts to the Application Layer

When communicating concurrency conflicts to your application layer, is there an alternative to using exceptions that also respects the principle of Command-Query Separation, or are exceptions the best mechanism we have (in languages that support exceptions)? In the bowels of my application, I have optimistic locking logic that executes ...

OOPS and ADO.Net

Hi, I am building an bugtracking application where I am thinkining of taking maximum possible benefits of OOPS starting from my presentation layer to my data access layer. The architecture will be as usual 3-tier but I want to use Design Patterns or simply OOPS to create connection pull out data or something like that. ...

Decoupling into DAL and BLL - my concerns.

Hi, In many posts concerning this topic I come across very simple examples that do not answer my question. Let's say a have a document table and user table. In DAL written in ADO.NET i have a method to retries all documents for some criteria. Now I the UI I have a case where I need to show this list along with the names of the creator...

Generate A Simple Read-Only DAL?

I've been looking around for a simple solution to this, trying my best to lean towards something like NHibernate, but so far everything I've found seems to be trying to solve a slightly different problem. Here's what I'm looking at in my current project: We have an IBM iSeries database as a primary repository for a third party software...

.NET How would I build a DAL to meet my requirments?

Assuming that I must deploy an asp.net app over the following 3 servers: 1) DB - not public 2) 'middle' - not public 3) Web server - public I am not allowed to connect from the web server to the DB directly. I must pass through 'middle' - this is purely to slow down an attacker if they breached the web server. All db access is via sto...

Should I return IEnumerable<T> or IQueryable<T> from my DAL?

I know this could be opinion, but I'm looking for best practices. As I understand, IQueryable implements IEnumerable, so in my DAL, I currently have method signatures like the following: IEnumerable<Product> GetProducts(); IEnumerable<Product> GetProductsByCategory(int cateogoryId); Product GetProduct(int productId); Should I be usin...

Entity Framework conversion from v1 to v4 problem

After converting my data access layer project from EntityFramework v1 to v4 a got a bunch of errors for each of the entity classes: Error 10016: Error resolving item 'EntityTypeShape'. The exception message is: 'Unresolved reference 'NS.EntityName1'.'. DataAccessLayer\Model.edmx and Error 10016: Error resolving item 'AssociationCo...

What is better: sql string or stored procedures?

I have a data access layer which uses the Enterprise Library. Now I was wondering, which is better: Using stored procedures to create my SQL, or writing SQL strings within the data access classes? ...

Using unity to decouple business logic layer from data access layer

I have implemented Unity within my Asp.Net MVC2 project. I am currently registering my BLL types on Application Start. Then I created a class called UnityControllerFactory that is in charge of resolving my dependencies within my controllers. I am simply using Property injection to accomplish this by using the dependency attribute. ...

Update entity therough DTO

Hello guys. I've got common scenario: SL app and wcf service as data source. I use dtos for transport business objects over the wire. I get issue - Update entity. At client form I have binded dto and send to wcf. I want to know nice way update real db entity by dto data. At wcf I use Nhibernate DAL. My way is getting attached entity by i...

Usage / handling of non relational datasources in .NET applications

Which .NET (data / middel-tier) technologies / framworks can / should be be used, if the datasource isn't a classical relational database, but a service or a remote function call or whatever ? Are technologies like WCF RIA services or WCF DATA services (OData) suitable for handling non relational datasources. ...

Where to catch exceptions

I have a WCF svc separated into a Service Layer, Business Logic Layer and Data Access Layer. When my DAL encounters an exception, should I catch it there or let it bubble back up to the Service Layer? And why? Please disregard any client involvement for this scenario, I am only concerned with logging the exceptions on the WCF svc. ...

I need a SubSonic 2.0.3 - SubCommander exe

I am trying to make changes to a site that uses SubSonic 2.0.3. I have all of the code but I need to regenerate some database tables. I do not have the SubCommander exe though. I looked for an archive location but I can not find it. Is there a way to get the SubCommander of this version. I really don't have the time to change every pag...

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<T, ID extends Serializable> { protected Session getSession() { return HibernateUtil.getSessionFac...

n-layered architecture - BLL, DAL and interfaces. What is best practice?

I have a question regarding n-layer architecture. I thought long and hard before asking this question as there's a lot of similar questions here already... however, after literally a day and a half looking at it and reading these other answers I'm still unsure. The variety of seemingly similar terminology and different approaches has me ...

how to design a single methon in DAL to retrieve various result from database?

Hi , we have designed our Data Access Layer and parts of it works as a charm without any problem but we have some doubts about designing a method to get a reference of sqlcommand from us and return a single row data from database also the retrieved data has an unknown data type here is what I've done : //I am using this class as retrie...

What would you suggest for a DAL for isolation between the BL and a middleware stack?

Here's the situation: I have a middleware stack (third party, no sources) that provides services to a database using an HTTP XMLRPC server. The middleware provides several methods to query data and also a way to pass in a SQL string to the database and return the results if applicable. This is fine for simple scenarios but highly ineff...

Creating a Data Access Layer when using Web Client Software Factory 2010

I am exploring WCSF and wondering how is the data access layer created? Some of the articles I have found are two years old and talk about using Web Service Factory. I am using VS 2010 and .Net 4.0. I am looking for some sample and tutorials with real world examples. ...

Learning New Concepts or syntax.

I want to learn new concepts in .NET. I have taken my old ecommerce website and reimplemented it using different concepts. Its one "Hello World" Website for each technology. I am hoping to learn "syntax",separation of tiers,testing, performance and code generation. Different databases like relational and NoSql. Objective is to touch dept...

C#: Services access the dataprovider class running the sql statements - correct approach ?

Hello, is this a common and/or good approach? In my ViewModel(Wpf) or Presenter(WinForms) I do this: ICustomerService customerService = MyService.GetService<ICustomerService>(); ICustomerList customerList = customerService.GetCustomers(); the CustomerService class looks like this: public class CustomerService : ICustomerService { ...